/* Public medicine detail and crawlable catalog layouts. */
:root {
  --medicine-blue: #0756a7;
  --medicine-ink: #17243a;
  --medicine-muted: #657789;
  --medicine-border: #d8e6ef;
  --medicine-soft: #f5faff;
  --medicine-green: #157a56;
  --medicine-red: #a32b3e;
}

.medicine-page,
.medicine-catalog-page {
  background: linear-gradient(180deg, #f7fbfe 0, #fff 360px);
  color: var(--medicine-ink);
  min-height: 60vh;
  padding: 34px 0 64px;
}

.medicine-breadcrumbs {
  align-items: center;
  color: var(--medicine-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 7px;
  margin: 0 0 20px;
}

.medicine-breadcrumbs a { color: var(--medicine-blue); font-weight: 700; }

/* Search stays compact above product content and opens a bounded result panel. */
.medicine-quick-search {
  background: #fff;
  border: 1px solid var(--medicine-border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(28, 66, 94, .07);
  margin-bottom: 24px;
  padding: 18px;
  position: relative;
  z-index: 20;
}
.medicine-quick-search__heading { align-items: end; display: flex; gap: 20px; justify-content: space-between; margin-bottom: 12px; }
.medicine-quick-search__heading span { color: #178a73; display: block; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.medicine-quick-search__heading h2 { color: var(--medicine-ink); font-size: 21px; font-weight: 900; margin: 2px 0 0; }
.medicine-quick-search__heading p { color: var(--medicine-muted); font-size: 12px; margin: 0; }
.medicine-quick-search__form { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.medicine-quick-search__form input {
  background: #fff;
  border: 2px solid #bdd7e8;
  border-radius: 11px 0 0 11px;
  color: var(--medicine-ink);
  font-size: 16px;
  font-weight: 700;
  height: 52px;
  min-width: 0;
  outline: none;
  padding: 0 16px;
}
.medicine-quick-search__form input:focus { border-color: #258bd0; box-shadow: 0 0 0 3px rgba(37, 139, 208, .12); }
.medicine-quick-search__form button { align-items: center; background: var(--medicine-blue); border: 0; border-radius: 0 11px 11px 0; color: #fff; cursor: pointer; display: flex; font-weight: 900; gap: 7px; justify-content: center; min-width: 105px; padding: 0 17px; }
.medicine-quick-search__results { background: #fff; border: 1px solid #c9dce8; border-radius: 0 0 13px 13px; box-shadow: 0 18px 35px rgba(18, 45, 72, .16); left: 18px; max-height: 430px; overflow-y: auto; position: absolute; right: 18px; top: calc(100% - 19px); }
.medicine-quick-search__results[hidden] { display: none; }
.medicine-quick-search__message { color: var(--medicine-muted); font-size: 14px; font-weight: 700; padding: 18px; text-align: center; }
.medicine-quick-search__result { align-items: center; border-bottom: 1px solid #e8eff4; color: inherit; display: grid; gap: 12px; grid-template-columns: 58px minmax(0, 1fr) auto; padding: 10px 13px; text-decoration: none; }
.medicine-quick-search__result:last-child { border-bottom: 0; }
.medicine-quick-search__result:hover,
.medicine-quick-search__result:focus { background: #f3f9fd; color: inherit; outline: none; }
.medicine-quick-search__result img { background: var(--medicine-soft); border: 1px solid #e2ebf0; border-radius: 8px; height: 58px; object-fit: contain; padding: 4px; width: 58px; }
.medicine-quick-search__result strong { color: var(--medicine-ink); display: block; font-size: 15px; line-height: 1.3; }
.medicine-quick-search__result small { color: var(--medicine-muted); display: -webkit-box; font-size: 11px; line-height: 1.4; margin-top: 3px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 1; }
.medicine-quick-search__availability { background: #e8f8f1; border-radius: 999px; color: var(--medicine-green); font-size: 11px; font-weight: 900; padding: 6px 8px; white-space: nowrap; }
.medicine-quick-search__availability.is-store-only,
.medicine-quick-search__availability.is-unavailable { background: #fff0f2; color: var(--medicine-red); }

.medicine-hero {
  background: #fff;
  border: 1px solid var(--medicine-border);
  border-radius: 20px;
  box-shadow: 0 16px 45px rgba(28, 66, 94, .09);
  display: grid;
  gap: 34px;
  grid-template-columns: minmax(240px, 36%) minmax(0, 1fr);
  padding: 28px;
}

.medicine-image-panel {
  align-items: center;
  background: linear-gradient(145deg, #f3fafb, #eef6fd);
  border: 1px solid #d9e9ee;
  border-radius: 16px;
  display: flex;
  justify-content: center;
  min-height: 390px;
  overflow: hidden;
  padding: 24px;
}

.medicine-image-panel img { height: 340px; max-width: 100%; object-fit: contain; width: 100%; }
.medicine-kicker { color: #178a73; display: block; font-size: 13px; font-weight: 900; letter-spacing: .08em; margin-bottom: 8px; text-transform: uppercase; }
.medicine-title { color: var(--medicine-ink); font-size: clamp(29px, 4vw, 46px); font-weight: 900; letter-spacing: -.025em; line-height: 1.1; margin: 0; }
.medicine-pack { color: var(--medicine-muted); font-size: 17px; font-weight: 700; margin: 10px 0 0; }
.medicine-company { color: #40566a; font-size: 14px; margin-top: 6px; }

.medicine-status {
  align-items: center;
  background: #e8f8f1;
  border-radius: 999px;
  color: var(--medicine-green);
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  gap: 7px;
  margin-top: 19px;
  padding: 8px 12px;
}
.medicine-status.is-unavailable { background: #fff0f2; color: var(--medicine-red); }

.medicine-price-block { align-items: center; display: flex; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.medicine-price { color: var(--medicine-blue); font-size: 30px; font-weight: 900; }
.medicine-mrp { color: #778592; font-size: 15px; text-decoration: line-through; }
.medicine-discount { background: #e7f8ef; border-radius: 999px; color: var(--medicine-green); font-size: 13px; font-weight: 900; padding: 5px 9px; }
.medicine-price-note { color: var(--medicine-muted); font-size: 12px; line-height: 1.45; margin: 6px 0 0; }

.medicine-action-row { align-items: center; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.medicine-primary-action,
.medicine-secondary-action {
  align-items: center;
  border-radius: 10px;
  display: inline-flex;
  font-weight: 900;
  gap: 8px;
  justify-content: center;
  min-height: 48px;
  padding: 11px 18px;
  text-decoration: none;
}
.medicine-primary-action { background: var(--medicine-blue); border: 0; color: #fff; cursor: pointer; }
.medicine-primary-action:hover { background: #06498e; color: #fff; }
.medicine-primary-action:disabled { background: #aebbc6; cursor: not-allowed; }
.medicine-secondary-action { background: #fff; border: 1px solid #b7cfe0; color: var(--medicine-blue); }
.medicine-secondary-action:hover { background: #f1f8fd; color: var(--medicine-blue); }

/* Keep View cart beside Add/the saved quantity, including when the action row wraps. */
.medicine-cart-actions { align-items: center; display: flex; gap: 12px; max-width: 100%; }
.medicine-cart-control { flex: 0 0 auto; }
.medicine-cart-control [hidden] { display: none !important; }
.medicine-quantity { align-items: center; background: #fff; border: 1px solid #b7cfe0; border-radius: 10px; display: inline-flex; min-height: 48px; }
.medicine-quantity button { background: transparent; border: 0; border-radius: 9px; color: var(--medicine-blue); cursor: pointer; font-size: 22px; font-weight: 900; min-height: 46px; width: 42px; }
.medicine-quantity button:hover { background: #f1f8fd; }
.medicine-quantity button:disabled { color: #aebbc6; cursor: not-allowed; }
.medicine-quantity button:focus-visible { outline: 3px solid var(--medicine-blue); outline-offset: 2px; }
.medicine-quantity output { color: var(--medicine-ink); font-size: 17px; font-weight: 900; min-width: 32px; text-align: center; }

/* Highlight the other-pack shortcut with the store green while keeping its label and icon legible. */
.medicine-secondary-action[data-medicine-stock-next-step="packs"] { background: var(--medicine-green); border-color: var(--medicine-green); color: #fff; }
.medicine-secondary-action[data-medicine-stock-next-step="packs"]:hover,
.medicine-secondary-action[data-medicine-stock-next-step="packs"]:focus-visible { background: #106044; border-color: #106044; color: #fff; }
.medicine-secondary-action[data-medicine-stock-next-step="packs"]:focus-visible { outline: 3px solid var(--medicine-green); outline-offset: 3px; }

.medicine-restriction {
  background: #fff3f4;
  border: 1px solid #efb4bd;
  border-left: 5px solid #c52e48;
  border-radius: 12px;
  color: #8c2134;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.6;
  margin-top: 22px;
  padding: 15px 17px;
}
.medicine-restriction i { margin-right: 5px; }

.medicine-section { margin-top: 42px; }
/* Keep shortcut destinations below the sticky header after native anchor navigation. */
#medicine-packaging-heading,
#medicine-alternatives-heading { scroll-margin-top: 140px; }
.medicine-section-heading { margin-bottom: 18px; }
.medicine-section-heading span { color: #178a73; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.medicine-section-heading h2 { color: var(--medicine-ink); font-size: clamp(24px, 3vw, 33px); font-weight: 900; margin: 5px 0 0; }
.medicine-section-heading p { color: var(--medicine-muted); line-height: 1.65; margin: 8px 0 0; max-width: 760px; }

.medicine-facts {
  background: #fff;
  border: 1px solid var(--medicine-border);
  border-radius: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
}
.medicine-fact { border-bottom: 1px solid #e8eff4; min-width: 0; padding: 17px 20px; }
.medicine-fact:nth-child(odd) { border-right: 1px solid #e8eff4; }
.medicine-fact dt { color: var(--medicine-muted); font-size: 12px; font-weight: 900; letter-spacing: .03em; margin-bottom: 5px; text-transform: uppercase; }
.medicine-fact dd { color: var(--medicine-ink); font-size: 15px; font-weight: 800; line-height: 1.5; margin: 0; overflow-wrap: anywhere; }

/* Medicine guidance is visually separate from live catalogue and price facts. */
.medicine-information__summary {
  background: linear-gradient(135deg, #eef8ff, #f4fbf7);
  border: 1px solid #cfe3ed;
  border-left: 5px solid #178a73;
  border-radius: 14px;
  color: #24384a;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.75;
  margin: 0 0 16px;
  padding: 18px 20px;
}
.medicine-information__grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.medicine-information__card { background: #fff; border: 1px solid var(--medicine-border); border-radius: 14px; padding: 18px 20px; }
.medicine-information__card.is-wide { grid-column: 1 / -1; }
.medicine-information__card h3 { color: var(--medicine-blue); font-size: 18px; font-weight: 900; margin: 0 0 8px; }
.medicine-information__card p { color: #40566a; line-height: 1.7; margin: 0; }
.medicine-information__card ul { color: #40566a; display: grid; gap: 5px; grid-template-columns: repeat(2, minmax(0, 1fr)); line-height: 1.55; margin: 10px 0 0; padding-left: 20px; }
.medicine-information__review { color: var(--medicine-muted); display: flex; flex-wrap: wrap; font-size: 11px; gap: 5px; line-height: 1.55; margin-top: 13px; padding: 0 4px; }
.medicine-information__review a { color: var(--medicine-blue); font-weight: 800; }
.medicine-information.is-catalogue-only .medicine-information__summary { background: #fffaf0; border-color: #ecd7a5; border-left-color: #b7791f; }
.medicine-information__level { align-items: flex-start; background: #fff8e8; border: 1px solid #efd7a1; border-radius: 11px; color: #79551b; display: flex; font-size: 12px; font-weight: 800; gap: 8px; line-height: 1.6; margin-top: 13px; padding: 11px 13px; }
.medicine-information__level i { margin-top: 3px; }
/* AI profiles remain visually distinct from both reviewed and catalogue-only copy. */
.medicine-information.is-ai-generated .medicine-information__summary { background: #f4f0ff; border-color: #d9cff6; border-left-color: #7255b5; }
.medicine-information__level.is-ai-generated { background: #f6f2ff; border-color: #d9cff6; color: #513c82; }
.medicine-information__level.is-ai-generated div { display: grid; gap: 2px; }
.medicine-information__level.is-ai-generated strong { color: #3f2f68; }

.medicine-alternative-grid,
.medicine-catalog-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.medicine-product-card { background: #fff; border: 1px solid var(--medicine-border); border-radius: 15px; box-shadow: 0 9px 25px rgba(27, 61, 88, .06); display: flex; flex-direction: column; min-width: 0; overflow: hidden; padding: 15px; }
.medicine-product-card__image { align-items: center; background: var(--medicine-soft); border-radius: 11px; display: flex; height: 180px; justify-content: center; overflow: hidden; padding: 12px; }
.medicine-product-card__image img { height: 100%; object-fit: contain; width: 100%; }
.medicine-product-card h3 { font-size: 17px; font-weight: 900; line-height: 1.3; margin: 14px 0 0; }
.medicine-product-card h3 a { color: var(--medicine-ink); }
.medicine-product-card h3 a:hover { color: var(--medicine-blue); }
.medicine-product-card__meta { color: var(--medicine-muted); font-size: 12px; line-height: 1.45; margin-top: 5px; }
.medicine-product-card__composition { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.medicine-product-card__bottom { align-items: flex-end; display: flex; gap: 8px; justify-content: space-between; margin-top: auto; padding-top: 14px; }
.medicine-product-card__price { color: var(--medicine-blue); font-size: 18px; font-weight: 900; }
.medicine-product-card__link { color: var(--medicine-blue); font-size: 13px; font-weight: 900; }
.medicine-alternatives-empty { background: #fff; border: 1px dashed #b9cede; border-radius: 13px; color: var(--medicine-muted); line-height: 1.6; padding: 18px; }

.medicine-disclaimer { background: #f4f8fb; border: 1px solid #d8e6ef; border-radius: 12px; color: #5d7081; font-size: 13px; line-height: 1.65; margin-top: 34px; padding: 14px 16px; }
/* Match the homepage cart's gold edge and white ring on product and catalogue pages. */
.medicine-cart-float { align-items: center; background: var(--medicine-blue); border: 2px solid #ffcc4d; border-radius: 999px; bottom: 18px; box-shadow: 0 0 0 2px #fff, 0 12px 30px rgba(7, 55, 102, .28); color: #fff; display: flex; font-weight: 900; gap: 8px; min-height: 52px; padding: 0 15px; position: fixed; right: 18px; text-decoration: none; z-index: 980; }
.medicine-cart-float:hover { color: #fff; }
.medicine-cart-float strong { align-items: center; background: #ffcc4d; border-radius: 50%; color: #292313; display: flex; font-size: 12px; height: 27px; justify-content: center; min-width: 27px; }
/* Put cart feedback in the customer's main sightline, below the sticky navigation. */
.medicine-toast { align-items: center; background: #17243a; border: 2px solid #fff; border-radius: 14px; box-shadow: 0 0 0 1px rgba(23,36,58,.12), 0 12px 40px rgba(23,36,58,.3); color: #fff; display: flex; font-size: 18px; font-weight: 800; gap: 14px; left: 50%; line-height: 1.5; opacity: 0; overflow-wrap: anywhere; padding: 18px 22px; pointer-events: none; position: fixed; top: max(110px, calc(env(safe-area-inset-top) + 110px)); transform: translate(-50%, -12px); transition: opacity .2s ease, transform .2s ease; width: min(520px, calc(100% - 32px)); z-index: 1100; }
.medicine-toast.is-success { background: #087443; }
/* A large check makes successful additions recognizable before reading the message. */
.medicine-toast.is-success::before { align-items: center; background: #fff; border-radius: 50%; color: #087443; content: "✓"; display: flex; flex: 0 0 38px; font-size: 26px; font-weight: 900; height: 38px; justify-content: center; }
.medicine-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .medicine-toast { transition: none; } }

.medicine-catalog-header { align-items: end; display: flex; gap: 20px; justify-content: space-between; margin-bottom: 26px; }
.medicine-catalog-header h1 { color: var(--medicine-ink); font-size: clamp(31px, 5vw, 48px); font-weight: 900; margin: 0; }
.medicine-catalog-header p { color: var(--medicine-muted); line-height: 1.65; margin: 8px 0 0; max-width: 720px; }
.medicine-page-count { background: #e9f5fc; border-radius: 999px; color: var(--medicine-blue); flex: 0 0 auto; font-size: 13px; font-weight: 900; padding: 8px 12px; }
.medicine-pagination { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 34px; }
.medicine-pagination a,
.medicine-pagination span { align-items: center; border: 1px solid #c7dae7; border-radius: 8px; color: var(--medicine-blue); display: flex; font-weight: 900; height: 41px; justify-content: center; min-width: 41px; padding: 0 11px; }
.medicine-pagination span { background: var(--medicine-blue); border-color: var(--medicine-blue); color: #fff; }

@media (max-width: 1199px) {
  .medicine-alternative-grid,
  .medicine-catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .medicine-page,
  .medicine-catalog-page { padding: 22px 0 48px; }
  .medicine-hero { gap: 22px; grid-template-columns: 1fr; padding: 16px; }
  .medicine-image-panel { min-height: 275px; padding: 16px; }
  .medicine-image-panel img { height: 250px; }
  .medicine-facts { grid-template-columns: 1fr; }
  .medicine-fact:nth-child(odd) { border-right: 0; }
  .medicine-information__grid { grid-template-columns: 1fr; }
  .medicine-information__card.is-wide { grid-column: auto; }
  .medicine-information__card ul { grid-template-columns: 1fr; }
  .medicine-alternative-grid,
  .medicine-catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .medicine-catalog-header { align-items: flex-start; flex-direction: column; }
  .medicine-quick-search { padding: 14px; }
  .medicine-quick-search__heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .medicine-quick-search__form button { min-width: 54px; padding: 0 15px; }
  .medicine-quick-search__form button span { display: none; }
  .medicine-quick-search__results { left: 14px; right: 14px; top: calc(100% - 15px); }
  .medicine-quick-search__result { grid-template-columns: 52px minmax(0, 1fr); }
  .medicine-quick-search__result img { height: 52px; width: 52px; }
  .medicine-quick-search__availability { grid-column: 2; justify-self: start; }
}

@media (max-width: 480px) {
  /* Preserve adjacent cart controls and separate tap targets on narrow phones. */
  .medicine-cart-actions { gap: 8px; }
  .medicine-cart-actions .medicine-primary-action,
  .medicine-cart-actions .medicine-secondary-action { font-size: 13px; gap: 6px; padding: 10px 8px; }
  /* Keep Notify me and its next-step button beside each other, including longer bilingual labels. */
  .medicine-action-row.has-stock-next-step { align-items: stretch; flex-wrap: nowrap; gap: 8px; }
  .medicine-action-row.has-stock-next-step > a { flex: 1 1 0; font-size: 13px; gap: 6px; line-height: 1.4; min-width: 0; padding: 10px 8px; text-align: center; }
  .medicine-alternative-grid,
  .medicine-catalog-grid { grid-template-columns: 1fr; }
  .medicine-product-card { display: grid; gap: 0 13px; grid-template-columns: 92px minmax(0, 1fr); }
  .medicine-product-card__image { grid-column: 1; grid-row: 1 / span 5; height: 112px; padding: 8px; }
  .medicine-product-card > h3,
  .medicine-product-card > .medicine-product-card__meta,
  .medicine-product-card > .medicine-status { grid-column: 2; }
  .medicine-product-card h3 { margin-top: 2px; }
  .medicine-product-card > .medicine-status { margin-top: 9px; }
  .medicine-product-card__bottom { align-items: center; grid-column: 1 / -1; margin-top: 11px; padding-top: 10px; }
}
