/*
 * Captain Greek cart footer padding fix.
 *
 * Footer-only.
 * Does not touch quantity, delete, edit, images, product cards, or templates.
 *
 * Desktop value matches the working manual test:
 * padding: 12px 16px 60px;
 */

html body .mfp-wrap.cart-modal .cart-sum-wrap {
  box-sizing: border-box !important;

  position: relative !important;
  z-index: 12 !important;

  width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;

  margin: 0 !important;

  /* Desktop: confirmed working on your PC */
  padding: 12px 16px 60px !important;

  overflow: hidden !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;

  background: linear-gradient(180deg, rgba(255,255,255,.99), #fffaf0) !important;
  border-top: 1px solid rgba(216, 189, 123, .30) !important;
  box-shadow:
    0 -16px 34px rgba(13,22,36,.09),
    inset 0 1px 0 rgba(255,255,255,.72) !important;
}

/* Keep the native footer content compact so the 60px bottom breathing room does not hide buttons. */
html body .mfp-wrap.cart-modal .cart-sum-wrap .cg-cart-pro-footnote,
html body .mfp-wrap.cart-modal .cart-sum-wrap .cg-sidecart-footnote,
html body .mfp-wrap.cart-modal .cart-sum-wrap .cg-sidecart-stable-note,
html body .mfp-wrap.cart-modal .cart-sum-wrap .cg-cart-actionbar-proxy {
  display: none !important;
}

html body .mfp-wrap.cart-modal .cart-sum-wrap .subtotal {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;

  min-height: 24px !important;
  margin: 0 0 8px !important;
  padding: 0 !important;
}

html body .mfp-wrap.cart-modal .cart-sum-wrap .subtotal .label {
  margin: 0 !important;
  color: #6b7280 !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  letter-spacing: .07em !important;
  line-height: 1 !important;
  text-transform: uppercase !important;
}

html body .mfp-wrap.cart-modal .cart-sum-wrap .subtotal .price {
  color: #111827 !important;
  font-size: clamp(18px, 2vw, 22px) !important;
  font-weight: 950 !important;
  line-height: 1 !important;
}

/* Restore/keep the real native buttons visible. */
html body .mfp-wrap.cart-modal .cart-sum-wrap > .actions,
html body .mfp-wrap.cart-modal .cart-sum-wrap .actions {
  position: static !important;
  inset: auto !important;

  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 10px !important;

  width: 100% !important;
  min-height: 40px !important;

  margin: 0 !important;
  padding: 0 !important;

  overflow: visible !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;

  transform: none !important;
}

html body .mfp-wrap.cart-modal .cart-sum-wrap .actions > .secondary,
html body .mfp-wrap.cart-modal .cart-sum-wrap .actions > .primary {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

html body .mfp-wrap.cart-modal .cart-sum-wrap .actions > .secondary {
  order: 1 !important;
}

html body .mfp-wrap.cart-modal .cart-sum-wrap .actions > .primary {
  order: 2 !important;
}

html body .mfp-wrap.cart-modal .cart-sum-wrap .actions .action,
html body .mfp-wrap.cart-modal .cart-sum-wrap .actions #top-cart-btn-checkout {
  box-sizing: border-box !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 100% !important;
  min-width: 0 !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;

  margin: 0 !important;
  padding: 0 12px !important;

  border-radius: 999px !important;

  font-family: var(--cg-font, "Inter", "Helvetica Neue", Arial, sans-serif) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: .01em !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  text-align: center !important;
  text-decoration: none !important;

  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

html body .mfp-wrap.cart-modal .cart-sum-wrap .actions .action.viewcart {
  color: #111827 !important;
  background: #fff !important;
  border: 1px solid rgba(13,22,36,.14) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.78),
    0 4px 12px rgba(13,22,36,.05) !important;
}

html body .mfp-wrap.cart-modal .cart-sum-wrap .actions #top-cart-btn-checkout,
html body .mfp-wrap.cart-modal .cart-sum-wrap .actions .action.checkout {
  color: #fff !important;
  background: linear-gradient(135deg, #0d1624 0%, #121c2f 100%) !important;
  border: 1px solid transparent !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    0 8px 20px rgba(13,22,36,.18) !important;
}

html body .mfp-wrap.cart-modal .cart-sum-wrap .minicart-extra-actions:empty,
html body .mfp-wrap.cart-modal .cart-sum-wrap [data-bind*="extra_actions"]:empty {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/*
 * Mobile equivalent.
 * Adds enough bottom breathing room for mobile browser bars / safe area
 * while keeping both native buttons visible.
 */
@media (max-width: 767px) {
  html body .mfp-wrap.cart-modal .cart-sum-wrap {
    padding: 10px 12px calc(66px + env(safe-area-inset-bottom, 0px)) !important;
  }

  html body .mfp-wrap.cart-modal .cart-sum-wrap .subtotal {
    min-height: 22px !important;
    margin-bottom: 7px !important;
  }

  html body .mfp-wrap.cart-modal .cart-sum-wrap .subtotal .price {
    font-size: 18px !important;
  }

  html body .mfp-wrap.cart-modal .cart-sum-wrap .actions {
    gap: 8px !important;
  }

  html body .mfp-wrap.cart-modal .cart-sum-wrap .actions .action,
  html body .mfp-wrap.cart-modal .cart-sum-wrap .actions #top-cart-btn-checkout {
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    padding: 0 9px !important;
    font-size: 11.5px !important;
  }
}

/* Very narrow phones: keep both buttons visible side-by-side unless labels cannot fit. */
@media (max-width: 360px) {
  html body .mfp-wrap.cart-modal .cart-sum-wrap {
    padding: 9px 10px calc(62px + env(safe-area-inset-bottom, 0px)) !important;
  }

  html body .mfp-wrap.cart-modal .cart-sum-wrap .actions {
    gap: 7px !important;
  }

  html body .mfp-wrap.cart-modal .cart-sum-wrap .actions .action,
  html body .mfp-wrap.cart-modal .cart-sum-wrap .actions #top-cart-btn-checkout {
    font-size: 11px !important;
    padding: 0 7px !important;
  }
}

/* Short screens: keep the bottom breathing room, but compress controls slightly. */
@media (max-height: 720px) {
  html body .mfp-wrap.cart-modal .cart-sum-wrap {
    padding-top: 9px !important;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
  }

  html body .mfp-wrap.cart-modal .cart-sum-wrap .actions .action,
  html body .mfp-wrap.cart-modal .cart-sum-wrap .actions #top-cart-btn-checkout {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body .mfp-wrap.cart-modal .cart-sum-wrap *,
  html body .mfp-wrap.cart-modal .cart-sum-wrap *::before,
  html body .mfp-wrap.cart-modal .cart-sum-wrap *::after {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}
