/* ==========================================================================
   PHARMACY PAGE — full redesign (pharmacy-page.css)
   Scoped to .page-pharmacy
   ========================================================================== */

.page-pharmacy {
  background: #f0fdf9;
}

/* ---- Hero ---- */
.ph-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 80% at 100% 0%, rgba(16, 185, 129, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
    linear-gradient(165deg, #ecfdf5 0%, #d1fae5 45%, #f0fdf9 100%);
  border-bottom: 1px solid rgba(5, 150, 105, 0.12);
  padding: 20px 0 32px;
}

.ph-hero__inner {
  position: relative;
  z-index: 1;
}

.ph-hero__breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.ph-hero__breadcrumb a {
  color: #047857;
  text-decoration: none;
  font-weight: 500;
}

.ph-hero__breadcrumb a:hover { text-decoration: underline; }

.ph-hero__breadcrumb svg {
  width: 12px;
  height: 12px;
  color: #94a3b8;
  flex-shrink: 0;
}

.ph-hero__grid {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 320px);
  gap: 28px;
  align-items: center;
}

.ph-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(5, 150, 105, 0.22);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #047857;
  margin-bottom: 14px;
}

.ph-hero__eyebrow svg {
  width: 14px;
  height: 14px;
}

.ph-hero__title {
  font-family: var(--font-display);
  font-size: clamp(26px, 4.5vw, 38px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #064e3b;
  margin: 0 0 12px;
}

.ph-hero__desc {
  font-size: 15px;
  line-height: 1.65;
  color: #334155;
  max-width: 520px;
  margin: 0 0 18px;
}

.ph-hero__desc strong {
  color: #b91c1c;
  font-weight: 700;
}

.ph-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ph-hero__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(6, 95, 70, 0.14);
  font-size: 12px;
  font-weight: 600;
  color: #065f46;
}

.ph-hero__chip svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #059669;
}

.ph-hero__visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.ph-hero__card {
  position: relative;
  width: 100%;
  max-width: 280px;
  background: var(--white);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 20px 50px rgba(6, 95, 70, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.18);
}

.ph-hero__card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #059669, #10b981);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.ph-hero__card-icon svg { width: 26px; height: 26px; }

.ph-hero__card strong {
  display: block;
  font-size: 16px;
  color: #064e3b;
  margin-bottom: 6px;
}

.ph-hero__card p {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 14px;
}

.ph-hero__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ph-hero__stat {
  background: #f0fdf4;
  border-radius: 12px;
  padding: 10px 12px;
  text-align: center;
}

.ph-hero__stat b {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: #059669;
  line-height: 1.2;
}

.ph-hero__stat span {
  font-size: 10.5px;
  color: #64748b;
  font-weight: 600;
}

.ph-hero__blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.ph-hero__blob--1 {
  width: 120px;
  height: 120px;
  background: rgba(16, 185, 129, 0.12);
  top: -20px;
  right: -10px;
}

.ph-hero__blob--2 {
  width: 80px;
  height: 80px;
  background: rgba(6, 182, 212, 0.1);
  bottom: 10px;
  left: -20px;
}

/* ---- Main shop area ---- */
.ph-shop {
  padding: 24px 0 40px;
}

.ph-shop__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.ph-shop__head h2 {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 24px);
  font-weight: 700;
  color: var(--navy-900);
  margin: 0 0 4px;
}

.ph-shop__head p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.ph-shop__count {
  font-size: 12.5px;
  font-weight: 600;
  color: #047857;
  background: rgba(5, 150, 105, 0.1);
  padding: 6px 12px;
  border-radius: 999px;
}

/* Toolbar */
.ph-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid rgba(5, 150, 105, 0.12);
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(6, 95, 70, 0.06);
}

.ph-toolbar__search {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gray-50);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 0 14px;
  height: 44px;
}

.ph-toolbar__search svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.ph-toolbar__search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--navy-900);
  outline: none;
  min-width: 0;
}

.ph-toolbar__search input::placeholder { color: var(--text-muted); }

.ph-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ph-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border-default);
  background: var(--white);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.ph-filter-btn svg {
  width: 14px;
  height: 14px;
}

.ph-filter-btn:hover {
  border-color: #059669;
  color: #047857;
}

.ph-filter-btn.is-active {
  background: #059669;
  border-color: #059669;
  color: var(--white);
}

.ph-filter-btn.is-active svg { color: var(--white); }

/* Product grid */
.ph-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.ph-grid.is-empty::after {
  content: "No medicines match your search. Try a different filter.";
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--white);
  border-radius: 16px;
  border: 1px dashed var(--border-default);
}

/* Product cards use standard styles from home.css */

/* How it works */
.ph-how {
  margin-top: 36px;
  padding: 24px;
  background: var(--white);
  border-radius: 20px;
  border: 1px solid rgba(5, 150, 105, 0.12);
  box-shadow: 0 4px 20px rgba(6, 95, 70, 0.06);
}

.ph-how__head {
  text-align: center;
  margin-bottom: 22px;
}

.ph-how__head h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #064e3b;
  margin: 0 0 6px;
}

.ph-how__head p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.ph-how__steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.ph-how__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 12px;
  border-radius: 14px;
  background: #f0fdf4;
  border: 1px solid rgba(5, 150, 105, 0.1);
}

.ph-how__step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #059669, #10b981);
  color: var(--white);
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.ph-how__step strong {
  display: block;
  font-size: 14px;
  color: #064e3b;
  margin-bottom: 4px;
}

.ph-how__step span {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Trust grid */
.ph-trust {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.ph-trust__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--white);
  border-radius: 14px;
  border: 1px solid rgba(5, 150, 105, 0.1);
}

.ph-trust__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ph-trust__icon svg { width: 20px; height: 20px; }

.ph-trust__item strong {
  display: block;
  font-size: 13px;
  color: var(--navy-900);
  margin-bottom: 3px;
}

.ph-trust__item span {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Rx notice */
.ph-rx-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 20px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid rgba(217, 119, 6, 0.25);
  border-radius: 14px;
}

.ph-rx-note svg {
  width: 20px;
  height: 20px;
  color: #b45309;
  flex-shrink: 0;
  margin-top: 1px;
}

.ph-rx-note p {
  font-size: 12.5px;
  line-height: 1.55;
  color: #78350f;
  margin: 0;
}

.ph-rx-note strong { color: #92400e; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .ph-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ph-trust {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .ph-hero {
    padding: 16px 0 24px;
  }

  .ph-hero__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .ph-hero__visual {
    min-height: auto;
  }

  .ph-hero__card {
    max-width: 100%;
  }

  .ph-hero__title br { display: none; }

  .ph-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }

  .ph-toolbar__search {
    min-width: 0;
    width: 100%;
  }

  .ph-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .ph-filters::-webkit-scrollbar { display: none; }

  .ph-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .ph-how__steps {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ph-how__step {
    flex-direction: row;
    text-align: left;
    align-items: flex-start;
    gap: 14px;
  }

  .ph-how__step-num {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .ph-trust {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ph-shop__head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .ph-hero__chips {
    gap: 6px;
  }

  .ph-hero__chip {
    font-size: 11px;
    padding: 6px 10px;
  }

  .ph-hero__stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .ph-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-width: none;
  }

  .ph-how {
    padding: 18px 14px;
  }
}

/* ---- Pharmacy product detail ---- */
.page-pharmacy-detail .ph-pd-gallery {
  position: relative;
}

.page-pharmacy-detail .ph-pd-rx-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.page-pharmacy-detail .ph-pd-rx-badge--required {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid rgba(185, 28, 28, 0.2);
}

.page-pharmacy-detail .ph-pd-rx-badge--otc {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid rgba(4, 120, 87, 0.2);
}

.page-pharmacy-detail .ph-pd-vendor {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 6px;
}

.page-pharmacy-detail .ph-pd-rx-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  margin: 14px 0 4px;
  background: #fff7ed;
  border: 1px solid rgba(217, 119, 6, 0.22);
  border-radius: 12px;
}

.page-pharmacy-detail .ph-pd-rx-notice svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: #c2410c;
  margin-top: 2px;
}

.page-pharmacy-detail .ph-pd-rx-notice strong {
  display: block;
  font-size: 13.5px;
  color: #9a3412;
  margin-bottom: 4px;
}

.page-pharmacy-detail .ph-pd-rx-notice span {
  font-size: 12.5px;
  color: #b45309;
  line-height: 1.45;
}

.page-pharmacy-detail .btn-pharmacy-rx {
  background: #059669;
  border-color: #059669;
  color: var(--white);
}

.page-pharmacy-detail .btn-pharmacy-rx:hover {
  background: #047857;
  border-color: #047857;
}

@media (max-width: 768px) {
  .page-pharmacy-detail .pd-actions-btns {
    display: none;
  }

  .page-pharmacy-detail .pd-sticky-bar .btn {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
  }
}

/* ---- Pharmacy cards — badge on image, compact variant ---- */
.product-card--pharmacy .pc-img-wrap .pharmacy-rx-badge {
  top: 8px;
  left: 8px;
  z-index: 2;
}

.product-card--pharmacy-compact .pc-body {
  padding: 10px 11px 11px;
  gap: 4px;
}

.product-card--pharmacy-compact .pc-vendor {
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card--pharmacy-compact .pc-title {
  font-size: 12px;
  line-height: 1.35;
  height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card--pharmacy-compact .pc-rating span {
  font-size: 10px;
}

.product-card--pharmacy-compact .pc-price {
  font-size: 14px;
}

.product-card--pharmacy-compact .pc-mrp {
  font-size: 11px;
}

.product-card--pharmacy-compact .pc-add-btn {
  font-size: 11px;
  padding: 8px 6px;
  margin-top: 8px;
  min-height: 36px;
  white-space: nowrap;
}

/* ---- Pharmacy detail — similar products row ---- */
.page-pharmacy-detail .pd-similar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.page-pharmacy-detail .pd-similar-head .section-head {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.page-pharmacy-detail .pd-similar-head .section-head h2 {
  margin: 0;
  font-size: 18px;
}

@media (max-width: 768px) {
  .page-pharmacy-detail .ph-pd-similar {
    padding-bottom: 8px;
  }

  .page-pharmacy-detail .ph-pd-similar .pd-similar-head {
    margin-bottom: 10px;
    padding: 0 16px;
  }

  .page-pharmacy-detail .ph-pd-similar .pd-similar-head .section-head h2 {
    font-size: 16px;
  }

  .page-pharmacy-detail .ph-pd-similar .pd-similar-row .product-card--pharmacy {
    flex: 0 0 176px;
    width: 176px;
    min-width: 176px;
    max-width: 176px;
  }

  .page-pharmacy-detail .ph-pd-similar .pd-similar-row .product-card--pharmacy .pc-img-wrap {
    aspect-ratio: 1 / 1;
  }

  .page-pharmacy-detail .ph-pd-similar .pd-similar-row .product-card--pharmacy .pc-img-wrap .pharmacy-rx-badge {
    font-size: 8px;
    padding: 3px 5px;
  }

  .page-pharmacy-detail .ph-pd-similar .pd-similar-row .product-card--pharmacy-compact .pc-add-btn {
    font-size: 10.5px;
    padding: 7px 5px;
    min-height: 34px;
  }

  .page-pharmacy-detail .ph-pd-similar .pd-similar-row .product-card .pc-rating .stars svg {
    width: 10px;
    height: 10px;
  }
}

/* ---- Pharmacy listing page — mobile card polish ---- */
@media (max-width: 768px) {
  .page-pharmacy .ph-grid .product-card--pharmacy .pc-img-wrap .pharmacy-rx-badge {
    font-size: 8px;
    padding: 3px 6px;
  }

  .page-pharmacy .ph-grid .product-card--pharmacy .pc-title {
    font-size: 12px;
    height: 2.7em;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .page-pharmacy .ph-grid .product-card--pharmacy .pc-add-btn {
    font-size: 11px;
    padding: 8px 6px;
    min-height: 36px;
    white-space: nowrap;
  }

  .page-pharmacy .ph-grid .product-card--pharmacy .pc-add-btn--rx {
    font-size: 10px;
  }

  .page-pharmacy .ph-grid .product-card--pharmacy .pc-add-btn svg {
    width: 12px;
    height: 12px;
  }
}
