/* ============================================================
   Medi Pharma — Trang sản phẩm (list + detail)
   Đồng bộ font Nunito Sans + design system với home
   ============================================================ */

:root {
  --mp-blue:    #1e88a8;
  --mp-cyan:    #0891b2;
  --mp-green:   #14b8a6;
  --mp-ink:     #0f172a;
  --mp-slate:   #475569;
  --mp-slate-2: #64748b;
  --mp-slate-3: #94a3b8;
  --mp-bg:      #f1f7fb;
  --mp-card:    #ffffff;
  --mp-border:  #e2e8f0;
  --mp-radius:  14px;
}

.shop-wrap, .shop-wrap *,
.product-detail-wrap, .product-detail-wrap * {
  font-family: 'Nunito Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Anti-underline cho mọi link/card */
.shop-wrap a, .shop-wrap a:hover, .shop-wrap a:focus,
.shop-wrap button, .shop-wrap button:hover,
.product-detail-wrap a, .product-detail-wrap a:hover, .product-detail-wrap a:focus,
.product-detail-wrap button, .product-detail-wrap button:hover {
  text-decoration: none !important;
}

.shop-wrap { background: var(--mp-bg); padding: 22px 0 60px; min-height: 60vh; }

/* ── Breadcrumb ── */
.shop-breadcrumb {
  font-size: .76rem; font-weight: 700; color: var(--mp-slate-2);
  margin-bottom: 16px;
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.shop-breadcrumb a { color: var(--mp-cyan); text-decoration: none; }
.shop-breadcrumb a:hover { color: var(--mp-blue); text-decoration: underline; }
.shop-breadcrumb .sep { color: var(--mp-slate-3); }

/* ── Page header ── */
.shop-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 22px;
  background: var(--mp-card); border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius); padding: 22px 26px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
}
.shop-eyebrow {
  font-size: .68rem; font-weight: 800; color: var(--mp-cyan);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px;
}
.shop-title {
  margin: 0; font-size: 1.6rem; font-weight: 900; color: var(--mp-ink);
  line-height: 1.2;
}
.shop-subtitle {
  margin: 8px 0 0; font-size: .88rem; font-weight: 600; color: var(--mp-slate-2);
}
.shop-counter {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; padding: 8px 14px;
  font-size: .76rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--mp-blue), var(--mp-cyan));
  box-shadow: 0 6px 14px rgba(8, 145, 178, .26);
}
.shop-counter i { font-size: .75rem; }

/* ── Search bar ── */
.shop-search-bar {
  display: flex; gap: 8px; margin-bottom: 18px;
}
.shop-search-input {
  flex: 1; height: 44px; padding: 0 14px 0 40px; border-radius: 999px;
  border: 1.5px solid var(--mp-border); background: #fff;
  font-size: .9rem; font-weight: 600; color: var(--mp-ink);
  transition: border-color .14s, box-shadow .14s;
  position: relative;
}
.shop-search-wrap { position: relative; flex: 1; }
.shop-search-wrap::before {
  content: "\f002"; font-family: "Font Awesome 6 Free", "Font Awesome 5 Free";
  font-weight: 900; position: absolute; left: 16px; top: 50%;
  transform: translateY(-50%); color: var(--mp-slate-3); font-size: .82rem;
  pointer-events: none;
}
.shop-search-input:focus {
  outline: 0; border-color: var(--mp-cyan);
  box-shadow: 0 0 0 4px rgba(8, 145, 178, .12);
}
.shop-search-btn {
  height: 44px; padding: 0 22px; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, var(--mp-blue), var(--mp-cyan));
  color: #fff; font-weight: 800; font-size: .82rem; cursor: pointer;
  transition: transform .14s, filter .14s;
}
.shop-search-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }

/* ── Filter card ── */
.shop-filter {
  background: var(--mp-card); border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius); padding: 18px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
  position: sticky; top: 90px;
  max-height: calc(100vh - 110px); overflow-y: auto;
}
.shop-filter h3 {
  font-size: .85rem; font-weight: 900; color: var(--mp-ink);
  margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px;
}
.shop-filter h3 i { color: var(--mp-cyan); }
.shop-filter-section { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px dashed var(--mp-border); }
.shop-filter-section:last-of-type { border-bottom: 0; }
.shop-filter-label {
  font-size: .68rem; font-weight: 800; color: var(--mp-slate);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px;
}
/* ── Custom filter controls — pills (radio) + check rows (checkbox) ── */
.shop-filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.shop-filter-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 999px;
  font-size: .78rem; font-weight: 700;
  background: #f1f5f9; color: var(--mp-slate);
  cursor: pointer; user-select: none;
  border: 1.5px solid transparent;
  transition: background .14s, color .14s, box-shadow .14s, transform .14s;
  margin: 0;
}
.shop-filter-pill:hover { background: #e0f7fa; color: var(--mp-blue); }
.shop-filter-pill input { position: absolute; opacity: 0; pointer-events: none; }
.shop-filter-pill:has(input:checked) {
  background: linear-gradient(135deg, var(--mp-blue), var(--mp-cyan));
  color: #fff;
  box-shadow: 0 6px 14px rgba(8, 145, 178, .3);
}
.shop-filter-pill i { font-size: .68rem; }

.shop-filter-cats {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 340px; overflow-y: auto; padding-right: 4px;
}
.shop-filter-cats::-webkit-scrollbar { width: 5px; }
.shop-filter-cats::-webkit-scrollbar-thumb { background: var(--mp-border); border-radius: 4px; }
.shop-filter-cat {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  font-size: .82rem; font-weight: 700;
  color: var(--mp-slate);
  cursor: pointer; user-select: none;
  border: 1.5px solid transparent;
  background: #fff;
  transition: background .14s, color .14s, border-color .14s;
  margin: 0;
}
.shop-filter-cat:hover { background: #f0fbfd; color: var(--mp-blue); }
.shop-filter-cat input { position: absolute; opacity: 0; pointer-events: none; }
.shop-filter-cat-check {
  width: 19px; height: 19px; border-radius: 5px;
  border: 2px solid var(--mp-slate-3);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .14s, border-color .14s, transform .14s;
}
.shop-filter-cat-check::after {
  content: "\f00c"; font-family: "Font Awesome 6 Free", "Font Awesome 5 Free";
  font-weight: 900; color: #fff; font-size: 10px;
  opacity: 0; transform: scale(.5);
  transition: opacity .14s, transform .14s;
}
.shop-filter-cat:hover .shop-filter-cat-check { border-color: var(--mp-cyan); }
.shop-filter-cat:has(input:checked) {
  background: linear-gradient(135deg, rgba(8,145,178,.08), rgba(20,184,166,.08));
  border-color: rgba(8, 145, 178, .42);
  color: var(--mp-blue);
}
.shop-filter-cat:has(input:checked) .shop-filter-cat-check {
  background: linear-gradient(135deg, var(--mp-blue), var(--mp-cyan));
  border-color: var(--mp-cyan);
}
.shop-filter-cat:has(input:checked) .shop-filter-cat-check::after {
  opacity: 1; transform: scale(1);
}
.shop-filter-cat-label {
  flex: 1;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.3;
  text-transform: none;
}
.shop-filter-count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 999px; background: #fff;
  border: 1px solid var(--mp-cyan); color: var(--mp-blue);
  font-size: .65rem; font-weight: 800;
  margin-left: 6px;
}

/* Fallback for browsers không hỗ trợ :has() */
.shop-filter-pill input:checked ~ * { color: inherit; }
.shop-filter-cat input:checked ~ .shop-filter-cat-check {
  background: linear-gradient(135deg, var(--mp-blue), var(--mp-cyan));
  border-color: var(--mp-cyan);
}
.shop-filter-cat input:checked ~ .shop-filter-cat-check::after {
  opacity: 1; transform: scale(1);
}
.shop-filter-submit {
  width: 100%; height: 40px; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, var(--mp-blue), var(--mp-cyan));
  color: #fff; font-weight: 800; font-size: .82rem;
  box-shadow: 0 6px 14px rgba(8, 145, 178, .3); cursor: pointer;
  transition: transform .14s, filter .14s;
}
.shop-filter-submit:hover { transform: translateY(-1px); filter: brightness(1.06); }
.shop-filter-reset {
  display: block; width: 100%; margin-top: 8px;
  text-align: center; padding: 8px;
  font-size: .76rem; font-weight: 700; color: var(--mp-slate-2);
  text-decoration: none; border-radius: 8px;
  transition: background .14s;
}
.shop-filter-reset:hover { background: #f1f5f9; color: var(--mp-blue); }

/* ── Product card ── */
.shop-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.shop-card {
  background: var(--mp-card); border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius); overflow: hidden;
  display: flex; flex-direction: column;
  position: relative;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.shop-card:hover {
  transform: translateY(-3px);
  border-color: rgba(8, 145, 178, .3);
  box-shadow: 0 16px 30px rgba(8, 145, 178, .14);
}
.shop-card-main {
  display: flex; flex-direction: column; flex: 1;
  text-decoration: none; color: inherit;
}
.shop-card-main:hover { color: inherit; text-decoration: none; }
.shop-card-img-wrap {
  position: relative; aspect-ratio: 1/1; background: #f8fafc;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.shop-card-img { width: 100%; height: 100%; object-fit: contain; padding: 14px; transition: transform .35s; }
.shop-card:hover .shop-card-img { transform: scale(1.05); }
.shop-card-badge {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 8px; border-radius: 6px;
  font-size: .62rem; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: #fff;
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  box-shadow: 0 4px 10px rgba(239, 68, 68, .32);
}
.shop-card-badge.is-rx {
  background: linear-gradient(135deg, var(--mp-blue), var(--mp-cyan));
  box-shadow: 0 4px 10px rgba(8, 145, 178, .32);
}
.shop-card-body { padding: 14px 14px 0; display: flex; flex-direction: column; flex: 1; }
.shop-card-cat {
  font-size: .65rem; font-weight: 800; color: var(--mp-cyan);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px;
}
.shop-card-name {
  font-size: .9rem; font-weight: 800; color: var(--mp-ink);
  line-height: 1.35; margin: 0 0 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.5em;
}
.shop-card-spec {
  font-size: .75rem; font-weight: 600; color: var(--mp-slate-2);
  margin-bottom: 8px; min-height: 1.2em;
}
.shop-card-price {
  font-size: 1.1rem; font-weight: 900; color: #0f6d88;
  margin-top: auto;
}
.shop-card-price-locked {
  font-size: .82rem; font-weight: 700; color: var(--mp-slate);
  margin-top: auto;
}
.shop-card-price-locked i { color: var(--mp-cyan); margin-right: 4px; }

/* CTA row — separate from clickable .shop-card-main */
.shop-card-cta { display: flex; gap: 6px; padding: 12px 14px 14px; }
.shop-card-cta-add {
  flex: 1; height: 38px; border: 0; border-radius: 10px;
  background: linear-gradient(135deg, var(--mp-blue), var(--mp-cyan));
  color: #fff; font-weight: 800; font-size: .76rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: filter .14s, transform .14s, box-shadow .14s;
  box-shadow: 0 4px 12px rgba(8, 145, 178, .25);
  text-decoration: none;
  white-space: nowrap;
}
.shop-card-cta-add:hover {
  filter: brightness(1.08); transform: translateY(-1px); color: #fff;
  box-shadow: 0 8px 18px rgba(8, 145, 178, .38);
}
.shop-card-cta-add:disabled { opacity: .7; cursor: not-allowed; }
.shop-card-cta-add.is-locked {
  background: #f1f5f9; color: var(--mp-slate); box-shadow: none;
  border: 1.5px solid var(--mp-border);
}
.shop-card-cta-add.is-locked:hover { color: var(--mp-blue); border-color: var(--mp-cyan); filter: none; }
.shop-card-cta-view {
  width: 38px; height: 38px; border: 1.5px solid var(--mp-border); border-radius: 10px;
  background: #fff; color: var(--mp-slate); font-size: .85rem;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; transition: border-color .14s, color .14s, background .14s;
  flex-shrink: 0;
}
.shop-card-cta-view:hover { border-color: var(--mp-cyan); color: var(--mp-blue); background: #f0fbfd; }

/* Search bar — improved icon positioning */
.shop-search-wrap { position: relative; flex: 1; display: flex; align-items: center; }
.shop-search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--mp-slate-3); font-size: .9rem; pointer-events: none; z-index: 1;
}
.shop-search-wrap::before { content: none !important; }
.shop-search-input {
  width: 100%; flex: 1; height: 46px;
  padding: 0 16px 0 44px; border-radius: 999px;
  border: 1.5px solid var(--mp-border); background: #fff;
  font-size: .92rem; font-weight: 600; color: var(--mp-ink);
  transition: border-color .14s, box-shadow .14s;
}
.shop-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ── Pagination ── */
.shop-pager {
  display: flex; justify-content: center; align-items: center; gap: 6px;
  margin-top: 26px; flex-wrap: wrap;
}
.shop-pager a, .shop-pager span {
  min-width: 38px; height: 38px; padding: 0 12px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1.5px solid var(--mp-border);
  font-size: .85rem; font-weight: 700; color: var(--mp-slate);
  text-decoration: none; transition: all .14s;
}
.shop-pager a:hover { border-color: var(--mp-cyan); color: var(--mp-blue); }
.shop-pager .active {
  background: linear-gradient(135deg, var(--mp-blue), var(--mp-cyan));
  border-color: transparent; color: #fff;
}
.shop-pager .disabled { opacity: .4; pointer-events: none; }

/* ── Empty state ── */
.shop-empty {
  background: #fff; border: 1px dashed var(--mp-border); border-radius: var(--mp-radius);
  padding: 60px 20px; text-align: center;
}
.shop-empty i { font-size: 3rem; color: var(--mp-slate-3); margin-bottom: 14px; display: block; }
.shop-empty h3 { font-size: 1.1rem; font-weight: 800; color: var(--mp-ink); margin: 0 0 6px; }
.shop-empty p { font-size: .88rem; color: var(--mp-slate-2); margin: 0; }

/* ============================================================
   Product detail page
   ============================================================ */
.product-detail-wrap { background: var(--mp-bg); padding: 22px 0 60px; min-height: 70vh; }

.pd-card {
  background: var(--mp-card); border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius); padding: 28px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
}
.pd-grid {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 32px;
  align-items: start;
}
.pd-img-wrap {
  background: #fff; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--mp-border);
  aspect-ratio: 1/1;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.pd-img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 24px; }
.pd-rx-tag {
  position: absolute; top: 14px; left: 14px;
  padding: 5px 12px; border-radius: 6px;
  font-size: .68rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: #fff;
  background: linear-gradient(135deg, var(--mp-blue), var(--mp-cyan));
  box-shadow: 0 6px 14px rgba(8, 145, 178, .32);
}

.pd-info-cat {
  font-size: .68rem; font-weight: 800; color: var(--mp-cyan);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px;
}
.pd-info-title {
  font-size: 1.55rem; font-weight: 900; color: var(--mp-ink);
  line-height: 1.25; margin: 0 0 12px;
}
.pd-info-short {
  font-size: .92rem; font-weight: 600; color: var(--mp-slate);
  line-height: 1.65; margin: 0 0 16px;
}
.pd-meta {
  display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px;
  margin: 14px 0; padding: 14px 18px;
  background: #f8fcfe; border: 1px dashed rgba(8, 145, 178, .22);
  border-radius: 10px;
  font-size: .82rem;
}
.pd-meta dt { font-weight: 800; color: var(--mp-slate); margin: 0; }
.pd-meta dd { margin: 0; color: var(--mp-ink); font-weight: 600; }

.pd-price-wrap {
  background: linear-gradient(135deg, rgba(8, 145, 178, .06), rgba(20, 184, 166, .08));
  border: 1.5px solid rgba(8, 145, 178, .22);
  border-radius: 12px; padding: 16px 20px; margin: 18px 0;
}
.pd-price-label {
  font-size: .68rem; font-weight: 800; color: var(--mp-slate-2);
  text-transform: uppercase; letter-spacing: .04em;
}
.pd-price {
  font-size: 2rem; font-weight: 900; color: var(--mp-blue);
  letter-spacing: -.01em; line-height: 1.1; margin-top: 2px;
}
.pd-price small { font-size: .9rem; font-weight: 700; color: var(--mp-slate-2); }
.pd-price-locked {
  font-size: 1rem; font-weight: 800; color: var(--mp-slate);
}
.pd-price-locked a { color: var(--mp-blue); }

.pd-cta {
  display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0;
}
.pd-btn {
  height: 48px; padding: 0 26px; border: 0; border-radius: 999px;
  font-weight: 800; font-size: .9rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform .14s, filter .14s, box-shadow .14s;
  text-decoration: none;
}
.pd-btn-primary {
  background: linear-gradient(135deg, var(--mp-blue), var(--mp-cyan));
  color: #fff;
  box-shadow: 0 10px 22px rgba(8, 145, 178, .35);
}
.pd-btn-primary:hover { transform: translateY(-2px); filter: brightness(1.06); color: #fff; }
.pd-btn-outline {
  background: #fff; color: var(--mp-blue);
  border: 1.5px solid rgba(8, 145, 178, .35);
}
.pd-btn-outline:hover { border-color: var(--mp-cyan); background: #f0fbfd; color: var(--mp-blue); }

.pd-trust {
  display: flex; gap: 18px; flex-wrap: wrap;
  padding: 14px 0; margin-top: 14px;
  border-top: 1px solid var(--mp-border);
  font-size: .78rem; font-weight: 700; color: var(--mp-slate);
}
.pd-trust-item { display: inline-flex; align-items: center; gap: 6px; }
.pd-trust-item i { color: var(--mp-green); font-size: .85rem; }

/* ── Tabs / sections ── */
.pd-sections { margin-top: 28px; }
.pd-section {
  background: var(--mp-card); border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius); padding: 22px 28px;
  margin-bottom: 14px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .04);
}
.pd-section h2 {
  font-size: 1.1rem; font-weight: 900; color: var(--mp-ink);
  margin: 0 0 14px;
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--mp-border);
  scroll-margin-top: 90px;
}
.pd-section h2 i {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, rgba(8,145,178,.12), rgba(20,184,166,.12));
  color: var(--mp-blue); font-size: .92rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.pd-section p, .pd-section li {
  font-size: .9rem; font-weight: 500; color: var(--mp-slate);
  line-height: 1.75; margin-bottom: 6px;
}
.pd-section ul, .pd-section ol { padding-left: 22px; }

.pd-warning {
  background: linear-gradient(135deg, #fef3c7, #fef9c3);
  border: 1px solid #fcd34d; border-left: 4px solid #f59e0b;
  border-radius: 10px; padding: 14px 18px; margin: 18px 0;
  font-size: .88rem; color: #78350f;
}
.pd-warning strong { color: #451a03; }
.pd-warning i { color: #d97706; margin-right: 6px; }

/* ── Related products ── */
.pd-related-title {
  font-size: 1.2rem; font-weight: 900; color: var(--mp-ink);
  margin: 32px 0 14px;
  display: flex; align-items: center; gap: 10px;
}
.pd-related-title i { color: var(--mp-cyan); }

/* ── Responsive ── */
@media (max-width: 992px) {
  .pd-grid { grid-template-columns: 1fr; gap: 24px; }
  .shop-filter { position: static; max-height: none; }
  .shop-head { padding: 18px; }
  .shop-title { font-size: 1.3rem; }
  .pd-card { padding: 20px; }
  .pd-info-title { font-size: 1.3rem; }
  .pd-meta { grid-template-columns: 1fr; gap: 6px; padding: 12px 14px; }
  .pd-meta dt { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; }
}
@media (max-width: 576px) {
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .shop-card-name { font-size: .82rem; }
  .shop-card-price { font-size: 1rem; }
  .pd-section { padding: 18px; }
  .pd-section h2 { font-size: 1rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .shop-card, .shop-card-img, .pd-btn { transition: none !important; }
}
