/* ===== SAKURA MEDICAL · SHOP STYLES ===== */

/* ── Shop Header ── */
.shop-header {
  background: var(--gradient-2);
  padding: 100px 0 36px;
  position: relative;
  overflow: hidden;
}
.shop-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('images/hero-shop.jpg') center/cover no-repeat;
  opacity: .18;
}
.shop-header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.shop-header h1 {
  font-family: 'Noto Serif SC', serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: .02em;
  line-height: 1.2;
}
.shop-header-sub {
  color: rgba(255,255,255,.65);
  font-size: .9rem;
  margin-top: 8px;
  letter-spacing: .04em;
}
.shop-trust-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.shop-trust-badge {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.9);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 500;
  white-space: nowrap;
}

/* ── Category Tabs ── */
.cat-bar {
  background: var(--white);
  border-bottom: 1px solid rgba(155,35,53,.10);
  position: sticky;
  top: 68px;
  z-index: 90;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.cat-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 12px 0;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0;
  background: none;
  border: 1.5px solid #e5e7eb;
  border-radius: 100px;
  padding: 8px 18px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--mid);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: 'Noto Sans SC', sans-serif;
}
.cat-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--sakura-1);
}
.cat-tab.active {
  background: var(--gradient);
  border-color: transparent;
  color: var(--white);
  box-shadow: 0 3px 12px rgba(155,35,53,.3);
}

/* ── Sort / Count Bar ── */
.sort-bar {
  padding: 16px 0;
}
.sort-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.products-count {
  font-size: .85rem;
  color: var(--muted);
}
.sort-btns {
  display: flex;
  gap: 6px;
}
.sort-btn {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: .8rem;
  color: var(--mid);
  cursor: pointer;
  transition: all .2s;
  font-family: 'Noto Sans SC', sans-serif;
}
.sort-btn.active,
.sort-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--sakura-1);
}

/* ── Products Grid ── */
.products-section {
  padding: 8px 0 80px;
  background: #f5f5f7;
  min-height: 60vh;
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 20px 0;
}

/* ── Product Card ── */
.product-card {
  background: var(--white);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  transition: transform .3s, box-shadow .3s;
  display: flex;
  flex-direction: column;
  position: relative;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0,0,0,.12);
}
.product-img-wrap {
  position: relative;
}
.product-img {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-emoji {
  font-size: 3.8rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.25));
}
.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  z-index: 1;
}
.product-badge.hot {
  background: #ff4444;
  color: #fff;
}
.product-badge.new-badge {
  background: #0070f3;
  color: #fff;
}
.product-badge.sale {
  background: #ff8800;
  color: #fff;
}
.product-badge.buy2 {
  background: #7c3aed;
  color: #fff;
}
.product-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}
.product-brand {
  font-size: .72rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.product-name {
  font-size: .92rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.35;
}
.product-spec {
  font-size: .76rem;
  color: var(--muted);
}
.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}
.product-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  font-family: 'Noto Serif SC', serif;
}
.product-orig {
  font-size: .78rem;
  color: #bbb;
  text-decoration: line-through;
}
.product-discount {
  font-size: .72rem;
  background: #fff0f0;
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.product-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
}
.btn-add-cart {
  flex: 1;
  background: var(--sakura-1);
  color: var(--primary);
  border: 1.5px solid var(--sakura-2);
  border-radius: 100px;
  padding: 9px 12px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-family: 'Noto Sans SC', sans-serif;
}
.btn-add-cart:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}
.btn-buy-now {
  flex: 1;
  background: var(--gradient);
  color: var(--white);
  border: none;
  border-radius: 100px;
  padding: 9px 12px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-family: 'Noto Sans SC', sans-serif;
}
.btn-buy-now:hover {
  opacity: .88;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(155,35,53,.4);
}

/* ── Empty State ── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state p { font-size: 1rem; }

/* ── Cart FAB ── */
.cart-fab {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gradient);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(155,35,53,.5);
  z-index: 200;
  transition: transform .25s, box-shadow .25s;
}
.cart-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 32px rgba(155,35,53,.6);
}
.cart-fab svg { width: 26px; height: 26px; fill: white; }
.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff4444;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  transition: transform .2s;
}
.cart-badge.bump { transform: scale(1.4); }
.cart-badge[data-count="0"] { display: none; }

/* ── Cart Overlay ── */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s;
  backdrop-filter: blur(2px);
}
.cart-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Cart Drawer ── */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 100vw;
  background: var(--white);
  z-index: 301;
  transform: translateX(100%);
  transition: transform .38s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,.15);
}
.cart-drawer.open {
  transform: translateX(0);
}
.cart-drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f0e6ea;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--light);
}
.cart-drawer-header h3 {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.15rem;
  color: var(--dark);
}
.cart-drawer-header .cart-item-count {
  font-size: .8rem;
  color: var(--muted);
  margin-left: 8px;
}
.cart-close-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--mid);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background .2s;
}
.cart-close-btn:hover { background: var(--sakura-1); color: var(--primary); }

.cart-items-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #fafafa;
  border-radius: 12px;
  border: 1px solid #f0e6ea;
}
.cart-item-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.3;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-brand {
  font-size: .72rem;
  color: var(--muted);
}
.cart-item-price {
  font-size: .88rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid #ddd;
  background: none;
  font-size: .85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mid);
  transition: all .15s;
  font-family: 'Noto Sans SC', sans-serif;
}
.qty-btn:hover { border-color: var(--primary); color: var(--primary); }
.qty-num {
  font-size: .85rem;
  font-weight: 600;
  color: var(--dark);
  width: 20px;
  text-align: center;
}
.cart-item-remove {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: .8rem;
  padding: 4px;
  transition: color .15s;
  flex-shrink: 0;
}
.cart-item-remove:hover { color: #ff4444; }

.cart-empty-msg {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
}
.cart-empty-msg .empty-cart-icon { font-size: 3rem; opacity: .5; }
.cart-empty-msg p { font-size: .9rem; }

.cart-drawer-footer {
  border-top: 1px solid #f0e6ea;
  padding: 20px 24px;
  background: var(--light);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.cart-total-label { font-size: .9rem; color: var(--mid); }
.cart-total-amount {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  font-family: 'Noto Serif SC', serif;
}
.cart-savings {
  font-size: .78rem;
  color: #16a34a;
  text-align: right;
}
.btn-checkout {
  background: var(--gradient);
  color: var(--white);
  border: none;
  border-radius: 100px;
  padding: 14px 24px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .25s;
  font-family: 'Noto Sans SC', sans-serif;
  box-shadow: 0 4px 16px rgba(155,35,53,.35);
}
.btn-checkout:hover {
  opacity: .9;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(155,35,53,.45);
}
.btn-checkout:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none;
}
.cart-note {
  font-size: .73rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

/* ── Added-to-Cart Toast ── */
.cart-toast {
  position: fixed;
  bottom: 170px;
  right: 24px;
  background: var(--dark);
  color: var(--white);
  padding: 10px 18px;
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 500;
  z-index: 400;
  transform: translateY(20px);
  opacity: 0;
  transition: all .3s;
  pointer-events: none;
  white-space: nowrap;
}
.cart-toast.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Shop Responsive ── */
@media (max-width: 1100px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .shop-header h1 { font-size: 1.8rem; }
  .shop-trust-badges { display: none; }
  .cart-drawer { width: 100vw; }
  .sort-bar-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (max-width: 420px) {
  .products-grid { grid-template-columns: 1fr; }
  .product-img { height: 140px; }
}

/* ── Product Detail Modal ── */
.product-img-wrap { cursor: pointer; position: relative; }
.product-img-hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,.22);
  color: #fff;
  font-size: .72rem;
  letter-spacing: .04em;
  padding: 4px 14px;
  border-radius: 20px;
  backdrop-filter: blur(6px);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.product-img-wrap:hover .product-img-hint { opacity: 1; }

.pd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,5,12,.55);
  backdrop-filter: blur(4px);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s;
}
.pd-overlay.open { opacity: 1; pointer-events: auto; }

.pd-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%) scale(.97);
  width: min(480px, 94vw);
  max-height: 88vh;
  background: #fff;
  border-radius: 20px;
  overflow-y: auto;
  z-index: 1101;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s, transform .28s;
  box-shadow: 0 24px 60px rgba(20,5,12,.22);
}
.pd-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.pd-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: rgba(255,255,255,.28);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  transition: background .2s;
}
.pd-close:hover { background: rgba(255,255,255,.44); }

.pd-img-header {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 20px 20px 0 0;
  flex-shrink: 0;
}
.pd-emoji { font-size: 4rem; filter: drop-shadow(0 4px 16px rgba(0,0,0,.18)); }

.pd-content {
  padding: 24px 28px 32px;
}
.pd-brand {
  font-size: .78rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.pd-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 6px;
  line-height: 1.35;
}
.pd-spec {
  font-size: .82rem;
  color: #8a7080;
  margin-bottom: 14px;
}
.pd-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 18px;
}
.pd-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
}
.pd-orig {
  font-size: .9rem;
  color: #b0a0a8;
  text-decoration: line-through;
}
.pd-disc {
  font-size: .78rem;
  background: #fef2f2;
  color: #dc2626;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}
.pd-desc {
  font-size: .9rem;
  color: #5a4050;
  line-height: 1.75;
  margin-bottom: 18px;
  background: #faf7f8;
  padding: 14px 16px;
  border-radius: 12px;
  border-left: 3px solid var(--primary);
}
.pd-highlights {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pd-highlights li {
  font-size: .85rem;
  color: #3a2030;
  padding-left: 22px;
  position: relative;
  line-height: 1.5;
}
.pd-highlights li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}
.pd-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pd-btn-add {
  padding: 13px 0;
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-size: .95rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.pd-btn-add:hover { background: var(--primary); color: #fff; }
.pd-btn-buy {
  padding: 13px 0;
  background: var(--gradient-1);
  color: #fff;
  border: none;
  font-size: .95rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: opacity .2s;
}
.pd-btn-buy:hover { opacity: .88; }

@media (max-width: 480px) {
  .pd-content { padding: 18px 18px 28px; }
  .pd-name { font-size: 1.1rem; }
  .pd-price { font-size: 1.35rem; }
}

/* ===== PRODUCT DETAIL IMAGE GALLERY ===== */
.pd-img-gallery { width: 100%; display: flex; flex-direction: column; gap: 0; }
.pd-gallery-main {
  width: 100%; height: 220px;
  object-fit: cover; display: block;
}
.pd-gallery-thumbs {
  display: flex; gap: 6px; padding: 8px 10px;
  background: rgba(0,0,0,.25); overflow-x: auto;
}
.pd-gallery-thumb {
  width: 54px; height: 40px; object-fit: cover;
  border-radius: 5px; cursor: pointer; flex-shrink: 0;
  border: 2px solid transparent;
  opacity: .7; transition: opacity .2s, border-color .2s;
}
.pd-gallery-thumb:hover, .pd-gallery-thumb.active {
  opacity: 1; border-color: #fff;
}
