/* m-pdp.css — DKY-style mobile layout, Impulse brand. Loaded after impulse-design-system.css.
   Product detail page + cart. Phone rules live under max-width: 768px; the few
   unscoped rules are structural and also hold on desktop. */

:root {
  --mBagIcon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z'/%3E%3Cline x1='3' y1='6' x2='21' y2='6'/%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'/%3E%3C/svg%3E");
  --mChevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 6 15 12 9 18'/%3E%3C/svg%3E");
  --mPlus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E");
  --mMinus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E");
}

/* ============================== PDP (all widths) ============================== */

/* Rounded navy CTA with a bag icon; Buy now is the outlined twin under it.
   The icon is a mask so pdp-purchase.js can swap the label text safely. */
.pdp__atc,
.pdp-sticky__actions .btn--primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  border-radius: 12px; background: var(--brandNavy); color: #fff;
}
.pdp__atc::before,
.pdp-sticky__actions .btn--primary::before {
  content: ""; width: 20px; height: 20px; flex: 0 0 auto; background: currentColor;
  -webkit-mask: var(--mBagIcon) center / contain no-repeat; mask: var(--mBagIcon) center / contain no-repeat;
}
.pdp__buy-row .pdp__atc { width: 100%; min-height: 52px; font-weight: 700; }
.pdp-page .pdp__buy-now { border-radius: 12px; min-height: 52px; font-weight: 700; border: 1.5px solid var(--brandNavy); color: var(--brandNavy); }
.pdp__buy-row { margin-top: 1rem; }

/* Size header: "Size" left, "Size chart" right; rounded chips. */
.pdp-page .pdp__size-head label { margin: 0; font-weight: 600; }
.pdp-page .pdp__size-chart { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; color: var(--brandInk); text-decoration: none; }
.pdp-page .pdp__size-pill { display: inline-flex; align-items: center; justify-content: center; margin: 0; min-width: 52px; min-height: 48px; border-radius: 10px; border-color: var(--brandLine); border-width: 1.5px; color: var(--brandInk); }
.pdp-page .pdp__size-pill:hover { border-color: var(--brandInk); }
.pdp-page .pdp__size-pill.is-active { background: var(--brandNavy); border-color: var(--brandNavy); color: #fff; }

/* Compact quantity row. */
.pdp-page .pdp__qty { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0.9rem 0 0; }
.pdp-page .pdp__qty label { margin: 0; font-weight: 600; font-size: 0.9375rem; }
.pdp-page .pdp__stepper { border: 1px solid var(--brandLine); border-radius: 10px; overflow: hidden; }

/* Pincode check sits under the promises. */
.pdp-page .pdp__pincode { margin: 1.1rem 0 0; }
.pdp__pincode-label { margin: 0 0 0.45rem; font-weight: 600; font-size: 0.9375rem; color: var(--brandInk); }
.pdp-page .pdp__pincode-row input { border-radius: 10px; font-size: 16px; }
.pdp-page .pdp__pincode-row .btn { border-radius: 10px; background: #fff; color: var(--brandNavy); border: 1.5px solid var(--brandNavy); min-height: 44px; padding: 0 1.1rem; }

/* Accordions: hairline rows with +/−. */
.pdp-details { margin-top: 1.25rem; border-top: 1px solid var(--brandLine); }
.pdp-page .pdp-accordion { border-bottom: 1px solid var(--brandLine); padding: 0; }
.pdp-page .pdp-accordion summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between;
  min-height: 52px; font-size: 0.9375rem; font-weight: 500; color: var(--brandInk);
}
.pdp-page .pdp-accordion summary::-webkit-details-marker { display: none; }
.pdp-page .pdp-accordion summary::after {
  content: ""; width: 18px; height: 18px; flex: 0 0 auto; background: currentColor;
  -webkit-mask: var(--mPlus) center / contain no-repeat; mask: var(--mPlus) center / contain no-repeat;
}
.pdp-page .pdp-accordion[open] summary::after { -webkit-mask-image: var(--mMinus); mask-image: var(--mMinus); }
.pdp-accordion__body { padding: 0 0 1rem; font-size: 0.9375rem; line-height: 1.55; color: var(--brandInk); }
.pdp-accordion__body p { margin: 0 0 0.6rem; }
.pdp-accordion__body .pdp__description { margin-top: 0; }
.pdp-accordion__body .pdp__fit-note { color: var(--brandMuted); }

.pdp-related__head, .cart-recommend__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.pdp-related__all, .cart-recommend__all {
  display: inline-flex; align-items: center; min-height: 44px; color: var(--brandInk);
  font-size: 0.9375rem; text-decoration: underline; text-underline-offset: 3px;
}

/* ============================== PDP (phones) ============================== */
@media (max-width: 768px) {
  /* Photo first: no gap between the header and the gallery. */
  body.product-page .main-content { padding-top: 0; }
  .pdp-page .pdp-crumb { display: none; }

  .pdp-page .pdp {
    grid-template-areas: "gallery" "heading" "info";
    gap: 0;
  }

  /* Full-bleed gallery: break out of the page gutter. */
  .pdp-page .pdp__gallery {
    --stageH: min(141.4vw, 64vh);
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }
  .pdp-page .pdp__stage-track { padding-right: 0; background: var(--productMat); }
  .pdp-page .pdp__stage { flex-basis: 100%; margin-right: 0; }
  .pdp-page .pdp__stage img { width: 100%; height: var(--stageH); max-height: none; object-fit: contain; background: var(--productMat); }
  .pdp-page .pdp__stage--placeholder { height: var(--stageH); aspect-ratio: auto; }
  .pdp-page .pdp__discount-badge { display: none; }
  .pdp-page .pdp__ribbon { top: 0.75rem; left: 0.75rem; font-size: 0.75rem; }

  /* Dots and rating chip ride on the bottom edge of the photo. */
  .pdp-page .pdp__dots {
    position: absolute; z-index: 3; left: 50%; transform: translateX(-50%);
    top: calc(var(--stageH) - 40px); margin: 0; gap: 0; padding: 0 0.25rem;
    border-radius: 999px; background: rgb(255 255 255 / 70%);
  }
  .pdp-page .pdp__dot {
    position: relative; width: 22px; height: 28px; background: transparent; border-radius: 0;
  }
  .pdp-page .pdp__dot::before {
    content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; transform: translate(-50%, -50%);
    border-radius: 999px; background: rgb(26 26 46 / 28%); transition: width 0.2s ease, background 0.2s ease;
  }
  .pdp-page .pdp__dot.is-active { width: 30px; background: transparent; }
  .pdp-page .pdp__dot.is-active::before { width: 18px; background: var(--brandNavy); }
  .pdp-page .pdp__rating-chip { top: calc(var(--stageH) - 44px); bottom: auto; right: 0.75rem; min-height: 32px; font-size: 0.875rem; }

  /* Thumbnail strip under the photo. */
  .pdp-page .pdp__gallery .pdp__thumbs {
    display: flex; flex-wrap: nowrap; gap: 0.5rem; overflow-x: auto; margin: 0.6rem 0 0;
    padding: 0 0.75rem; scroll-padding: 0 0.75rem;
  }
  .pdp-page .pdp__thumb {
    flex: 0 0 52px; width: 52px; height: 70px; border: 1.5px solid transparent; border-radius: 8px;
    background: var(--productMat);
  }
  .pdp-page .pdp__thumb.is-active { border-color: var(--brandNavy); }

  /* Title, price, tax line. */
  .pdp-page .pdp__heading { padding-top: 0.9rem; }
  .pdp-page .pdp__heading-row { display: block; }
  .pdp-page .pdp__collection { font-size: 0.8125rem; letter-spacing: 0.04em; margin: 0 0 0.25rem; color: var(--brandMuted); }
  .pdp-page .pdp__title { font-size: 1.1875rem; line-height: 1.3; font-weight: 600; margin: 0; color: var(--brandInk); }
  .pdp-page .pdp__rating-link { display: none; }
  .pdp-page .pdp__price { margin: 0.45rem 0 0.15rem; gap: 0.5rem; align-items: center; }
  .pdp-page .pdp__current-price { font-size: 1.375rem; font-weight: 800; }
  .pdp-page .pdp__compare-price { font-size: 0.9375rem; color: var(--brandMuted); }
  .pdp-page .pdp__save-chip { font-size: 0.8125rem; padding: 0.2rem 0.5rem; border-radius: 6px; background: var(--brandOrange); }
  .pdp-page .pdp__tax-note { font-size: 0.8125rem; color: var(--brandMuted); margin: 0 0 0.35rem; }
  .pdp-page .pdp__social-proof { font-size: 0.8125rem; margin: 0.15rem 0 0; }

  /* Size block. */
  .pdp-page .pdp__size { margin: 1rem 0 0; }
  .pdp-page .pdp__size-head label, .pdp-page .pdp__size-chart { font-size: 0.9375rem; }
  .pdp-page .pdp__size-pills { gap: 0.5rem; margin-top: 0.25rem; }
  .pdp-page .pdp .pdp__size-pill { min-width: 56px; min-height: 52px; font-size: 0.9375rem; }

  .pdp-page .pdp__stepper-btn { width: 44px; min-height: 44px; }
  .pdp-page .pdp__stepper input { min-height: 44px; width: 44px; font-size: 16px; }

  .pdp-page .pdp__buy-now { margin-top: 0.6rem; }
  .pdp-page .pdp__delivery-note { font-size: 0.8125rem; color: var(--brandMuted); text-align: center; margin-top: 0.7rem; }

  /* Promise box right under the buttons. */
  .pdp-page .pdp__promises { margin-top: 0.9rem; padding: 0.9rem 0.4rem; border-radius: 12px; background: #fff; }
  .pdp-page .pdp__promises li { font-size: 0.8125rem; color: var(--brandInk); }
  .pdp-page .pdp__promises svg { color: var(--brandNavy); }

  .pdp-page .pdp__assurances { margin-top: 1rem; border-radius: 12px; border: 1px solid var(--brandLine); }
  .pdp-page .pdp__secondary { margin-top: 0.75rem; }
  .pdp-page .pdp__secondary .btn { min-height: 44px; font-size: 0.875rem; border-radius: 10px; }

  .pdp-page .pdp-section h2, .pdp-page .pdp-reviews h2 { font-size: 1.375rem; font-weight: 500; }

  /* Sticky bar: one row — thumb · name/size · price · bag button. */
  .pdp-sticky .pdp-sticky__inner { gap: 0 0.65rem; }
  .pdp-sticky .pdp-sticky__thumb { width: 40px; height: 52px; border-radius: 6px; }
  .pdp-sticky .pdp-sticky__actions .btn--primary { min-height: 48px; padding: 0 1rem; border-radius: 12px; font-size: 0.9375rem; }
  .pdp-sticky .pdp-sticky__size { font-size: 0.875rem; }
}

@media (max-width: 360px) {
  .pdp-sticky .pdp-sticky__actions .btn--primary { padding: 0 0.75rem; font-size: 0.875rem; }
  .pdp-sticky .pdp-sticky__actions .btn--primary::before { display: none; }
}

/* ============================== Cart (all widths) ============================== */
.cart-page .cart-title { display: flex; align-items: center; gap: 0.6rem; font-weight: 500; }
.cart-page .cart-title__count {
  display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 0.45rem;
  border-radius: 999px; background: var(--brandSurface); border: 1px solid var(--brandLine);
  color: var(--brandInk); font-size: 0.9375rem; font-weight: 600;
}

.cart-page .cart-line { grid-template-columns: 96px minmax(0, 1fr); gap: 1rem; align-items: start; border-bottom-color: var(--brandLine); }
.cart-page .cart-line__thumb { border-radius: 8px; overflow: hidden; background: var(--productMat); }
.cart-line__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.cart-page .cart-line__name { display: block; padding: 0.6rem 0; margin: -0.6rem 0; font-size: 1rem; font-weight: 500; line-height: 1.35; color: var(--brandInk); }
.cart-page .cart-line__total { margin: 0; font-weight: 600; white-space: nowrap; color: var(--brandInk); }
.cart-page .cart-line__meta { margin: 0.2rem 0 0; font-size: 0.875rem; color: var(--brandMuted); }
.cart-line__price { margin: 0.2rem 0 0; font-size: 0.9375rem; color: var(--brandInk); }
.cart-line__price s { margin-left: 0.3rem; color: var(--brandMuted); font-size: 0.875rem; }
.cart-line__actions { display: flex; align-items: center; gap: 1rem; margin-top: 0.75rem; }
.cart-page .cart-line__qty {
  display: inline-flex; align-items: center; gap: 0; border: 1.5px solid var(--brandInk); border-radius: 10px; overflow: hidden;
}
.cart-page .cart-line__step {
  display: grid; place-items: center; width: 44px; height: 44px; min-width: 44px; border: 0; background: #fff;
  color: var(--brandInk); font-size: 1.25rem; cursor: pointer;
}
.cart-page .cart-line__step:disabled { color: #b9b9c8; cursor: default; }
.cart-page .cart-line__count { min-width: 36px; text-align: center; font-size: 1rem; font-weight: 600; }
.cart-page .cart-remove {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px;
  color: var(--brandInk); border-radius: 10px;
}
.cart-page .cart-remove:hover { background: var(--brandSurface); }

.cart-discount { border-top: 1px solid var(--brandLine); border-bottom: 1px solid var(--brandLine); margin: 0.75rem 0 0; }
.cart-discount summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 52px;
  cursor: pointer; font-size: 0.9375rem; color: var(--brandInk);
}
.cart-discount summary::-webkit-details-marker { display: none; }
.cart-discount summary::after {
  content: ""; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: var(--mPlus) center / contain no-repeat; mask: var(--mPlus) center / contain no-repeat;
}
.cart-discount[open] summary::after { -webkit-mask-image: var(--mMinus); mask-image: var(--mMinus); }
.cart-discount .cart-summary__code { margin: 0 0 0.9rem; font-size: 0.875rem; }
.cart-page .cart-summary__total { border-top: 0; margin: 0.9rem 0 0.25rem; padding-top: 0; font-size: 1.0625rem; }
.cart-page .cart-summary__total strong { font-size: 1.375rem; }
.cart-summary__taxes { margin: 0 0 0.6rem; font-size: 0.875rem; color: var(--brandMuted); }
.cart-page .cart-checkout {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 54px; border-radius: 12px; background: var(--brandNavy); font-weight: 700; font-size: 1.0625rem;
}
.cart-page .cart-checkout::after,
.cart-page .cart-sticky__inner .btn::after {
  content: ""; width: 18px; height: 18px; flex: 0 0 auto; background: currentColor;
  -webkit-mask: var(--mChevron) center / contain no-repeat; mask: var(--mChevron) center / contain no-repeat;
}
.cart-page .cart-checkout-alt { margin-top: 0.5rem; border-radius: 12px; }
.cart-summary__pay { display: flex; justify-content: center; gap: 0.4rem; margin: 0.6rem 0 0; }
.cart-summary__pay span {
  padding: 0.15rem 0.5rem; border: 1px solid var(--brandLine); border-radius: 6px;
  font-size: 0.8125rem; color: var(--brandMuted);
}
.cart-page .cart-summary__trust { font-size: 0.875rem; }
.cart-page .cart-summary { border-color: var(--brandLine); border-radius: 12px; }

/* ============================== Cart (phones) ============================== */
@media (max-width: 768px) {
  .cart-page .cart-title { font-size: 1.75rem; margin: 0.25rem 0 1rem; }
  .cart-page .ship-meter { margin-bottom: 0.5rem; padding: 0.75rem; border-radius: 10px; background: var(--brandSurface); }
  .cart-page .ship-meter__text { font-size: 0.875rem; }
  .cart-page .ship-meter__fill { background: var(--brandOrange); }
  .cart-page .cart-layout { gap: 0.5rem; }
  .cart-page .cart-line { grid-template-columns: 76px minmax(0, 1fr); gap: 0.9rem; padding: 1.1rem 0; }
  .cart-page .cart-continue { font-size: 0.9375rem; }

  /* Summary drops its box on phones and reads as a plain list, like the reference. */
  .cart-page .cart-summary { position: static; border: 0; padding: 0; border-radius: 0; }
  .cart-page .cart-summary h2 { display: none; }
  .cart-page .cart-summary__rows div { font-size: 0.9375rem; padding: 0.35rem 0; }
  .cart-page .cart-guest-note { font-size: 0.8125rem; color: var(--brandMuted); }

  .cart-page .cart-recommend h2 { font-size: 1.5rem; font-weight: 500; margin: 0; }

  .cart-page .cart-sticky__inner .btn { display: inline-flex; align-items: center; gap: 0.35rem; border-radius: 12px; background: var(--brandNavy); padding: 0 1.4rem; min-height: 48px; font-size: 1rem; font-weight: 700; }
  .cart-page .cart-sticky__inner strong { font-size: 1.25rem; }
}
