@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500;700&display=swap');

/* ============ Design Tokens ============ */
:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --panel-raised: #eef1f4;
  --accent: #4a7fb5;
  --accent-dim: #3a6690;
  --steel: #6b8caa;
  --text: #1c1f22;
  --text-muted: #6b7280;
  --danger: #c1440e;
  --border: #e2e5e9;
  --radius: 4px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============ Reset & Base ============ */
*, *::before, *::after { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ============ Hazard Strip ============ */
.hazard-strip {
  height: 3px;
  width: 100%;
  background: var(--accent);
}

/* ============ Top Bar (legacy, kept for backward compat) ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.brand-mark {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}
.brand-mark span { color: var(--accent); }

.nav-link {
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--accent); }

.search-form { flex: 1; max-width: 420px; margin: 0 32px; }
.search-form input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
}
.search-form input:focus { outline: none; border-color: var(--accent); }

/* ============ Shop Layout ============ */
.shop-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 60px;
}
@media (max-width: 860px) {
  .shop-layout { grid-template-columns: 1fr; }
  .shop-layout > .filter-panel { display: none; }
}
@media (max-width: 480px) {
  .shop-layout { padding: 0 16px 40px; gap: 20px; }
}

/* ============ Filter Sidebar ============ */
.filter-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  align-self: start;
  position: sticky;
  top: 80px;
}
.filter-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.filter-title:not(:first-child) {
  margin-top: 24px;
}
.filter-list { list-style: none; padding: 0; margin: 0 0 24px; }
.filter-list li { margin-bottom: 2px; }
.filter-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 13.5px;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
.filter-list a:hover { background: var(--panel-raised); color: var(--text); }
.filter-list a.active {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
}
.filter-list a.active::after {
  content: '→';
  font-size: 12px;
  opacity: 0.7;
}

.price-filter { display: flex; flex-direction: column; gap: 10px; }
.price-filter input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 12px;
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  transition: border-color 0.15s;
}
.price-filter input:focus { outline: none; border-color: var(--accent); }
.price-filter input::placeholder { color: var(--text-muted); opacity: 0.6; }
.price-filter button {
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  padding: 10px;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s;
}
.price-filter button:hover { background: var(--accent-dim); }

/* ============ Grid Header ============ */
.grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.grid-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
}
.grid-count strong {
  color: var(--text);
  font-weight: 700;
}
.sort-select {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: border-color 0.15s;
}
.sort-select:focus { outline: none; border-color: var(--accent); }

/* ============ Product Grid ============ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

/* ============ Product Card ============ */
.product-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.25s var(--ease-out);
}
.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease-out);
  z-index: 1;
}
.product-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(74, 127, 181, 0.1);
}
.product-card:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

.product-card__image {
  aspect-ratio: 1 / 1;
  background: var(--panel-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.product-card__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.03) 100%);
  pointer-events: none;
}
.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease-out);
}
.product-card:hover .product-card__image img { transform: scale(1.08); }

.product-card__image .no-image {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.5;
}

.product-card__body {
  padding: 16px 18px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.product-card__category {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--steel);
  margin: 0 0 8px;
}
.product-card__name {
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 12px;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card__footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.product-card__price {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
}
.product-card__stock {
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}
.product-card__stock.in {
  background: rgba(74, 127, 181, 0.1);
  color: #2c5c86;
}
.product-card__stock.out {
  background: rgba(193, 68, 14, 0.08);
  color: #b03d0f;
}

/* ============ Empty State ============ */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.empty-state__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  opacity: 0.3;
}
.empty-state__text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  margin: 0;
}

/* ============ Pagination ============ */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.pagination a, .pagination span {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  font-weight: 700;
}

/* ============ Product Detail ============ */
.page-hero--compact {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 24px 0;
}
.page-hero--compact .page-hero__title {
  font-family: 'Oswald', sans-serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}
.product-detail {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  animation: detail-fade-in 0.5s var(--ease-out);
}
@media (max-width: 760px) {
  .product-detail { grid-template-columns: 1fr; gap: 28px; padding: 0 16px 40px; }
}

@keyframes detail-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -- Image -- */
.detail-image {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: sticky;
  top: 80px;
  cursor: zoom-in;
}
.detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s var(--ease-out);
  transform-origin: center;
}
.detail-image.zoomed { cursor: zoom-out; }
.detail-image.zoomed img { transform: scale(2); }

.detail-image .no-image {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.4;
}

/* -- Info -- */
.detail-info { padding-top: 4px; }

.detail-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steel);
  margin: 0 0 10px;
}
.detail-title {
  font-family: 'Oswald', sans-serif;
  font-size: 32px;
  font-weight: 600;
  margin: 0 0 18px;
  line-height: 1.25;
  color: var(--text);
}

/* -- Price -- */
.detail-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.detail-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.detail-price-unit {
  font-size: 13px;
  color: var(--text-muted);
}
.detail-price-compare {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  color: var(--text-muted);
  text-decoration: line-through;
  opacity: 0.6;
}
.detail-discount-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--danger);
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

/* -- Stock -- */
.detail-stock {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 24px;
}
.detail-stock::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.detail-stock.in {
  background: rgba(74, 127, 181, 0.1);
  color: #2c5c86;
}
.detail-stock.out {
  background: rgba(193, 68, 14, 0.08);
  color: #b03d0f;
}

/* -- Description -- */
.detail-description {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.8;
  margin-bottom: 28px;
  white-space: pre-line;
}

.rich-content { white-space: normal; }
.rich-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13.5px;
}
.rich-content th, .rich-content td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: right;
}
.rich-content th {
  background: var(--panel-raised);
  color: var(--text);
  font-weight: 600;
}
.rich-content td { color: var(--text-muted); }
.rich-content p { margin: 0 0 12px; }
.rich-content ul, .rich-content ol { margin: 0 0 12px; padding-right: 20px; }

/* ============ Buttons ============ */
.btn-primary {
  position: relative;
  overflow: hidden;
  padding: 14px 30px;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  width: 100%;
  margin-top: 24px;
}
.btn-primary:hover { background: var(--accent-dim); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}
.btn-primary.added {
  background: #2f8f5b;
}
.btn-primary--full {
  width: 100%;
  margin-top: 24px;
  display: block;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}
.btn-primary--inline {
  display: inline-block;
  width: auto;
  text-decoration: none;
}

.btn-outline {
  padding: 14px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ============ Quantity Selector ============ */
.qty-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.qty-selector {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.qty-selector button {
  width: 42px;
  height: 46px;
  background: var(--panel-raised);
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-selector button:hover:not(:disabled) {
  background: var(--accent);
  color: #ffffff;
}
.qty-selector button:disabled { opacity: 0.3; cursor: not-allowed; }
.qty-selector input {
  width: 54px;
  height: 46px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  background: var(--panel);
}
.qty-selector input:focus { outline: none; }

.qty-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 18px;
  background: var(--panel-raised);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}
.qty-total-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.qty-total-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  transition: transform 0.15s;
}
.qty-total-value.bump { transform: scale(1.1); }
.qty-total-unit { font-size: 12px; color: var(--text-muted); }

/* ============ Spec Table ============ */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 28px;
  font-size: 13.5px;
}
.spec-table tr { border-bottom: 1px solid var(--border); }
.spec-table tr:last-child { border-bottom: none; }
.spec-table th {
  text-align: right;
  padding: 11px 14px 11px 0;
  color: var(--text-muted);
  font-weight: 500;
  width: 40%;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.spec-table td {
  padding: 11px 0;
  color: var(--text);
  font-weight: 500;
}
.spec-table tr:nth-child(even) { background: rgba(238, 241, 244, 0.4); }

/* ============ Related Section ============ */
.related-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 60px;
}
.related-section .section-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 40px;
}
.related-title {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.related-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============ Category Page ============ */
.category-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============ Breadcrumb ============ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding: 12px 0;
}
.breadcrumb a { color: var(--text-muted); transition: color 0.15s; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--border); font-size: 11px; }
.breadcrumb-current { color: var(--text); font-weight: 600; }

/* ============ Category Header ============ */
.category-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.category-title {
  font-family: 'Oswald', sans-serif;
  font-size: 28px;
  font-weight: 600;
  margin: 0;
}

/* ============ Subcategory Chips ============ */
.subcategory-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.chip {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--panel);
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s;
}
.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(74, 127, 181, 0.06);
  transform: translateY(-1px);
}

/* ============ Category Index ============ */
.category-index {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.category-index-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.25s var(--ease-out);
}
.category-index-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s var(--ease-out);
}
.category-index-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(74, 127, 181, 0.1);
}
.category-index-card:hover::before {
  transform: scaleY(1);
}
.category-index-card:hover .category-index-card__arrow {
  transform: translateX(3px);
  color: var(--accent);
}

/* Card head: icon + name/count + arrow */
.category-index-card__head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.category-index-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(74, 127, 181, 0.08);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 20px;
  flex-shrink: 0;
  transition: background 0.2s;
}
.category-index-card:hover .category-index-card__icon {
  background: rgba(74, 127, 181, 0.15);
}
.category-index-card__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.category-index-card__name {
  font-family: 'Oswald', sans-serif;
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
  line-height: 1.3;
}
.category-index-card__count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.category-index-card__arrow {
  flex-shrink: 0;
  color: var(--border);
  transition: color 0.2s, transform 0.2s;
}
.category-index-card__desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ============ Category Subchips ============ */
.category-index-card__subs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.subchip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--panel-raised);
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.02em;
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: #ffffff;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease-out);
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast--error { background: var(--danger); }

/* ============ Ripple ============ */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple-expand 0.5s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple-expand {
  to { transform: scale(1); opacity: 0; }
}

/* ============ Scroll Reveal ============ */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

/* ============ Utility Classes ============ */
.line-through { text-decoration: line-through; }

.no-image--muted {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
}

.errorlist {
  list-style: none;
  padding: 14px 18px;
  margin: 0 0 24px;
  background: rgba(193, 68, 14, 0.06);
  border: 1px solid rgba(193, 68, 14, 0.2);
  border-radius: var(--radius);
  font-size: 13.5px;
  color: var(--danger);
  line-height: 1.6;
}
.errorlist--success {
  background: rgba(47, 143, 91, 0.06);
  border-color: rgba(47, 143, 91, 0.2);
  color: #2f8f5b;
}

.field-hint {
  font-size: 12px;
  color: var(--danger);
  margin: 6px 0 0;
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 14px;
}
.section-label--mt { margin-top: 24px; }

/* ============ Mobile Refinements (320-430px) ============ */

/* --- Buttons: minimum touch targets --- */
@media (max-width: 480px) {
  .btn-primary,
  .btn-outline {
    min-height: 48px;
    font-size: 14px;
    padding: 12px 20px;
  }
  .btn-primary .ripple { width: 40px; height: 40px; }
  
  .product-card__actions { gap: 8px; }
  .product-card__btn { min-height: 44px; font-size: 13px; padding: 10px 14px; }
  
  .qty-selector button { width: 44px; height: 44px; font-size: 16px; }
  .qty-selector input { min-height: 44px; font-size: 16px; padding: 0 8px; width: 100%; }
}

/* --- Product grid: tighter --- */
@media (max-width: 480px) {
  .product-grid { gap: 12px; }
  .product-card { padding: 12px; }
  .product-card__image { aspect-ratio: 1; }
  .product-card__body { padding: 10px 8px; }
  .product-card__name { font-size: 13.5px; }
  .product-card__price { font-size: 13px; }
  .product-card__stock { font-size: 11px; }
}

/* --- Product detail: sticky image offset, form scaling --- */
@media (max-width: 480px) {
  .product-detail { gap: 20px; }
  .detail-image { top: 80px; }
  .detail-image__zoom { width: 44px; height: 44px; }
  .detail-price__current { font-size: 22px; }
  .detail-price__original { font-size: 13px; }
  .detail-stock { font-size: 12.5px; }
  .detail-qty { gap: 10px; }
  .detail-qty__label { font-size: 12px; }
  .detail-qty .qty-selector button { width: 44px; height: 44px; }
  .detail-qty .qty-selector input { height: 44px; font-size: 16px; width: 100%; }
  .detail-actions { flex-direction: column; gap: 10px; }
  .detail-actions .btn-primary,
  .detail-actions .btn-outline { width: 100%; min-height: 48px; }
  
  .spec-table { font-size: 12px; }
  .spec-table th,
  .spec-table td { padding: 8px 10px; }
}

/* --- Filter sidebar: touch targets --- */
@media (max-width: 480px) {
  .filter-panel { padding: 16px; }
  .filter-title { font-size: 14px; }
  .filter-list label { min-height: 44px; font-size: 13.5px; padding: 12px 12px; }
  .filter-list input[type="checkbox"] { width: 20px; height: 20px; }
  .price-filter__inputs { flex-direction: column; gap: 10px; }
  .price-filter__inputs input { width: 100%; min-height: 48px; font-size: 16px; }
  .sort-select { min-height: 48px; font-size: 16px; padding: 12px 12px; }
}

/* --- Category list / detail --- */
@media (max-width: 480px) {
  .category-index { padding: 0 16px 60px; gap: 12px; grid-template-columns: 1fr; }
  .category-index-card { padding: 16px; }
  .category-index-card__head { gap: 12px; }
  .category-index-card__icon { width: 44px; height: 44px; font-size: 18px; }
  .category-index-card__name { font-size: 15px; }
  .category-index-card__desc { font-size: 12.5px; }
  .category-index-card__arrow { width: 14px; height: 14px; }
  .subcategory-chips { gap: 8px; }
  .chip { min-height: 40px; padding: 0 14px; font-size: 12px; }
}

/* --- Breadcrumb --- */
@media (max-width: 480px) {
  .breadcrumb { overflow-x: auto; white-space: nowrap; padding-bottom: 4px; }
  .breadcrumb::-webkit-scrollbar { height: 4px; }
  .breadcrumb a,
  .breadcrumb span { font-size: 12px; }
}

/* --- Toast --- */
@media (max-width: 480px) {
  .toast { left: 12px; right: 12px; transform: translateX(0) translateY(20px); min-width: auto; max-width: calc(100% - 24px); padding: 14px 16px; font-size: 13px; }
  .toast.show { transform: translateX(0) translateY(0); }
}

/* --- Error list --- */
@media (max-width: 480px) {
  .errorlist { padding: 12px 14px; font-size: 12.5px; }
}

/* --- RTL specific for mobile --- */
@media (max-width: 480px) {
  [dir="rtl"] .product-grid { direction: rtl; }
  [dir="rtl"] .product-card__body { direction: rtl; text-align: right; }
  [dir="rtl"] .detail-info { direction: rtl; }
  [dir="rtl"] .detail-actions { direction: rtl; }
  [dir="rtl"] .filter-panel { direction: rtl; }
  [dir="rtl"] .filter-list label { text-align: right; }
  [dir="rtl"] .sort-select { text-align: right; }
  [dir="rtl"] .breadcrumb { direction: rtl; }
}

/* ============ Additional Mobile Refinements ============ */

/* --- Spec Table: Stack vertically on mobile --- */
@media (max-width: 480px) {
  .spec-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .spec-table th,
  .spec-table td {
    display: block;
    width: 100%;
    padding: 8px 10px;
    text-align: right;
  }
  .spec-table th {
    font-weight: 600;
    color: var(--text-muted);
    padding-bottom: 4px;
    border-bottom: none;
  }
  .spec-table td {
    border-bottom: 1px solid var(--border);
    padding-top: 4px;
  }
  .spec-table tr {
    display: block;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
  }
  .spec-table tr:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }
}

/* --- Qty Selector: Full width on mobile, RTL fix --- */
@media (max-width: 480px) {
  .qty-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .qty-selector {
    width: 100%;
    justify-content: center;
  }
  .qty-selector input {
    width: 100%;
    min-width: 0;
  }
  .qty-total {
    width: 100%;
    justify-content: center;
  }
}

/* RTL qty selector fix */
[dir="rtl"] .qty-row {
  direction: rtl;
}
[dir="rtl"] .qty-selector {
  direction: rtl;
}
[dir="rtl"] .qty-selector input {
  text-align: center;
}

/* OTP inputs stay LTR */
[dir="rtl"] .otp-row {
  direction: ltr;
}

/* --- Product Detail: Better mobile layout --- */
@media (max-width: 480px) {
  .page-hero--compact { padding: 16px 16px 0; }
  .page-hero--compact .page-hero__title { font-size: clamp(20px, 5vw, 24px); }
  .product-detail {
    padding: 0 16px 40px;
    gap: 24px;
  }
  .detail-image {
    position: relative;
    top: 0;
    max-height: 350px;
  }
  .detail-title {
    font-size: clamp(24px, 6vw, 28px);
  }
  .detail-price {
    font-size: clamp(24px, 7vw, 28px);
  }
  .detail-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .detail-actions .btn-primary,
  .detail-actions .btn-outline {
    width: 100%;
    min-height: 48px;
  }
}

/* --- Product Card: Mobile refinements --- */
@media (max-width: 480px) {
  .product-card {
    padding: 0;
  }
  .product-card__body {
    padding: 12px;
  }
  .product-card__name {
    font-size: 14px;
    -webkit-line-clamp: 2;
  }
  .product-card__footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-top: 10px;
  }
  .product-card__price {
    font-size: 14px;
  }
}

/* --- Filter sidebar: Better mobile --- */
@media (max-width: 480px) {
  .filter-panel {
    padding: 16px;
  }
  .filter-title {
    font-size: 14px;
  }
  .filter-list a {
    min-height: 44px;
    padding: 12px 14px;
    font-size: 14px;
  }
  .price-filter__inputs {
    flex-direction: column;
    gap: 10px;
  }
  .price-filter__inputs input {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
  }
  .price-filter button {
    min-height: 48px;
    font-size: 13px;
    padding: 12px;
  }
  .sort-select {
    min-height: 48px;
    font-size: 16px;
    padding: 12px 14px;
  }
}

/* --- Subcategory chips: Touch targets --- */
@media (max-width: 480px) {
  .subcategory-chips {
    gap: 8px;
  }
  .chip {
    min-height: 40px;
    padding: 0 14px;
    font-size: 12px;
  }
}

/* --- Category index cards --- */
@media (max-width: 480px) {
  .category-index {
    gap: 12px;
  }
  .category-index-card {
    padding: 18px 14px;
  }
  .category-index-card__name {
    font-size: 14px;
  }
  .category-index-card__count {
    font-size: 10px;
    padding: 2px 8px;
  }
}

/* --- Category header --- */
@media (max-width: 480px) {
  .category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .category-title {
    font-size: clamp(22px, 6vw, 26px);
  }
  .subcategory-chips {
    width: 100%;
  }
}

/* --- Shop layout: Better mobile --- */
@media (max-width: 480px) {
  .shop-layout {
    padding: 0 16px 40px;
    gap: 20px;
  }
  .grid-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .sort-select {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
    padding: 12px 14px;
  }
}

/* --- Product grid --- */
@media (max-width: 480px) {
  .product-grid {
    gap: 12px;
    grid-template-columns: 1fr;
  }
}

/* --- Qty selector full width --- */
@media (max-width: 480px) {
  .qty-selector {
    width: 100%;
  }
  .qty-selector button {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }
  .qty-selector input {
    width: 100%;
    min-width: 0;
    height: 48px;
    font-size: 16px;
  }
}

/* --- Shop layout fluid gap on desktop --- */
@media (min-width: 861px) {
  .shop-layout {
    grid-template-columns: 260px 1fr;
    gap: 28px;
  }
}

/* --- Hover guards for touch devices --- */
@media (hover: none) and (pointer: coarse) {
  .product-card:hover,
  .category-index-card:hover,
  .value-card:hover,
  .btn-primary:hover,
  .btn-outline:hover,
  .filter-list a:hover,
  .chip:hover,
  .btn-primary--execute:hover,
  .btn-primary--spec:hover,
  .payment-bank-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border);
    background: var(--panel);
  }
  .product-card:hover::before,
  .category-index-card:hover::after,
  .value-card:hover::after {
    transform: none;
  }
  .product-card:hover .product-card__image img {
    transform: none;
  }
}

/* --- Shop layout sticky sidebar offset --- */
.filter-panel {
  top: 80px;
}

/* --- Detail image zoom cursor --- */
.detail-image {
  cursor: zoom-in;
}

/* ============ RTL Fixes ============ */

/* RTL filter arrow */
[dir="rtl"] .filter-list a.active::after {
  content: '←';
}

/* RTL subcategory chips */
[dir="rtl"] .subcategory-chips {
  direction: rtl;
}

/* RTL category index */
[dir="rtl"] .category-index-card__head {
  direction: rtl;
}
[dir="rtl"] .category-index-card:hover .category-index-card__arrow {
  transform: translateX(-3px);
}
[dir="rtl"] .category-index-card__arrow {
  transform: scaleX(-1);
}
[dir="rtl"] .category-index-card:hover .category-index-card__arrow {
  transform: scaleX(-1) translateX(-3px);
}

/* RTL spec table */
[dir="rtl"] .spec-table th,
[dir="rtl"] .spec-table td {
  text-align: right;
}

/* RTL detail actions */
[dir="rtl"] .detail-actions {
  direction: rtl;
}

/* RTL price filter */
[dir="rtl"] .price-filter__inputs {
  direction: rtl;
}

/* RTL qty selector */
[dir="rtl"] .qty-selector {
  direction: rtl;
}

/* RTL qty selector input */
[dir="rtl"] .qty-selector input {
  text-align: center;
}

/* OTP inputs stay LTR */
[dir="rtl"] .otp-row {
  direction: ltr;
}

/* RTL breadcrumb */
[dir="rtl"] .breadcrumb {
  direction: rtl;
}

/* RTL pagination */
[dir="rtl"] .pagination {
  direction: rtl;
}

/* RTL related section */
[dir="rtl"] .related-title::after {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-right: 12px;
}

/* Mobile Filter Drawer - hidden on desktop */
.filter-drawer,
.filter-overlay {
  display: none;
}

/* Show mobile filter only on small screens */
@media (max-width: 768px) {
  .filter-drawer {
    display: block;
  }

  .filter-overlay {
    display: block;
  }
}
