/* =====================================================================
   WeCare Meds — inner page components
   assets/css/pages.css   (loaded after styles.css on product + cart)
   ---------------------------------------------------------------------
   1.  Page head / breadcrumb
   2.  Product gallery
   3.  Buy box (price, pack options, delivery)
   4.  Detail tabs + spec table
   5.  Rating breakdown + review list
   6.  Cart table
   7.  Order summary / coupon / shipping progress
   8.  Empty state
   9.  Responsive
   ===================================================================== */

/* ------------------------------------------ 1. Page head / crumbs -- */
.page-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line-soft);
  padding-block: 20px;
}
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: .92rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--blue-600); }
.breadcrumb li:not(:last-child)::after {
  content: '/'; margin-left: 8px; color: var(--muted-2);
}
.breadcrumb li { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 600; }

.page-title { margin-top: 14px; }
.page-title h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.page-title p { margin-top: 8px; color: var(--muted); }

/* ------------------------------------------- 2. Product gallery ---- */
.pdp {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: 48px;
  align-items: start;
}

.gallery { display: grid; gap: 14px; position: sticky; top: 190px; }
.gallery__stage {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  padding: 34px;
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
}
.gallery__stage svg { width: 82%; height: auto; }
.gallery__frame { display: none; }
.gallery__frame.is-active { display: grid; place-items: center; width: 100%; }
.gallery__badges { position: absolute; top: 18px; left: 18px; display: flex; flex-direction: column; gap: 8px; }

.gallery__zoom {
  position: absolute; right: 18px; bottom: 18px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: var(--r-full);
  background: rgba(255, 255, 255, .92); border: 1px solid var(--line);
  font-size: .88rem; font-weight: 600; color: var(--ink-soft);
  box-shadow: var(--shadow-xs);
}

.gallery__thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gallery__thumb {
  aspect-ratio: 1 / 1; padding: 12px;
  display: grid; place-items: center;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color .18s var(--ease), transform .18s var(--ease), background-color .18s var(--ease);
}
.gallery__thumb svg { width: 84%; height: auto; }
.gallery__thumb:hover { transform: translateY(-3px); border-color: var(--blue-300); }
.gallery__thumb.is-active { border-color: var(--blue-500); background: var(--blue-50); }

/* -------------------------------------------------- 3. Buy box ----- */
.buybox { display: flex; flex-direction: column; gap: 20px; }

.buybox__head { display: flex; flex-direction: column; gap: 10px; }
.buybox__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; }
.buybox__sold { font-size: .92rem; color: var(--muted); }
.buybox__sold b { font-family: var(--font-numeric); color: var(--ink); }

.buybox__price {
  display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px;
  padding: 20px 22px;
  background: var(--surface); border-radius: var(--r-lg);
  border: 1px solid var(--line);
}
.buybox__price .price { font-size: 2.3rem; }
.buybox__price-note { width: 100%; font-size: .92rem; color: var(--muted); }

.options { display: grid; gap: 10px; }
.options__label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: var(--ink);
}
.options__label span { font-size: .9rem; font-weight: 500; color: var(--muted); }
.options__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }

.option {
  position: relative;
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px 12px;
  text-align: left;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background-color .18s var(--ease);
}
.option:hover { border-color: var(--blue-300); }
.option.is-active {
  border-color: var(--blue-500); background: var(--blue-50);
  box-shadow: 0 0 0 3px rgba(143, 188, 251, .3);
}
.option b { font-family: var(--font-display); font-size: 1rem; color: var(--ink); }
.option small { font-family: var(--font-numeric); font-weight: 700; font-size: .9rem; color: var(--blue-600); }
.option em {
  position: absolute; top: -10px; right: 8px;
  font-style: normal; font-family: var(--font-display); font-size: .9rem; font-weight: 600;
  padding: 3px 9px; border-radius: var(--r-full);
  background: var(--mint-500); color: #fff;
}

.buybox__actions { display: grid; grid-template-columns: auto 1fr 1fr; gap: 12px; align-items: center; }
.buybox__actions .qty__btn { height: 52px; width: 42px; }
.buybox__actions .qty__input { width: 44px; font-size: 1.1rem; }

.delivery {
  display: grid; gap: 12px;
  padding: 18px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
}
.delivery__row { display: flex; align-items: flex-start; gap: 12px; font-size: .95rem; }
.delivery__row svg { flex: none; color: var(--blue-600); margin-top: 2px; }
.delivery__row b { font-family: var(--font-display); color: var(--ink); display: block; }
.delivery__row small { color: var(--muted); font-size: .9rem; }

.assure-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.assure-chip {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 15px 10px; text-align: center;
  background: var(--surface); border-radius: var(--r-md);
}
.assure-chip svg { color: var(--blue-600); }
.assure-chip b { font-family: var(--font-display); font-size: .88rem; color: var(--ink); font-weight: 600; }

.quality-note {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 15px 18px;
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--r-md);
  font-size: .92rem; color: #1e40af;
}
.quality-note svg { flex: none; margin-top: 2px; }
.quality-note b { font-family: var(--font-display); }

/* --------------------------------- 4. Detail tabs + spec table ----- */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 15px 20px;
  font-family: var(--font-display); font-size: 1rem; font-weight: 500;
  color: var(--muted); white-space: nowrap;
  border-bottom: 2.5px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.tab:hover { color: var(--blue-600); }
.tab.is-active { color: var(--ink); font-weight: 600; border-bottom-color: var(--blue-500); }

.tab-panel { display: none; padding-top: 30px; }
.tab-panel.is-active { display: block; animation: fadeUp .35s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.prose { max-width: 68ch; }
.prose h3 { margin: 26px 0 10px; }
.prose h3:first-child { margin-top: 0; }
.prose p { color: var(--ink-soft); }
.prose ul { display: grid; gap: 10px; margin: 14px 0; }
.prose ul li { display: flex; gap: 11px; align-items: flex-start; color: var(--ink-soft); }
.prose ul li::before {
  content: ''; flex: none; width: 7px; height: 7px; margin-top: 9px;
  border-radius: 50%; background: var(--blue-300);
}

.spec-table { width: 100%; border-collapse: collapse; font-size: .98rem; }
.spec-table th, .spec-table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.spec-table th {
  width: 42%; font-family: var(--font-display); font-weight: 600; color: var(--muted);
}
.spec-table td { color: var(--ink); font-weight: 500; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }

.faq { display: grid; gap: 12px; max-width: 68ch; }
.faq__item { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.faq__q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 18px; text-align: left;
  font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--ink);
}
.faq__q svg { flex: none; transition: transform .2s var(--ease); }
.faq__item.is-open .faq__q svg { transform: rotate(180deg); }
.faq__a { display: none; padding: 0 18px 18px; color: var(--muted); font-size: .95rem; }
.faq__item.is-open .faq__a { display: block; }

/* ------------------------------ 5. Rating breakdown + reviews ------ */
.review-summary {
  display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 34px; align-items: center;
  padding: 26px 30px;
  background: var(--surface); border-radius: var(--r-xl); border: 1px solid var(--line);
}
.review-summary__score { text-align: center; }
.review-summary__score .num { font-size: 3.4rem; line-height: 1; color: var(--ink); }
.review-summary__score p { font-size: .92rem; color: var(--muted); margin-top: 8px; }

.bars { display: grid; gap: 9px; }
.bar { display: grid; grid-template-columns: 52px minmax(0, 1fr) 46px; align-items: center; gap: 12px; }
.bar__label { font-family: var(--font-numeric); font-weight: 500; font-size: .9rem; color: var(--muted); }
.bar__track { height: 9px; border-radius: var(--r-full); background: var(--line); overflow: hidden; }
.bar__fill { height: 100%; border-radius: var(--r-full); background: var(--amber-400); }
.bar__value { font-family: var(--font-numeric); font-weight: 700; font-size: .9rem; color: var(--ink); text-align: right; }

.review-list { display: grid; gap: 18px; margin-top: 30px; }
.review-list .review-card { max-width: none; }

/* ------------------------------------------------ 6. Cart table ---- */
.cart-layout {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, .95fr); gap: 34px; align-items: start;
}

.cart-panel {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden;
}
.cart-panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 24px; border-bottom: 1px solid var(--line-soft);
}
.cart-panel__head h2 { font-size: 1.3rem; }
.cart-panel__count { font-size: .95rem; color: var(--muted); }
.cart-panel__count b { font-family: var(--font-numeric); color: var(--ink); }

.cart-item {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  gap: 20px; padding: 22px 24px;
  border-bottom: 1px solid var(--line-soft);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.cart-item:last-child { border-bottom: 0; }
.cart-item.is-removing { opacity: 0; transform: translateX(-24px); }

.cart-item__media {
  aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 12px;
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border-radius: var(--r-md);
}
.cart-item__info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cart-item__info h3 { font-size: 1.1rem; }
.cart-item__attrs { display: flex; flex-wrap: wrap; gap: 8px; }
.cart-item__attr {
  font-size: .88rem; color: var(--ink-soft);
  padding: 5px 11px; background: var(--surface); border-radius: var(--r-full);
}
.cart-item__attr b { font-family: var(--font-display); }
.cart-item__unit { font-size: .92rem; color: var(--muted); }
.cart-item__unit b { font-family: var(--font-numeric); color: var(--ink); }

.cart-item__end {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 14px;
}
.cart-item__total { font-family: var(--font-numeric); font-weight: 700; font-size: 1.35rem; color: var(--ink); }
.cart-item__tools { display: flex; align-items: center; gap: 14px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .92rem; font-weight: 600; color: var(--muted);
  transition: color .16s var(--ease);
}
.link-btn:hover { color: var(--rose-500); }

.cart-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 20px 24px; background: var(--surface);
}

/* --------------------- 7. Order summary / coupon / shipping bar ---- */
.summary { position: sticky; top: 190px; display: grid; gap: 18px; }
.summary__card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: 24px; box-shadow: var(--shadow-sm);
}
.summary__card h2 { font-size: 1.25rem; margin-bottom: 18px; }

.summary__row {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 14px;
  padding: 11px 0; font-size: .98rem; color: var(--muted);
}
.summary__row > * { min-width: 0; }
.summary__save span, .ship-bar__text { min-width: 0; }
.summary__row b, .summary__row span:last-child { font-family: var(--font-numeric); font-weight: 700; color: var(--ink); }
.summary__row--discount span:last-child { color: #067647; }
.summary__row--total {
  margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line);
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--ink);
}
.summary__row--total span:last-child { font-size: 1.7rem; }

.summary__save {
  display: flex; align-items: center; gap: 9px;
  margin-top: 12px; padding: 11px 14px;
  background: var(--mint-50); border-radius: var(--r-md);
  font-size: .92rem; font-weight: 600; color: #067647;
}

.coupon { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 18px; }
.coupon__input {
  flex: 1 1 150px; min-width: 0; padding: 13px 16px;
  border: 1.5px solid var(--line); border-radius: var(--r-full);
  background: var(--white); font-size: .95rem;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.coupon__input:focus {
  outline: none; border-color: var(--blue-300); box-shadow: 0 0 0 4px rgba(143, 188, 251, .3);
}
.coupon__note { font-size: .9rem; margin-top: -6px; }
.coupon__note--ok { color: #067647; font-weight: 600; }
.coupon__note--err { color: var(--rose-500); font-weight: 600; }

.ship-bar { display: grid; gap: 10px; padding: 16px 18px; background: var(--surface); border-radius: var(--r-lg); }
.ship-bar__text { font-size: .92rem; color: var(--ink-soft); }
.ship-bar__text b { font-family: var(--font-numeric); color: var(--blue-600); }
.ship-bar__track { height: 8px; border-radius: var(--r-full); background: var(--line); overflow: hidden; }
.ship-bar__fill {
  height: 100%; border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--blue-500), var(--mint-500));
  transition: width .4s var(--ease);
}

.summary__secure {
  display: grid; gap: 12px; padding: 18px 20px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
}
.summary__secure-row { display: flex; align-items: center; gap: 11px; font-size: .92rem; color: var(--muted); }
.summary__secure-row svg { flex: none; color: var(--blue-600); }
.summary__pay { display: flex; flex-wrap: wrap; gap: 7px; }
.summary__pay .pay-chip { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }

/* --------------------------------------------- 8. Empty state ------ */
.empty {
  display: none; text-align: center; padding: 64px 24px;
}
.empty.is-visible { display: block; }
.empty__icon {
  width: 88px; height: 88px; margin: 0 auto 22px;
  display: grid; place-items: center;
  background: var(--surface); border-radius: 50%; color: var(--blue-500);
}
.empty h2 { font-size: 1.5rem; }
.empty p { margin: 12px auto 24px; color: var(--muted); max-width: 42ch; }

/* ---------------------------------------------- 9. Responsive ------ */
@media (max-width: 1100px) {
  .pdp { grid-template-columns: 1fr; gap: 38px; }
  .gallery { position: static; }
  .gallery__stage { aspect-ratio: 4 / 3; }
  /* minmax(0,…) lets the column shrink below its content's min-content
     width; a bare 1fr keeps a floor and pushes the panel past the gutter */
  .cart-layout { grid-template-columns: minmax(0, 1fr); }
  .cart-layout > * { min-width: 0; }
  .summary { position: static; }
}

@media (max-width: 760px) {
  .options__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .assure-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .buybox__actions { grid-template-columns: 1fr; }
  .buybox__actions .qty { justify-self: start; }
  .review-summary { grid-template-columns: 1fr; gap: 22px; padding: 22px; }
  .spec-table th { width: 46%; }

  .cart-item { grid-template-columns: 76px minmax(0, 1fr); gap: 14px; padding: 18px 16px; }
  .cart-item__end {
    grid-column: 1 / -1; flex-direction: row; align-items: center;
    justify-content: space-between; padding-top: 4px;
  }
  .cart-panel__head { padding: 18px 16px; }
  .cart-foot { padding: 16px; }
  .gallery__thumbs { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .tab { padding: 14px 15px; }
}

@media (max-width: 420px) {
  .assure-row { grid-template-columns: 1fr; }
  .assure-chip { flex-direction: row; text-align: left; }
  .bar { grid-template-columns: 46px minmax(0, 1fr) 42px; gap: 9px; }
}

/* ---------------------------------- 10. Checkout & Payment Flow ---- */
.checkout-section {
  scroll-margin-top: 140px;
  margin-top: 40px;
}

.checkout-card {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-xl);
  padding: clamp(24px, 3.5vw, 42px);
  box-shadow: var(--shadow-sm);
}

.checkout-flow-banner {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1.5px solid #bfdbfe;
  border-radius: var(--r-lg);
  padding: 22px 24px;
  margin-bottom: 32px;
}

.checkout-flow-banner__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--blue-700);
  margin-bottom: 12px;
}

.checkout-flow-banner__desc {
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 18px;
}

.checkout-flow-banner__desc b {
  color: var(--ink);
}

.checkout-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.checkout-step-chip {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: var(--shadow-xs);
}

.checkout-step-num {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-600);
  color: var(--white);
  display: grid;
  place-items: center;
  font-family: var(--font-numeric);
  font-weight: 700;
  font-size: .88rem;
}

.checkout-step-text {
  font-size: .88rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.checkout-step-text b {
  display: block;
  font-family: var(--font-display);
  font-size: .95rem;
  color: var(--ink);
  margin-bottom: 2px;
}

.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.checkout-form {
  display: grid;
  gap: 20px;
}

.checkout-form h3 {
  font-size: 1.25rem;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-group {
  display: grid;
  gap: 7px;
}

.form-label {
  font-family: var(--font-display);
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-label .req {
  color: var(--rose-500);
  font-weight: 700;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--white);
  font-size: .95rem;
  color: var(--ink);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--blue-400);
  box-shadow: 0 0 0 4px rgba(22, 104, 227, .15);
}

.form-hint {
  font-size: .84rem;
  color: var(--muted);
  line-height: 1.4;
}

.form-hint--dest {
  color: var(--blue-700);
  font-weight: 500;
}

.checkout-side {
  display: grid;
  gap: 20px;
}

.checkout-items-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
}

.checkout-items-box h3 {
  font-size: 1.15rem;
  margin-bottom: 14px;
}

.checkout-items-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.checkout-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: .92rem;
}

.checkout-item-row:last-child {
  border-bottom: 0;
}

.checkout-item-name b {
  color: var(--ink);
  font-family: var(--font-display);
}

.checkout-item-price {
  font-family: var(--font-numeric);
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.checkout-totals {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: grid;
  gap: 8px;
  font-size: .93rem;
  color: var(--muted);
}

.checkout-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.checkout-total-row b {
  font-family: var(--font-numeric);
  color: var(--ink);
}

.checkout-total-row--final {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1.5px solid var(--line);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  font-family: var(--font-display);
}

.checkout-total-row--final b {
  font-size: 1.45rem;
  color: var(--blue-700);
}

.checkout-dest-card {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.checkout-dest-card svg {
  flex: none;
  color: #16a34a;
  margin-top: 2px;
}

.checkout-dest-card b {
  display: block;
  font-family: var(--font-display);
  color: #15803d;
  font-size: .95rem;
  margin-bottom: 4px;
}

.checkout-dest-card p {
  font-size: .88rem;
  color: #166534;
  line-height: 1.45;
}

.checkout-empty-note {
  font-size: .92rem;
  color: var(--muted);
  font-style: italic;
}

/* Order Confirmation Modal */
.order-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  place-items: center;
  padding: 20px;
}

.order-modal.is-open {
  display: grid;
}

.order-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .6);
  backdrop-filter: blur(4px);
}

.order-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 580px;
  background: var(--white);
  border-radius: var(--r-xl);
  padding: clamp(24px, 4vw, 36px);
  box-shadow: var(--shadow-xl);
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .3s var(--ease);
}

.order-modal__head {
  text-align: center;
  margin-bottom: 24px;
}

.order-modal__icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
}

.order-modal__head h2 {
  font-size: 1.55rem;
  margin-bottom: 6px;
}

.order-modal__ref {
  display: inline-block;
  padding: 6px 14px;
  background: var(--blue-50);
  border: 1px solid var(--blue-200);
  border-radius: var(--r-full);
  font-family: var(--font-numeric);
  font-weight: 700;
  color: var(--blue-700);
  font-size: .95rem;
}

.order-modal__flow-alert {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 20px;
  font-size: .92rem;
  color: var(--blue-900);
  line-height: 1.5;
}

.order-modal__flow-alert b {
  color: var(--blue-700);
}

.order-modal__summary {
  display: grid;
  gap: 10px;
  background: var(--surface);
  padding: 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  font-size: .9rem;
  margin-bottom: 24px;
}

.order-modal__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.order-modal__row span:first-child {
  color: var(--muted);
}

.order-modal__row span:last-child {
  color: var(--ink);
  font-weight: 600;
  text-align: right;
}

.order-modal__actions {
  display: grid;
  gap: 10px;
}

@media (max-width: 860px) {
  .checkout-steps { grid-template-columns: 1fr; }
  .checkout-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* Cart rows rendered from the shared cart */
.cart-item__media--photo { display: grid; place-items: center; }
.cart-item__media--photo img {
  width: 100%; height: 100%;
  object-fit: contain; border-radius: 10px;
  mix-blend-mode: multiply;
}

/* JSON-driven product photo frame */
.gallery__frame--photo {
  display: grid; place-items: center;
  background: var(--surface); border-radius: 14px; padding: 18px;
}
.gallery__frame--photo img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 10px;
  mix-blend-mode: multiply;
}


/* Generated product pages (products/*.html) */
.pdp-grid-modern {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 28px;
}
@media (max-width: 900px) {
  .pdp-grid-modern { grid-template-columns: 1fr; gap: 24px; }
}
.pdp-gallery-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 24px;
  text-align: center;
  position: relative;
}
.pdp-gallery-card img {
  max-width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  border-radius: var(--r-lg);
}
.pdp-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  justify-content: center;
}
.pdp-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  color: var(--ink-soft);
}
.pack-selection-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  margin: 20px 0;
}
.pack-radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.pack-radio-card {
  display: block;
  border: 2px solid var(--line);
  background: #fff;
  border-radius: var(--r-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.pack-radio-card input {
  position: absolute;
  top: 10px;
  right: 10px;
}
.pack-radio-card.is-selected {
  border-color: var(--blue-600);
  background: #eff6ff;
}
.pack-name {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}
.pack-price {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--blue-600);
  margin-top: 4px;
}
.clinical-box-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  margin-top: 32px;
}
.clinical-box-section h2, .clinical-box-section h3 {
  color: var(--ink);
  margin-bottom: 12px;
}
.clinical-warning-card {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 16px 20px;
  border-radius: var(--r-md);
  margin: 16px 0;
  font-size: 0.95rem;
  color: #92400e;
}
.clinical-warning-card b { color: #78350f; }
.citation-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.citation-item {
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--blue-500);
}
.citation-source { font-weight: 700; color: var(--ink); margin-right: 6px; }
.citation-link { color: var(--blue-600); text-decoration: underline; }
.citation-link:hover { color: var(--blue-800); }

@media (max-width: 760px) {
  .page-head { padding-block: 10px !important; }
  .page-title { margin-top: 4px !important; }
  .page-title h1 { font-size: 1.45rem !important; }
  .breadcrumb { font-size: 0.8rem !important; gap: 4px !important; }

  .pdp-grid-modern {
    margin-top: 10px !important;
    gap: 14px !important;
  }
  .pdp-gallery-card {
    padding: 10px !important;
    border-radius: var(--r-md) !important;
  }
  .pdp-gallery-card img {
    max-height: 200px !important;
  }
  .pdp-badges-row {
    margin-top: 8px !important;
    gap: 6px !important;
    justify-content: center !important;
  }
  .pdp-pill {
    font-size: 0.74rem !important;
    padding: 3px 9px !important;
  }
  .buybox__head { gap: 4px !important; }
  .buybox__head h1 {
    font-size: 1.35rem !important;
    line-height: 1.25 !important;
    margin: 4px 0 !important;
  }
  .buybox__head p {
    font-size: 0.92rem !important;
    margin: 0 0 6px !important;
  }
  .pack-selection-box {
    padding: 12px !important;
    margin: 12px 0 !important;
    border-radius: var(--r-md) !important;
  }
  .pack-radio-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
    margin-top: 8px !important;
  }
  .pack-radio-card {
    padding: 8px 6px !important;
    text-align: center;
  }
  .pack-radio-card input {
    position: static !important;
    display: inline-block;
    margin-bottom: 2px;
  }
  .pack-name {
    font-size: 0.78rem !important;
  }
  .pack-price {
    font-size: 0.95rem !important;
    margin-top: 2px !important;
  }
  .clinical-box-section {
    padding: 14px !important;
    margin-top: 16px !important;
    border-radius: var(--r-md) !important;
  }
  .clinical-box-section h2, .clinical-box-section h3 {
    font-size: 1.15rem !important;
    margin-bottom: 8px !important;
  }
  .clinical-warning-card {
    padding: 10px 12px !important;
    margin: 10px 0 !important;
    font-size: 0.85rem !important;
  }
  .citation-item {
    font-size: 0.82rem !important;
    padding: 6px 10px !important;
  }
}

@media (max-width: 480px) {
  .pack-radio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
