/**
 * AG Store redesign theme for /cart?theme=ag
 * Brand ink + cyan accents; fluid / mobile-first layout.
 */
@import url("https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700&display=swap");

html[data-theme="ag"],
html[data-theme="ag"] body {
  font-family: "Golos Text", system-ui, -apple-system, sans-serif !important;
  color: #313131;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

html[data-theme="ag"] .font-sans,
html[data-theme="ag"] .font-mono {
  font-family: "Golos Text", system-ui, -apple-system, sans-serif !important;
}

html[data-theme="ag"] ::selection {
  background: rgba(138, 230, 254, 0.45);
  color: #313131;
}

/* Fluid shell (was Tilda 1200) */
html[data-theme="ag"] .max-w-\[1200px\] {
  max-width: min(1600px, 100%) !important;
  width: 100%;
}

html[data-theme="ag"] .max-w-\[560px\] {
  max-width: min(560px, 100%) !important;
}

/* Primary CTA → brand ink (buttons / solid fills only) */
html[data-theme="ag"] button[class*="bg-[#2f80ed]"],
html[data-theme="ag"] a[class*="bg-[#2f80ed]"],
html[data-theme="ag"] button[class*="2f80ed"][class*="bg-"],
html[data-theme="ag"] span[class*="bg-[#2f80ed]"],
html[data-theme="ag"] div[class*="bg-[#2f80ed]"].h-0\.5,
html[data-theme="ag"] div[class*="bg-[#2f80ed]"] {
  background-color: #313131 !important;
}
html[data-theme="ag"] button[class*="bg-[#2f80ed]"]:hover,
html[data-theme="ag"] a[class*="bg-[#2f80ed]"]:hover,
html[data-theme="ag"] [class*="hover:bg-blue-600"]:hover,
html[data-theme="ag"] [class*="hover:bg-blue-700"]:hover {
  background-color: #1f1f1f !important;
}

/* Product titles stay ink - never force blue on hover:text-[#2f80ed] class strings */
html[data-theme="ag"] a[class*="text-[#0b1220]"],
html[data-theme="ag"] h3[class*="text-[#0b1220]"],
html[data-theme="ag"] p[class*="text-[#0b1220]"],
html[data-theme="ag"] span[class*="text-[#0b1220]"],
html[data-theme="ag"] [class*="text-[#0b1220]"] {
  color: #313131 !important;
}
html[data-theme="ag"] a[class*="text-[#0b1220]"]:hover {
  color: #151515 !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Soft info / upsell panels - neutral, not loud blue (bonus blocks excluded below) */
html[data-theme="ag"] .bg-blue-50:not([data-ag-cart-bonus]),
html[data-theme="ag"] [class*="bg-blue-50"]:not([data-ag-cart-bonus]):not([class*="bg-blue-50/50"]) {
  background-color: #f7f7f8 !important;
}
html[data-theme="ag"] .border-blue-100:not([data-ag-cart-bonus]),
html[data-theme="ag"] .border-blue-200:not([data-ag-cart-bonus]),
html[data-theme="ag"] [class*="border-blue-100"]:not([data-ag-cart-bonus]),
html[data-theme="ag"] [class*="border-blue-200"]:not([data-ag-cart-bonus]),
html[data-theme="ag"] [class*="border-[#2f80ed]"] {
  border-color: #e8e8ea !important;
}
html[data-theme="ag"] .text-blue-600,
html[data-theme="ag"] .text-blue-700,
html[data-theme="ag"] .text-blue-800,
html[data-theme="ag"] [class*="text-blue-600"],
html[data-theme="ag"] [class*="text-blue-700"],
html[data-theme="ag"] [class*="text-blue-800"] {
  color: #313131 !important;
}

/* Bonus program - same cyan card as PDP .agp-bonus */
html[data-theme="ag"] .ag-cart-bonus,
html[data-theme="ag"] [data-ag-cart-bonus].ag-cart-bonus {
  border-radius: 14px !important;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background: linear-gradient(172deg, rgba(138, 230, 254, 0.1) 0%, rgba(138, 230, 254, 0.22) 100%) !important;
  overflow: hidden !important;
  padding: 0 !important;
}
html[data-theme="ag"] .ag-cart-bonus-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: transparent;
}
html[data-theme="ag"] .ag-cart-bonus-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #313131;
  border-radius: 999px;
  background: linear-gradient(145deg, #dff6fd, #c5eefc) !important;
  border: 1px solid rgba(138, 230, 254, 0.65) !important;
}
html[data-theme="ag"] .ag-cart-bonus-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
html[data-theme="ag"] .ag-cart-bonus-title {
  font-size: 14px;
  font-weight: 700;
  color: #313131 !important;
  line-height: 1.25;
}
html[data-theme="ag"] .ag-cart-bonus-subtitle {
  font-size: 12px;
  font-weight: 500;
  color: #5c5c5c !important;
  line-height: 1.35;
}
html[data-theme="ag"] .ag-cart-bonus-earn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2px;
  padding: 8px 14px;
  border-radius: 10px;
  flex-shrink: 0;
  min-width: 88px;
  max-width: 100%;
  background: linear-gradient(145deg, #dff6fd, #c5eefc) !important;
  border: 1px solid rgba(138, 230, 254, 0.65) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}
html[data-theme="ag"] .ag-cart-bonus-earn-label {
  font-size: 10px;
  font-weight: 700;
  color: #313131 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
html[data-theme="ag"] .ag-cart-bonus-earn-val {
  font-size: 20px;
  font-weight: 800;
  color: #313131 !important;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
html[data-theme="ag"] .ag-cart-bonus-earn-unit {
  font-size: 10px;
  font-weight: 700;
  color: #313131 !important;
  line-height: 1.15;
}
html[data-theme="ag"] .ag-cart-bonus-x2 {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 6px;
  background: #ff9500;
  color: #fff !important;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
html[data-theme="ag"] .ag-cart-bonus-body {
  padding: 0 16px 14px;
}
html[data-theme="ag"] .ag-cart-bonus-body .bg-white,
html[data-theme="ag"] .ag-cart-bonus-body [class*="bg-white"] {
  background-color: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(138, 230, 254, 0.35) !important;
}
html[data-theme="ag"] .ag-cart-bonus-link,
html[data-theme="ag"] .ag-cart-bonus-link:link,
html[data-theme="ag"] .ag-cart-bonus-link:visited {
  display: inline-block;
  margin: 0 16px 14px;
  padding: 0;
  font-size: 13px;
  font-weight: 500;
  color: #313131 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(49, 49, 49, 0.35);
  border: 0;
  background: transparent;
  transition: text-decoration-color 0.12s;
}
html[data-theme="ag"] .ag-cart-bonus-link:hover {
  text-decoration-color: #313131;
  background: transparent;
}
@media (max-width: 520px) {
  html[data-theme="ag"] .ag-cart-bonus-header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
  }
  html[data-theme="ag"] .ag-cart-bonus-col {
    flex: 1 1 calc(100% - 44px);
    min-width: 0;
  }
  html[data-theme="ag"] .ag-cart-bonus-earn {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-content: center;
    align-items: center;
    gap: 6px 10px;
    padding: 8px 12px;
    border-radius: 12px;
  }
  html[data-theme="ag"] .ag-cart-bonus-earn-val {
    font-size: 17px;
  }
}

/* Card stack rhythm */
html[data-theme="ag"] .ag-cart-root .space-y-2 > :not([hidden]) ~ :not([hidden]) {
  margin-top: 0.625rem;
}
html[data-theme="ag"] .ag-cart-root .space-y-5 > :not([hidden]) ~ :not([hidden]) {
  margin-top: 1.25rem;
}

/* Sidebar lines: thumb / title (flex) / compact price - VAT notes live under title */
html[data-theme="ag"] .ag-cart-summary-line {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) max-content;
  align-items: start;
  column-gap: 12px;
}
html[data-theme="ag"] .ag-cart-summary-price {
  min-width: 4.5rem;
  max-width: 6.25rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Sticky summary - crisp under parent header; sync mode uses transform */
html[data-theme="ag"] .ag-cart-sidebar {
  position: sticky;
  top: 1.75rem;
}
html[data-theme="ag"] .ag-cart-sidebar--sync {
  position: relative;
  top: auto;
}
html[data-theme="ag"] .ag-cart-summary-card {
  border-radius: 20px;
}
html[data-theme="ag"] .ag-cart-layout {
  align-items: start;
}

/* Selected radios / chips */
html[data-theme="ag"] [class*="border-[#2f80ed]"] {
  border-color: #313131 !important;
}
html[data-theme="ag"] [class*="ring-[#2f80ed]"] {
  --tw-ring-color: rgba(49, 49, 49, 0.2) !important;
}

/* Soft panels */
html[data-theme="ag"] [class*="bg-gray-50"],
html[data-theme="ag"] [class*="bg-gray-100"] {
  background-color: #fafafa !important;
}

/* Rounded CTAs - keep pill shape for primary actions only.
   Warranty / gift choice tiles use smaller radii and must not become ovals. */
html[data-theme="ag"] button.rounded-xl:not(.ag-cart-gift-tile):not(.ag-cart-addon-option),
html[data-theme="ag"] a.rounded-xl {
  border-radius: 100px !important;
}
html[data-theme="ag"] .ag-cart-gift-tile {
  border-radius: 6px !important;
}
html[data-theme="ag"] .ag-cart-addon,
html[data-theme="ag"] .ag-cart-addon-option {
  border-radius: 8px !important;
}

/* Inputs focus */
html[data-theme="ag"] input:focus,
html[data-theme="ag"] textarea:focus,
html[data-theme="ag"] select:focus {
  outline-color: #8ae6fe;
  border-color: #8ae6fe !important;
  box-shadow: 0 0 0 3px rgba(138, 230, 254, 0.35);
}

/* ── Adaptive layout ── */
html[data-theme="ag"] .ag-cart-root {
  box-sizing: border-box;
  width: 100%;
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
}

/* Stepper: tighter on small screens */
@media (max-width: 640px) {
  html[data-theme="ag"] .ag-cart-stepper button {
    flex-direction: column;
    gap: 4px !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }
  html[data-theme="ag"] .ag-cart-stepper button > span:last-child {
    font-size: 10px !important;
    line-height: 1.2 !important;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 2px;
  }

  /* Desktop cart nav only (≥860px). Mobile uses .ag-cart-sticky-nav. */

  /* Item cards: stack image + body comfortably */
  html[data-theme="ag"] .ag-cart-item {
    flex-wrap: nowrap;
    gap: 12px !important;
    padding: 12px !important;
  }
  html[data-theme="ag"] .ag-cart-item img {
    max-width: 64px;
    max-height: 64px;
  }

  /* Summary sidebar already hidden under md - mobile summary card */
  html[data-theme="ag"] .ag-cart-mobile-summary {
    border-radius: 16px !important;
  }
}

@media (max-width: 380px) {
  html[data-theme="ag"] .ag-cart-stepper button > span:last-child {
    display: none !important;
  }
}

/* Sidebar summary lines: even qty + price */
html[data-theme="ag"] .ag-cart-summary-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
html[data-theme="ag"] .ag-cart-summary-meta .ag-cart-qty {
  font-variant-numeric: tabular-nums;
  color: #848484;
  font-size: 12px;
  line-height: 1.2;
}
html[data-theme="ag"] .ag-cart-summary-card .border-t {
  border-color: #f0f0f2 !important;
}

/* Hide warehouse reserve chrome while redesign skips stock reserve */
html[data-theme="ag"][data-no-reserve="1"] .ag-cart-reserve-ui {
  display: none !important;
}

/* Empty cart - brand card + ink pill CTA */
html[data-theme="ag"] .max-w-\[560px\] > .rounded-2xl {
  border-radius: 22px !important;
  border-color: #f1f1f1 !important;
  box-shadow: 0 12px 40px rgba(49, 49, 49, 0.06);
}
html[data-theme="ag"] .max-w-\[560px\] h1 {
  font-family: "Golos Text", system-ui, sans-serif !important;
  color: #313131 !important;
  letter-spacing: -0.02em;
}
html[data-theme="ag"] .max-w-\[560px\] button[class*="bg-[#2f80ed]"],
html[data-theme="ag"] .max-w-\[560px\] button.rounded-xl {
  border-radius: 100px !important;
  background-color: #313131 !important;
  min-height: 46px;
  padding-left: 22px !important;
  padding-right: 22px !important;
  font-weight: 600 !important;
}
html[data-theme="ag"] .max-w-\[560px\] button[class*="bg-[#2f80ed]"]:hover,
html[data-theme="ag"] .max-w-\[560px\] button.rounded-xl:hover {
  background-color: #151515 !important;
}
html[data-theme="ag"] .max-w-\[560px\] .text-gray-300 {
  color: #c4c4c4 !important;
}
html[data-theme="ag"] .max-w-\[560px\] .text-gray-400 {
  color: #848484 !important;
}

/* Lift AG assistant FAB above the sticky checkout bar on mobile. */
@media (max-width: 859px) {
  html.ag-cart-sticky-nav-on #ag-asst-fab,
  html.ag-cart-sticky-nav-on .ag-asst-fab {
    bottom: calc(7.75rem + env(safe-area-inset-bottom, 0px) + 10px) !important;
  }
  html.ag-cart-sticky-nav-on #ag-asst-nudge,
  html.ag-cart-sticky-nav-on .ag-asst-nudge {
    bottom: calc(7.75rem + env(safe-area-inset-bottom, 0px) + 68px) !important;
  }
}
