:root {
  --blue: #1d4ed8;
  --blue-2: #2563eb;
  --blue-deep: #0b1f4d;
  --blue-soft: #dbeafe;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #ebf2fc;
  --card: #ffffff;
  --danger: #1d4ed8;
  --shadow: 0 8px 24px rgba(15, 39, 68, 0.08);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Poppins, "Segoe UI", sans-serif;
  line-height: 1.5;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
button, input, select { font-family: inherit; }

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  background: var(--blue-deep);
  color: #dbeafe;
  font-size: 12px;
}

.topbar-inner,
.nav-inner,
.ft-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 36px;
}

.topbar-left {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right { display: flex; gap: 14px; flex-shrink: 0; }
.topbar a { color: #fff; font-weight: 600; }
.topbar a:hover { color: #93c5fd; }

.navbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.navbar .nav-inner { min-height: 72px; gap: 18px; }
.logo img, .logo-mobile img { height: 40px; width: auto; }
.logo-mobile { display: none; }
.navbar-logo { display: none; }

.search {
  flex: 1;
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1.5px solid #bfdbfe;
  border-radius: 999px;
  padding: 0 6px 0 16px;
  min-height: 44px;
}

.search input[type="text"] {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--ink);
  width: auto;
  padding: 10px 8px;
}

.search-icon-btn,
.icon-btn,
.login-btn,
.btn-add-cart,
.btn-buy,
.btn-chat-icon,
.bank-tab,
.ft-wa-btn,
.pd-compare-btn {
  cursor: pointer;
}

.search-icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
}

.nav-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.icon-btn.cart-indicator::before {
  content: "";
  position: absolute;
  inset: 10px 11px 12px;
  background: var(--blue-deep);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M7 18a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm10 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4zM6.2 6l.4 2h13.1l-1.6 7.2a2 2 0 0 1-2 1.6H9a2 2 0 0 1-2-1.5L5 4H2V2h4.2l.2 1z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M7 18a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm10 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4zM6.2 6l.4 2h13.1l-1.6 7.2a2 2 0 0 1-2 1.6H9a2 2 0 0 1-2-1.5L5 4H2V2h4.2l.2 1z'/></svg>") center / contain no-repeat;
}

.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: var(--blue);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
}

.login-ico {
  width: 16px;
  height: 16px;
  background: #fff;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M12 12a5 5 0 1 0-5-5 5 5 0 0 0 5 5zm0 2c-4.4 0-8 2.2-8 5v1h16v-1c0-2.8-3.6-5-8-5z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M12 12a5 5 0 1 0-5-5 5 5 0 0 0 5 5zm0 2c-4.4 0-8 2.2-8 5v1h16v-1c0-2.8-3.6-5-8-5z'/></svg>") center / contain no-repeat;
}

.mega-cats-wrapper { position: relative; width: 100%; }
.mega-cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 12px;
  scrollbar-width: none;
}
.mega-cats::-webkit-scrollbar { display: none; }
.mega-cats a {
  flex: 0 0 auto;
  background: var(--blue-soft);
  color: var(--blue-deep);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}
.mega-cats a:hover { background: var(--blue); color: #fff; }

.product-single { padding: 18px 0 48px; }
.pd-breadcrumb {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 14px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pd-breadcrumb a { color: var(--blue); font-weight: 600; }

.pd-top-layout {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.pd-media-card,
.pd-info-card,
.pd-side-card,
.pd-related-card,
.site-footer {
  background: var(--card);
}

.pd-media-card,
.pd-info-card,
.pd-side-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.pd-main-image {
  margin: 0;
  background: #f8fafc;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.pd-main-image img { width: 100%; height: 100%; object-fit: cover; }

.pd-mobile-slider-wrapper { display: none; }
.pd-thumb-gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.pd-thumb-btn {
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: #f8fafc;
  cursor: pointer;
}
.pd-thumb-btn.active,
.pd-thumb-btn:hover { border-color: var(--blue); }
.pd-thumb-btn img { width: 100%; aspect-ratio: 1; object-fit: cover; }

.pd-title {
  font-size: 22px;
  line-height: 1.35;
  margin: 0;
  color: var(--ink);
}
.pd-price-row, .pd-meta-row, .pd-meta-inline, .pd-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.pd-price-row { margin: 8px 0; }
.pd-price-current, .pd-sticky-price, .pd-related-card .final {
  color: var(--blue);
  font-size: 26px;
  font-weight: 800;
}
.pd-price-original, .pd-sticky-price-original, .pd-related-card .ori {
  color: #94a3b8;
  text-decoration: line-through;
  font-size: 14px;
}
.pd-discount-badge, .pd-sticky-discount, .mini-disc {
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 800;
}
.sold-inline, .sku, .sold { color: var(--muted); font-size: 13px; }
.pd-short-desc { color: #334155; font-size: 14px; }
.pd-short-desc ul { padding-left: 18px; }

.pd-sidebar { display: flex; flex-direction: column; gap: 12px; }
.qty-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
#qty {
  width: 88px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.pd-actions { margin-top: 12px; }
.btn-add-cart, .btn-buy, .pd-sticky-btn {
  border: 0;
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 800;
  color: #fff;
}
.btn-add-cart, .pd-sticky-btn-cart { background: #1e40af; }
.btn-buy, .pd-sticky-btn-buy { background: var(--blue-2); }
.btn-add-cart:disabled, .btn-buy:disabled, .pd-sticky-btn:disabled {
  background: #cbd5e1;
  color: #475569;
  cursor: not-allowed;
}
.btn-chat-icon, .pd-sticky-btn-chat {
  width: 44px;
  height: 44px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
}
.btn-chat-icon svg, .pd-sticky-btn-chat svg { width: 20px; height: 20px; }
.pd-compare-btn {
  border: 1px solid var(--blue);
  background: #fff;
  color: var(--blue);
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
}

.pd-related-full {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 0;
}
.pd-related-title { margin: 0 0 12px; font-size: 20px; }
.pd-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.pd-related-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  color: inherit;
  box-shadow: var(--shadow);
}
.pd-related-card:hover { border-color: #93c5fd; }
.pd-related-card .thumb { position: relative; background: #f8fafc; }
.pd-related-card .thumb img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.mini-disc { position: absolute; top: 8px; left: 8px; }
.pd-related-card .info { padding: 12px; }
.pd-related-card h3 { margin: 0 0 4px; font-size: 16px; }
.pd-related-card .price { display: flex; gap: 8px; align-items: baseline; }
.pd-related-card .final { font-size: 16px; }

.site-footer { margin-top: 36px; border-top: 4px solid var(--blue); }
.ft-top { padding: 28px 0 8px; }
.ft-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 24px;
}
.ft-title { margin: 0 0 8px; color: var(--blue-deep); }
.ft-desc, .ft-links, .ft-address { color: #475569; font-size: 14px; }
.ft-links { list-style: none; margin: 0; padding: 0; }
.ft-links a { color: #334155; }
.ft-links a:hover { color: var(--blue); }
.ft-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #16a34a;
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
}
.ft-social { display: flex; gap: 10px; }
.ft-social a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue-deep);
}
.ft-payments .pay-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ft-payments img { height: 22px; width: auto; background: #fff; border-radius: 4px; }
.ft-bottom { background: var(--blue-deep); color: #dbeafe; }
.ft-bottom-inner { min-height: 52px; font-size: 13px; }
.ft-copy { display: flex; gap: 12px; flex-wrap: wrap; }
.ft-expand-btn { display: none; }

.bottom-nav { display: none; }
.pd-sticky-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--line);
  transform: translateY(-110%);
  transition: transform .2s ease;
}
.pd-sticky-header.visible { transform: translateY(0); }
.pd-sticky-header-container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
}
.pd-sticky-thumb img { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; }
.pd-sticky-info { flex: 1; min-width: 0; }
.pd-sticky-title { margin: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-sticky-actions { display: flex; gap: 8px; align-items: center; }
.pd-mobile-fab { display: none; }

.compare-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 100%);
  height: 100%;
  background: #fff;
  z-index: 80;
  transform: translateX(105%);
  box-shadow: -12px 0 30px rgba(15, 23, 42, .15);
  display: flex;
  flex-direction: column;
}
.compare-sidebar.open, .compare-sidebar.active, .compare-sidebar.show { transform: translateX(0); }
.compare-header, .compare-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px; border-bottom: 1px solid var(--line); }
.compare-content { padding: 16px; overflow: auto; }
.btn-primary { background: var(--blue); color: #fff; border: 0; border-radius: 8px; padding: 8px 12px; }
.btn-outline-danger { background: #fff; color: var(--blue); border: 1px solid var(--blue); border-radius: 8px; padding: 8px 12px; }

.bank-tab {
  border: 1px solid #bfdbfe;
  background: #fff;
  color: var(--blue-deep);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}
.bank-tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.inst-head h3 { margin: 0 0 10px; font-size: 16px; }
.inst-bank-tabs { display: flex; flex-wrap: wrap; gap: 6px; }

@media (max-width: 980px) {
  .pd-top-layout { grid-template-columns: 1fr; }
  .pd-related-grid { grid-template-columns: 1fr 1fr; }
  .ft-grid { grid-template-columns: 1fr; }
  .logo { display: none; }
  .navbar-logo, .logo-mobile { display: block; }
  .navbar > .nav-inner .search,
  .nav-actions { display: none; }
  .topbar { display: none; }
  .bottom-nav {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-top: 1px solid var(--line);
    z-index: 60;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav-inner { display: grid; grid-template-columns: repeat(5, 1fr); }
  .bottom-nav-item {
    border: 0;
    background: transparent;
    color: #64748b;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 2px 10px;
    font-size: 11px;
    text-decoration: none;
  }
  .bottom-nav-item-icon { position: relative; width: 24px; height: 24px; }
  .bottom-nav-item-icon svg { width: 24px; height: 24px; }
  .icon-filled { display: none; }
  .bottom-nav-item-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--blue);
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    min-width: 16px;
    text-align: center;
  }
  .pd-main-image, .pd-thumb-gallery { display: none; }
  .pd-mobile-slider-wrapper { display: block; position: relative; }
  .pd-mobile-slider { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
  .pd-mslide { min-width: 100%; scroll-snap-align: start; }
  .pd-mslide img { width: 100%; aspect-ratio: 1; object-fit: cover; }
  .pd-gallery-counter {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: rgba(11, 31, 77, .8);
    color: #fff;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
  }
  .pd-mobile-fab {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 64px;
    background: #fff;
    border-top: 1px solid var(--line);
    z-index: 55;
    padding: 8px 12px;
  }
  .mf-actions { display: flex; gap: 8px; }
  .mf-btn { border-radius: 10px; font-weight: 800; }
  .mf-share { background: #fff; color: var(--blue); border: 2px solid var(--blue); width: 44px; }
  .bottom-nav { display: none; }
  .pd-mobile-fab { bottom: 92px; }
  body { padding-bottom: 150px; }
  .chat-widget { bottom: 132px; }
}
