/* ===== Tokens ===== */
:root {
  --ink: #1C2B33;
  --ink-soft: #5B6B73;
  --paper: #F7F6F2;
  --paper-dim: #EFEBE3;
  --line: #DEDCD5;
  --copper: #C97A3D;
  --copper-dark: #9A5524;
  --copper-deep: #7F441C;
  --clay: #B5483D;
  --success: #2E7D5B;
  --ring: 0 0 0 3px rgba(201,122,61,0.28);
  --steel: #5B7A8C;
  --steel-dark: #3F5C6C;
  --whatsapp: var(--success);
  --white: #FFFFFF;
  --charcoal: #1C1F22;
  --porcelain: #F5F2EC;
  --brass: #B08D57;
  --brass-light: #D4B483;
  --radius: 10px;
  --radius-panel: 18px;
  --accent-soft: #F4E9DD;
  --shadow: 0 2px 4px rgba(28,43,51,0.03), 0 8px 24px rgba(28,43,51,0.05);
  --shadow-raised: 0 12px 32px rgba(28,43,51,0.11);
  --font-display: 'Vazirmatn', 'Tahoma', sans-serif;
  --font-body: 'Vazirmatn', 'Tahoma', sans-serif;
  --font-mono: 'Vazirmatn', 'SF Mono', 'Consolas', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  direction: rtl;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== Header ===== */
.site-header {
  background: var(--ink);
  color: var(--paper);
  padding: 14px 20px 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 40;
}

.header-row {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  padding-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand-mark { color: var(--copper); font-size: 1.2em; }

.search-form {
  flex: 1;
  min-width: 120px;
  max-width: 380px;
  display: flex;
}
.search-form input {
  width: 100%;
  padding: 9px 13px;
  border: none;
  border-radius: var(--radius);
  background: rgba(244,241,234,0.12);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 0.92rem;
  box-sizing: border-box;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.search-form input::placeholder { color: rgba(244,241,234,0.45); }
.search-form input:focus {
  outline: none;
  background: rgba(244,241,234,0.2);
  color: var(--paper);
  box-shadow: 0 0 0 2px var(--copper);
}

/* ===== Header actions ===== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.login-btn {
  padding: 7px 14px;
  border-radius: var(--radius);
  background: rgba(244,241,234,0.1);
  border: 1px solid rgba(244,241,234,0.2);
  color: var(--paper);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}
.login-btn:hover { background: rgba(244,241,234,0.18); }

.cart-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--paper);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--radius);
  background: rgba(244,241,234,0.1);
  border: 1px solid rgba(244,241,234,0.2);
  transition: background 0.15s ease;
  text-decoration: none;
  flex-shrink: 0;
}
.cart-link:hover { background: rgba(244,241,234,0.18); }

/* ===== User dropdown ===== */
.user-dropdown { position: relative; }

.user-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: var(--radius);
  background: rgba(244,241,234,0.1);
  border: 1px solid rgba(244,241,234,0.2);
  color: var(--paper);
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.user-btn:hover { background: rgba(244,241,234,0.18); }
.user-icon { font-size: 1rem; }

.user-menu {
  display: none;
  position: fixed;
  min-width: 160px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(28,43,51,0.15);
  z-index: 9999;
  overflow: hidden;
}
.user-dropdown.open .user-menu { display: block; }

.user-menu-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--ink);
  text-decoration: none;
  border: none;
  background: none;
  font-family: var(--font-body);
  text-align: right;
  cursor: pointer;
  border-bottom: 1px solid var(--paper-dim);
  transition: background 0.1s ease;
}
.user-menu-item:last-child { border-bottom: none; }
.user-menu-item:hover { background: var(--paper); }
.user-menu-logout { color: var(--clay); }

/* ===== Home layout with sidebar ===== */
.home-layout {
  margin: 0 auto;
  padding: 24px 20px 70px;
  padding-top: 5rem !important;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

/* ===== Filter sidebar ===== */
.filter-sidebar {
  position: sticky;
  top: 80px;
}

.filter-sidebar-box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-y: auto;
  max-height: calc(100vh - 100px);
}

.sidebar-filter-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.sidebar-filter-section:last-child { border-bottom: none; }

.sidebar-filter-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.sidebar-filter-option {
  display: block;
  padding: 7px 10px;
  font-size: 0.88rem;
  color: var(--ink);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
  margin-bottom: 2px;
}
.sidebar-filter-option:hover { background: var(--paper-dim); }
.sidebar-filter-option.active {
  background: rgba(201,122,61,0.1);
  color: var(--copper-dark);
  font-weight: 700;
}

/* price inside sidebar */
.sidebar-price-vals {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.sidebar-price-val-box {
  flex: 1;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.sidebar-price-val-label { font-size: 0.66rem; color: var(--ink-soft); }
.sidebar-price-val-box span:nth-child(2) { font-size: 0.78rem; font-weight: 700; color: var(--copper-dark); width: 100%; text-align: center; }
.sidebar-price-val-unit { font-size: 0.66rem; color: var(--ink-soft); }

.sidebar-price-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}

.filter-menu-price {
  width: 200px;
  min-width: 200px;
  max-width: 200px;
  max-height: none;
  overflow: visible;
  position: fixed !important;
  touch-action: none;
}

.price-menu-inner {
  padding: 16px;
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.price-menu-vals {
  display: flex;
  gap: 8px;
  width: 100%;
  flex-shrink: 0;
}

.price-menu-val-box {
  flex: 1;
  min-width: 0;
  height: 54px;
  flex-shrink: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  overflow: hidden;
}
.price-menu-val-label { font-size: 0.66rem; color: var(--ink-soft); white-space: nowrap; }
.price-menu-val-box span:nth-child(2) {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--copper-dark);
  white-space: nowrap;
  width: 100%;
  text-align: center;
}
.price-menu-val-unit { font-size: 0.66rem; color: var(--ink-soft); white-space: nowrap; }

/* ===== Vertical slider ===== */
.price-slider-wrap {
  position: relative;
  height: 160px;
  width: 36px;
  margin: 0 auto;
  user-select: none;
  touch-action: none;
}

.price-track {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  background: var(--line);
  border-radius: 4px;
}

.price-track-fill {
  position: absolute;
  left: 0;
  right: 0;
  background: var(--copper);
  border-radius: 4px;
}

.price-thumb {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--copper);
  border: 3px solid var(--white);
  box-shadow: 0 1px 5px rgba(28,43,51,0.25);
  cursor: grab;
  z-index: 3;
  transition: box-shadow 0.1s ease;
}
.price-thumb:active { cursor: grabbing; box-shadow: 0 0 0 5px rgba(201,122,61,0.18); }

.price-menu-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.price-apply-btn {
  flex: 1;
  background: var(--copper-dark);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 8px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.price-apply-btn:hover { background: var(--copper-deep); }

.price-reset-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--clay);
  background: rgba(181,72,61,0.08);
  border: 1px solid rgba(181,72,61,0.25);
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.price-reset-btn:hover { background: rgba(181,72,61,0.16); }

/* ===== Main ===== */
main {
  min-width: 0;
  padding: 0;
}

.results-meta { font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 16px; }

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

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-panel);
}
@media (hover: hover) {
  .card:hover { transform: translateY(-4px); box-shadow: var(--shadow-raised); border-color: var(--copper); }
}

.card-photo {
  width: 100%;
  aspect-ratio: 1/1;
  background: var(--white);
  padding: 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.card-photo img { width: 100%; height: 100%; object-fit: contain; }
.card-photo .no-photo { font-size: 0.7rem; color: var(--ink-soft); }

.card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; gap: 10px; }

.card-category {
  font-size: 0.7rem;
  color: var(--steel-dark);
  background: rgba(91,122,140,0.1);
  border-radius: 4px;
  padding: 2px 7px;
  width: fit-content;
}
.card-brand {
  font-size: 0.7rem;
  color: var(--copper-dark);
  background: rgba(201,122,61,0.1);
  border-radius: 4px;
  padding: 2px 7px;
  width: fit-content;
}
.card-name { font-weight: 700; font-size: 0.95rem; line-height: 1.8; }
.card-price {
  margin-top: auto;
  padding-top: 8px;
  font-weight: 700;
  color: var(--copper-dark);
  font-size: 0.95rem;
}
.card-price .unit { font-size: 0.7rem; color: var(--ink-soft); font-weight: 400; margin-inline-start: 3px; }

/* ===== Empty ===== */
.empty-state, .not-found {
  text-align: center;
  padding: 80px 20px;
  color: var(--ink-soft);
}
.empty-tag { font-size: 0.75rem; color: var(--copper-dark); margin-bottom: 6px; }
.empty-state h2, .not-found h2 { font-weight: 700; margin: 0 0 8px; color: var(--ink); }

/* ===== Item detail page ===== */
.item-page { max-width: 1000px; margin: 0 auto; padding-top:5rem !important; padding: 24px 20px 110px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--steel-dark);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.item-photo-wrap {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.item-photo-wrap img { width: 100%; height: 100%; object-fit: contain; }
.item-photo-wrap .no-photo { color: var(--ink-soft); font-size: 0.85rem; }

.item-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.item-category {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--steel-dark);
  background: rgba(91,122,140,0.1);
  border-radius: 4px;
  padding: 3px 9px;
}
.item-brand {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--copper-dark);
  background: rgba(201,122,61,0.1);
  border-radius: 4px;
  padding: 3px 9px;
}

.item-name { font-size: 1.5rem; font-weight: 700; margin: 0 0 8px; line-height: 1.4; }
.item-price { font-size: 1.4rem; font-weight: 700; color: var(--copper-dark); margin-bottom: 18px; }
.item-price .unit { font-size: 0.85rem; color: var(--ink-soft); font-weight: 400; }

.item-notes {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.item-notes-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  padding: 12px 16px 6px;
}
.item-notes-text {
  margin: 0;
  padding: 0 16px 16px;
  line-height: 1.8;
  color: var(--ink-soft);
  white-space: pre-wrap;
  text-align: right;
  direction: rtl;
}

/* table sits flush inside the notes box */
.item-features-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0;
}
.item-features-table tr {
  border-bottom: 1px solid var(--line);
}
.item-features-table tr:last-child {
  border-bottom: 1px solid var(--line);
}
.item-feature-name {
  padding: 9px 16px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--paper);
  width: 40%;
  vertical-align: top;
  text-align: right;
}
.item-feature-value {
  padding: 9px 16px;
  color: var(--ink);
  background: var(--white);
  vertical-align: top;
  text-align: right;
}

/* ===== Add to cart ===== */
.item-action { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }

.add-to-cart-btn {
  width: 100%;
  padding: 16px;
  background: var(--copper-dark);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.add-to-cart-btn:hover { background: var(--copper-deep); }

.go-to-cart-btn {
  display: block;
  text-align: center;
  padding: 12px;
  border: 1px solid var(--copper);
  border-radius: var(--radius);
  color: var(--copper-dark);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s ease;
}
.go-to-cart-btn:hover { background: rgba(201,122,61,0.06); }

.unavailable-badge {
  width: 100%;
  padding: 16px;
  background: var(--paper-dim);
  color: var(--clay);
  border: 1px solid rgba(181,72,61,0.2);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
}

/* ===== Contact bar ===== */
.contact-bar {
  position: fixed;
  bottom: 0; right: 0; left: 0;
  background: var(--white);
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(28,43,51,0.08);
  padding: 12px 20px;
  display: flex;
  gap: 10px;
  z-index: 40;
}
.contact-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px 10px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.88rem;
  border: 1px solid transparent;
}
.contact-btn.phone { background: var(--ink); color: var(--paper); }
.contact-btn.whatsapp { background: var(--whatsapp); color: var(--white); }
.contact-btn.telegram { background: var(--steel); color: var(--white); }

/* ===== Footer ===== */
.site-footer {
  background: var(--charcoal);
  color: var(--porcelain);
  margin-top: 24px;
  direction: rtl;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: none;
}
.footer-brand-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--porcelain);
}
.footer-brand-name .brand-mark {
  color: var(--brass-light);
  font-size: 1.2em;
}
.footer-tagline {
  margin: 4px 0 0;
  color: rgba(245,242,236,0.55);
  font-size: 0.85rem;
}
.footer-address {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 14px;
  font-size: 0.82rem;
  color: rgba(245,242,236,0.7);
  line-height: 1.6;
}
.footer-map-link {
  display: block;
  margin-top: 50px !important;
  text-decoration: none;
}
.footer-map {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  width: 220px;
}
.footer-map-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(28,31,34,0.7);
  color: var(--porcelain);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.footer-map-link:hover .footer-map-overlay {
  background: rgba(201,122,61,0.85);
}
.footer-contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 180px;
}
.footer-contact-title {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(245,242,236,0.6);
  width: 100%;
  text-align: center;
}
.footer-contact-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  width: 100%;
}
.footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--porcelain);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  transition: transform 0.12s ease, background 0.15s ease;
}
.footer-link:hover { transform: translateY(-2px); }
.footer-icon { display: flex; align-items: center; }
.footer-link-whatsapp:hover { background: #25D366; border-color: #25D366; }
.footer-link-telegram:hover { background: #2AA1DA; border-color: #2AA1DA; }
.footer-link-phone:hover { background: var(--brass); border-color: var(--brass); color: var(--charcoal); }
.footer-phone-number { direction: ltr; }
.footer-bottom {
  text-align: center;
  margin: 0;
  padding: 18px 20px 28px;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: rgba(245,242,236,0.45);
  font-size: 0.82rem;
}
@media (max-width: 640px) {
  .footer-inner { flex-direction: column; padding: 32px 16px 20px; gap: 24px; }
  .footer-contact-links { gap: 8px; }
  .footer-link { padding: 9px 13px; font-size: 0.82rem; }
  .footer-map { width: 100%; }
}

/* ===== Stock toggle (admin) ===== */
.stock-toggle-wrap { display: flex; align-items: center; }
.stock-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 2px solid;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.stock-toggle.in-stock { background: rgba(46,125,91,0.1); border-color: var(--success); color: var(--success); }
.stock-toggle.out-of-stock { background: rgba(181,72,61,0.1); border-color: var(--clay); color: var(--clay); }
.stock-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.in-stock .stock-dot { background: var(--success); }
.out-of-stock .stock-dot { background: var(--clay); }

/* ===== Stock badges (admin cards) ===== */
.stock-badge { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 2px; }
.stock-badge.in { background: rgba(46,125,91,0.1); color: var(--success); }
.stock-badge.out { background: rgba(181,72,61,0.1); color: var(--clay); }

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-size: 0.9rem;
  font-family: var(--font-body);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.page-btn:hover { background: var(--paper-dim); border-color: var(--copper); color: var(--copper-dark); }
.page-btn.active { background: var(--copper-dark); border-color: var(--copper-dark); color: var(--white); font-weight: 700; pointer-events: none; }
.page-dots { color: var(--ink-soft); padding: 0 4px; font-size: 0.9rem; }

/* ===== Auth pages ===== */
.auth-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
}
.auth-title { font-size: 1.3rem; font-weight: 700; margin: 0 0 6px; }
.auth-sub { color: var(--ink-soft); font-size: 0.9rem; margin: 0 0 24px; }
.auth-hint { color: var(--ink-soft); font-size: 0.88rem; margin-bottom: 16px; }
.auth-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  margin-bottom: 12px;
  box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: var(--copper); box-shadow: var(--ring); }
.auth-btn {
  width: 100%;
  padding: 13px;
  background: var(--copper-dark);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.auth-btn:hover { background: var(--copper-deep); }
.auth-back-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.88rem;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease;
}
.auth-back-btn:hover { background: var(--paper-dim); color: var(--ink); }
.auth-error { color: var(--clay); font-size: 0.85rem; margin-top: 8px; }
.auth-success { color: var(--success); font-size: 0.85rem; margin-top: 8px; }

/* ===== Profile page ===== */
.profile-page { max-width: 680px; margin: 0 auto; padding: 32px 20px 80px; }
.profile-title { font-size: 1.4rem; font-weight: 700; margin: 0 0 6px; }
.profile-phone { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 28px; }
.profile-form { display: flex; flex-direction: column; gap: 16px; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.profile-orders { margin-top: 48px; }
.profile-orders h2 { font-size: 1.1rem; margin-bottom: 16px; }
.profile-no-orders { color: var(--ink-soft); }
.logout-btn {
  margin-top: 32px;
  background: none;
  border: 1px solid var(--clay);
  color: var(--clay);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
}

/* ===== Cart page ===== */
.cart-page { max-width: 680px; margin: 0 auto; padding: 32px 20px 80px; }
.cart-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 24px; }
.cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item-photo {
  width: 72px; height: 72px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-dim);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.cart-item-photo img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.cart-item-name { font-weight: 700; font-size: 0.95rem; }
.cart-item-price { color: var(--copper-dark); font-size: 0.88rem; }
.cart-item-qty {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.95rem; font-weight: 700;
}
.cart-item-qty button {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.cart-item-qty button:hover { background: var(--paper-dim); border-color: var(--copper); }
.cart-item-remove {
  background: none; border: none;
  color: var(--clay); font-size: 1.2rem;
  cursor: pointer; padding: 4px 8px;
}
.cart-summary {
  margin-top: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.cart-total-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.cart-total-price { font-size: 1.2rem; font-weight: 700; color: var(--copper-dark); }
.cart-address { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 16px; line-height: 1.6; }
.cart-address-label { font-weight: 700; color: var(--ink); }
.cart-notice { font-size: 0.88rem; color: var(--clay); margin-bottom: 12px; }
.cart-notice a { color: var(--copper-dark); }
.checkout-btn {
  width: 100%;
  padding: 14px;
  background: var(--copper-dark);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.checkout-btn:hover:not(:disabled) { background: var(--copper-deep); }
.checkout-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== Order cards ===== */
.order-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.order-card-header {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 8px;
}
.order-id { font-size: 0.78rem; color: var(--ink-soft); font-family: var(--font-mono); }
.order-status { font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.order-status-paid { background: rgba(46,125,91,0.1); color: var(--success); }
.order-status-pending { background: rgba(201,122,61,0.1); color: var(--copper-dark); }
.order-status-failed { background: rgba(181,72,61,0.1); color: var(--clay); }
.order-total { font-weight: 700; margin-right: auto; }
.order-date { font-size: 0.78rem; color: var(--ink-soft); }
.order-address { font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 8px; }
.order-items { display: flex; flex-wrap: wrap; gap: 6px; }
.order-item-name { font-size: 0.78rem; background: var(--paper-dim); padding: 3px 8px; border-radius: 2px; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  main { padding: 16px 16px 80px; }
  .item-page { padding: 18px 16px 110px; }
  .footer-inner { padding: 32px 16px 20px; gap: 24px; }
  .footer-contact-links { gap: 8px; }
  .footer-link { padding: 9px 13px; font-size: 0.82rem; }
  .profile-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
}

/* ===== Accessibility ===== */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible,
.card:focus-visible, .filter-btn:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}
::selection { background: rgba(201,122,61,0.25); color: var(--ink); }
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--copper-dark); }
.logout-btn { transition: background 0.15s ease, color 0.15s ease; }
.logout-btn:hover { background: var(--clay); color: var(--white); }
.cart-item-remove { border-radius: var(--radius); transition: background 0.15s ease; }
.cart-item-remove:hover { background: rgba(181,72,61,0.08); }
.back-link { transition: color 0.15s ease; }
.back-link:hover { color: var(--copper-dark); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .card:hover, .footer-link:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .filter-btn, html { transition: none; scroll-behavior: auto; }
}

.cart-header-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}
.cart-header-row .cart-title {
  margin: 0;
}
.cart-header-row .back-link {
  margin-bottom: 0;
  white-space: nowrap;
}

/* ===== Profile overlay (login page step 3) ===== */
.profile-overlay {
  position: fixed;
  inset: 0;
  background: var(--paper);
  z-index: 999;
  overflow-y: auto;
}
.profile-overlay.hidden { display: none; }

/* ===== Form row label ===== */
.form-row label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

/* ===== Profile inputs ===== */
.profile-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--white);
  color: var(--ink);
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}
.profile-input:focus { outline: none; border-color: var(--copper); box-shadow: var(--ring); }

/* ===== Save bar ===== */
.save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: var(--charcoal);
  border-radius: var(--radius);
  margin-top: 8px;
}
.save-bar-text { color: var(--porcelain); font-size: 0.9rem; }
.save-bar-btn {
  background: var(--copper-dark);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 9px 20px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.save-bar-btn:hover { background: var(--copper-deep); }
.save-bar-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== Profile danger zone ===== */
.profile-danger { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }

/* ===== Orders page ===== */
.orders-page { max-width: 680px; margin: 0 auto; padding: 32px 20px 80px; }
/* ===== Item page two-column layout ===== */
.item-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.item-layout .item-photo-wrap {
  aspect-ratio: 1/1;
  margin-bottom: 0;
}

.item-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item-info .item-price { margin-bottom: 0; }
.item-info .item-name { margin: 0; }

/* ===== Address textarea ===== */
.profile-input[name="address"],
textarea.profile-input,
textarea.auth-input {
  resize: none;
  height: 90px;
  overflow-y: auto;
}

/* ===== Bigger dropdown arrows ===== */
.filter-arrow { font-size: 1rem !important; }

/* ===== Better cart/user icons ===== */
.cart-link svg { display: block; }

@media (max-width: 640px) {
  .item-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.payment-success-msg {
  background: rgba(46,125,91,0.1);
  color: var(--success);
  border: 1px solid rgba(46,125,91,0.3);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-weight: 600;
  margin-bottom: 20px;
}
.payment-failed-msg {
  background: rgba(181,72,61,0.1);
  color: var(--clay);
  border: 1px solid rgba(181,72,61,0.3);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-weight: 600;
  margin-bottom: 20px;
}

.card-unavailable {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--clay);
}

/* ===== Mobile responsive fixes ===== */
@media (max-width: 480px) {
  .header-row {
    gap: 8px;
  }

  .brand span:last-child {
    display: none;
  }

  .search-form {
    min-width: 0;
    max-width: none;
  }

  .item-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .item-photo-wrap {
    aspect-ratio: 4/3;
  }

  .cart-item {
    flex-wrap: wrap;
    gap: 10px;
  }

  .cart-item-qty {
    gap: 8px;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 24px 16px;
  }

  .order-card-header {
    gap: 8px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 20px;
  }

  .footer-contact-links {
    flex-direction: column;
    gap: 8px;
  }

  .footer-link {
    width: 100%;
    justify-content: center;
  }

  .price-menu-inner {
    padding: 12px;
  }

  .header-actions {
    gap: 6px;
  }

  .login-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .cart-link {
    padding: 6px 10px;
  }
}

/* ===== Footer address & map ===== */
.footer-address {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 14px;
  font-size: 0.82rem;
  color: rgba(245,242,236,0.7);
  line-height: 1.6;
  white-space: nowrap;
}

.footer-map-link {
  display: block;
  margin-top: 10px;
  text-decoration: none;
}

.footer-map {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  width: 220px;
}

.footer-map-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(28,31,34,0.7);
  color: var(--porcelain);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(2px);
}

.footer-map-link:hover .footer-map-overlay {
  background: rgba(201,122,61,0.85);
}

@media (max-width: 640px) {
  .footer-map { width: 100%; }
}
/* ===== Order status badges ===== */
.order-status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.status-pending     { background: rgba(201,122,61,0.12); color: var(--copper-dark); }
.status-preparing   { background: rgba(58,90,120,0.12);  color: var(--steel-dark); }
.status-shipping    { background: rgba(58,90,180,0.12);  color: #2A4CAA; }
.status-completed   { background: rgba(46,125,91,0.12);  color: var(--success); }
.status-failed      { background: rgba(181,72,61,0.12);  color: var(--clay); }

/* ===== Order status track ===== */
.order-status-track {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 14px 0;
  overflow-x: auto;
  padding-bottom: 4px;
}
.track-step {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: var(--ink-soft);
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
}
.track-step.done {
  background: var(--copper-dark);
  border-color: var(--copper-dark);
  color: var(--white);
  font-weight: 700;
}
.track-line {
  flex: 1;
  min-width: 16px;
  height: 1px;
  background: var(--line);
}

/* ===== Orders section titles ===== */
.orders-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.order-card-dim { opacity: 0.7; }

/* ===== Admin order management ===== */
.admin-order-card { margin-bottom: 20px; }

.admin-order-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.admin-order-status-label {
  font-size: 0.8rem;
  color: var(--ink-soft);
  white-space: nowrap;
  font-weight: 600;
}
.admin-status-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.admin-status-btn {
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.admin-status-btn:hover { border-color: var(--copper); color: var(--copper-dark); }
.admin-status-btn.active { background: var(--copper-dark); border-color: var(--copper-dark); color: var(--white); font-weight: 700; }
.admin-status-btn-danger:hover { border-color: var(--clay); color: var(--clay); }
.admin-status-btn-danger.active { background: var(--clay); border-color: var(--clay); color: var(--white); }
/* ===== Orders tabs (customer) ===== */
.orders-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 0;
}
.orders-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.15s ease;
}
.orders-tab:hover { color: var(--ink); }
.orders-tab.active { color: var(--copper-dark); border-bottom-color: var(--copper); font-weight: 700; }
.orders-tab-count {
  background: var(--copper-dark);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
}

/* ===== Admin orders tabs ===== */
.admin-orders-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 0;
}
.admin-orders-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.15s ease;
  white-space: nowrap;
}
.admin-orders-tab:hover { color: var(--ink); }
.admin-orders-tab.active { color: var(--copper-dark); border-bottom-color: var(--copper); font-weight: 700; }

/* ===== Admin filter bar ===== */
.admin-filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 24px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 56px;
  z-index: 20;
}

.admin-filter-input {
  flex: 1;
  min-width: 200px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.92rem;
  background: var(--paper);
}
.admin-filter-input:focus { outline: none; border-color: var(--copper); box-shadow: var(--ring); }

.admin-filter-select {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.88rem;
  background: var(--paper);
  cursor: pointer;
}
.admin-filter-select:focus { outline: none; border-color: var(--copper); box-shadow: var(--ring); }

/* ===== Cart total rows ===== */
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--paper-dim);
}
.cart-total-row:last-child { border-bottom: none; }
.cart-total-final {
  margin-top: 4px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  padding-top: 12px;
  border-top: 2px solid var(--line) !important;
}

/* ===== Orders not dimmed ===== */
.order-card-dim {
  opacity: 1;
}

.resend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  min-height: 36px;
}
.resend-timer {
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
}

/* ===== Home layout responsive ===== */
@media (max-width: 768px) {
  .home-layout {
    grid-template-columns: 1fr;
    padding: 16px 16px 70px;
    gap: 16px;
  }
  .filter-sidebar {
    position: static;
  }
}

/* ===== Item features table (product detail page) ===== */
/* features table styles moved to .item-notes section above */

/* ===== Features editor in admin modal ===== */
.features-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}
.feature-name-input,
.feature-value-input {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.88rem;
  background: var(--paper);
  width: 100%;
  box-sizing: border-box;
}
.feature-name-input:focus,
.feature-value-input:focus {
  outline: none;
  border-color: var(--copper);
  box-shadow: var(--ring);
}
.feature-remove-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--clay);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s ease;
}
.feature-remove-btn:hover {
  background: rgba(181,72,61,0.08);
  border-color: var(--clay);
}
.features-add-btn {
  font-size: 0.82rem;
  padding: 6px 12px;
  margin-top: 2px;
}


/* ===== Product sizes ===== */
.item-size-selector { display:flex; flex-direction:column; gap:8px; margin-top:2px; margin-bottom:4px; }
.item-size-label { font-size:.78rem; font-weight:700; color:var(--ink-soft); }
.item-size-options { display:flex; flex-wrap:wrap; gap:8px; }
.item-size-btn { min-width:54px; padding:8px 14px; border:1px solid var(--line); border-radius:var(--radius); background:var(--white); color:var(--ink); font-family:var(--font-body); font-size:.88rem; font-weight:600; cursor:pointer; transition:background .15s ease,border-color .15s ease,color .15s ease; }
.item-size-btn:hover { border-color:var(--copper); color:var(--copper-dark); }
.item-size-btn.active { background:var(--copper-dark); border-color:var(--copper-dark); color:var(--white); font-weight:700; }
@media (max-width:480px) { .item-size-options{gap:6px;} .item-size-btn{min-width:50px;padding:7px 12px;} }


/* ===== Cart item size ===== */
.cart-item-size { display:block; margin-top:4px; font-size:0.78rem; color:var(--ink-soft); }

html,
body {
  overscroll-behavior-y: none;
}

/* ===== Size buttons — unavailable state ===== */
.item-size-btn.unavailable {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
  border-style: dashed;
  position: relative;
}
.item-size-btn.unavailable::after {
  content: 'ناموجود';
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--clay);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.item-size-btn.unavailable:hover::after {
  opacity: 1;
}
.item-size-btn:disabled {
  cursor: not-allowed;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ===== Accordion filters ===== */
.sidebar-filter-title.accordion-toggle {
  width: 100%;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0;
  margin-bottom: 10px;
}
.accordion-arrow {
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}
.accordion-body {
  display: block;
}

/* ===== Item highlights / badges ===== */
.item-highlights {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.item-highlight-badge {
  width: 100%;
}
.item-highlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(201,122,61,0.08);
  border: 1px solid rgba(201,122,61,0.25);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--copper-dark);
}
.item-highlight-badge::before {
  content: '✓';
  font-size: 0.75rem;
  color: var(--copper);
}

/* ===== Highlights editor in admin modal ===== */
.highlights-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.highlight-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.highlight-input {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.88rem;
  background: var(--paper);
  width: 100%;
  box-sizing: border-box;
}
.highlight-input:focus {
  outline: none;
  border-color: var(--copper);
  box-shadow: var(--ring);
}

.item-photo-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox.hidden { display: none; }
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  left: 24px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 1.6rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }
.item-photo-wrap { cursor: zoom-in; }
.photo-zoom-hint { display: none; }

/* ===== Photo gallery (item page) ===== */
.item-photo-wrap { position: relative; }

.gallery-nav {
  direction: ltr;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(28,43,51,0.55);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.15s ease;
}
.gallery-nav:hover { background: rgba(28,43,51,0.8); }
.gallery-prev { right: 10px; }
.gallery-next { left: 10px; }

.item-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.item-thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.item-thumb:hover { opacity: 1; }
.item-thumb.active { border-color: var(--copper); opacity: 1; }

/* ===== Lightbox arrows ===== */
.lightbox-nav {
  direction: ltr;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.3); }
.lightbox-prev { right: 24px; }
.lightbox-next { left: 24px; }
.lightbox.single .lightbox-nav { display: none; }

.site-header {
  background: var(--ink);
  box-shadow: 0 4px 18px rgba(28,43,51,0.12);
  border-bottom: 2px solid var(--copper-dark);
}
.header-row { max-width: 1280px; }
.site-header .brand { min-width: 0; max-width: 50%; flex-shrink: 1; }
.site-header .brand > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.site-header .login-btn { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; line-height: 28px; }
.footer-brand { min-width: 0; max-width: 100%; }
.footer-brand-name, .footer-tagline, .footer-address, .footer-bottom { overflow-wrap: anywhere; }
.site-header .brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--copper);
  border-radius: 9px;
  color: var(--brass-light);
  background: rgba(201,122,61,0.1);
}
.search-form { position: relative; max-width: 460px; }
.search-form input { border: 1px solid rgba(255,255,255,0.18); padding-inline-end: 48px; min-height: 44px; }
.search-form input::placeholder { color: #BDC5C8; }
.search-submit {
  position: absolute;
  inset-inline-end: 0;
  top: 0;
  height: 100%;
  width: 44px;
  border: 0;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
}
.search-submit:hover { background: rgba(255,255,255,0.1); }
.login-btn, .cart-link, .user-btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.site-header .login-btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.site-header .login-btn:hover { background: var(--accent-soft); }
#cartCount { font-variant-numeric: tabular-nums; }
.store-banner {
  position: relative;
  display: grid;
  width: calc(100% - 40px);
  max-width: 1280px;
  margin: 112px auto 32px;
  min-height: 160px;
  aspect-ratio: 4 / 1;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  overflow: hidden;
}
.store-banner-image { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.storefront .store-banner.has-content { aspect-ratio: auto; min-height: clamp(240px, 25vw, 320px); }
.store-banner.has-image.has-content::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to left, rgba(13,24,29,0.88), rgba(13,24,29,0.64) 65%, rgba(13,24,29,0.3)); }
.store-banner-content { position: relative; z-index: 2; align-self: center; width: 100%; max-width: 760px; min-width: 0; padding: clamp(24px, 4vw, 48px); display: flex; flex-direction: column; align-items: flex-start; gap: 20px; color: var(--ink); }
.store-banner.has-image .store-banner-content { color: var(--white); }
.store-banner-content h1 { margin: 0; max-width: 100%; font-size: clamp(1.25rem, 3vw, 2.3rem); line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; }
.store-banner-button { display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 44px; max-width: 100%; padding: 12px 20px; border-radius: var(--radius); background: var(--ink); color: var(--white); font-weight: 700; line-height: 1.7; overflow-wrap: anywhere; }
.store-banner-button span { flex-shrink: 0; }
.store-banner-button:hover { background: var(--steel-dark); }
.store-banner.has-image .store-banner-button { background: var(--white); color: var(--ink); }
.store-banner.has-image .store-banner-button:hover { background: var(--accent-soft); }
.store-banner-button:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }
.store-banner.has-image .store-banner-button:focus-visible { outline-color: var(--white); }
@media (max-width: 1024px) {
  .store-banner.has-image.has-content::before { background: rgba(13,24,29,0.72); }
}
.store-banner-placeholder { height: 100%; min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px; color: var(--copper-dark); text-align: center; }
.store-banner-placeholder h1 { margin: 0; font-size: clamp(1.1rem, 2.5vw, 1.8rem); overflow-wrap: anywhere; }
.store-banner-placeholder p { margin: 0; color: var(--ink-soft); font-size: 0.85rem; }
.storefront .home-layout { max-width: 1320px; padding-top: 0 !important; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; }
.storefront .without-filters { grid-template-columns: minmax(0, 1fr); }
#catalog { scroll-margin-top: 100px; }
.catalog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.catalog-heading h2 { margin: 0; font-size: 1.35rem; overflow-wrap: anywhere; }
.catalog-count { padding: 6px 12px; border: 1px solid var(--line); background: var(--white); border-radius: 999px; font-size: 0.8rem; white-space: nowrap; color: var(--ink-soft); }
.catalog-filters { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-panel); box-shadow: var(--shadow); }
.catalog-filters > summary { padding: 18px; font-size: 0.88rem; font-weight: 700; cursor: pointer; min-height: 48px; border-radius: var(--radius-panel); }
.filter-summary-hint { display: block; font-size: 0.72rem; font-weight: 400; color: var(--ink-soft); margin-top: 6px; }
.catalog-filters .filter-sidebar-box { border: 0; border-radius: 0 0 var(--radius-panel) var(--radius-panel); box-shadow: none; max-height: calc(100vh - 210px); }
.sidebar-filter-section { padding: 16px; }
.sidebar-filter-option { min-height: 40px; display: flex; align-items: center; }
.sidebar-filter-option.active { background: var(--accent-soft); box-shadow: inset -3px 0 var(--copper-dark); }
.sidebar-filter-title.accordion-toggle { min-height: 32px; }
.storefront .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card-photo { padding: 20px; border-bottom: 1px solid var(--paper-dim); }
.card-photo .no-photo { background: var(--paper); border: 1px dashed var(--line); padding: 20px; border-radius: var(--radius); }
.card-category, .card-brand, .item-category, .item-brand { border-radius: 6px; padding: 3px 8px; }
.card-price { padding-top: 14px; border-top: 1px solid var(--paper-dim); font-size: 1rem; line-height: 1.8; }
.card-unavailable { border-top: 1px solid var(--paper-dim); padding-top: 14px; }
.page-btn { min-width: 44px; height: 44px; }
.item-photo-wrap, .item-notes, .auth-card, .cart-summary, .order-card { border-radius: var(--radius-panel); box-shadow: var(--shadow); }
.item-info .item-price { padding: 14px 18px; background: var(--accent-soft); border-radius: var(--radius); line-height: 1.8; }
.item-name { line-height: 1.7; }
.item-size-btn { min-height: 44px; }
.item-size-btn.active { box-shadow: 0 0 0 3px var(--accent-soft); }
.item-size-btn.unavailable.active { box-shadow: none; }
.add-to-cart-btn, .checkout-btn, .auth-btn { box-shadow: 0 4px 10px rgba(154,85,36,0.16); transition: background 0.2s ease, box-shadow 0.2s ease; }
.add-to-cart-btn:hover, .checkout-btn:hover:not(:disabled), .auth-btn:hover:not(:disabled) { box-shadow: 0 6px 18px rgba(154,85,36,0.24); }
.auth-page { padding-top: 110px; }
.cart-page, .profile-page, .orders-page { padding-top: 104px; }
.auth-card { border-top: 3px solid var(--copper-dark); }
.auth-input, .profile-input { background: var(--paper); }
.cart-item { background: var(--white); padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.cart-item-info { min-width: 0; overflow-wrap: anywhere; }
.cart-item-qty button { width: 44px; height: 44px; }
.cart-item-remove { min-width: 44px; min-height: 44px; }
.site-footer { --footer-muted: #BDC5C8; background: var(--ink); border-top: 3px solid var(--copper-dark); }
.footer-highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 1280px; margin: 0 auto; padding: 28px 20px; border-bottom: 1px solid rgba(255,255,255,0.12); }
.footer-highlight { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 14px; border-radius: var(--radius); color: var(--porcelain); }
.footer-highlight:hover { background: rgba(255,255,255,0.06); }
.footer-highlight-icon { display: grid; place-items: center; flex-shrink: 0; width: 48px; height: 48px; border: 1px solid rgba(212,180,131,0.3); border-radius: 14px; color: var(--brass-light); background: rgba(212,180,131,0.06); }
.footer-highlight > span:last-child { display: grid; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.footer-highlight strong { font-size: 0.92rem; }
.footer-highlight > span > span { font-size: 0.78rem; line-height: 1.8; color: var(--footer-muted); }
.footer-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); padding-top: 36px; padding-bottom: 36px; gap: 32px; }
.footer-inner > * { min-width: 0; }
.footer-heading { margin: 0 0 14px; font-size: 0.98rem; line-height: 1.8; color: var(--porcelain); }
.footer-heading::after { content: ''; display: block; width: 28px; height: 2px; margin-top: 10px; background: var(--brass-light); }
.footer-about, .footer-contact-note { color: var(--footer-muted); font-size: 0.84rem; line-height: 1.95; overflow-wrap: anywhere; }
.footer-about { margin: 12px 0 4px; }
.footer-contact-note { margin: 0 0 16px; }
.footer-nav-list { list-style: none; margin: 0; padding: 0; }
.footer-nav-list a { display: flex; align-items: center; min-height: 44px; padding-block: 6px; color: var(--footer-muted); font-size: 0.87rem; line-height: 1.8; overflow-wrap: anywhere; }
.footer-nav-list a:hover { color: var(--brass-light); text-decoration: underline; text-underline-offset: 5px; }
.footer-inner .footer-contact { min-width: 0; align-items: stretch; }
.footer-inner .footer-link { min-height: 44px; border-radius: var(--radius); justify-content: flex-start; overflow-wrap: anywhere; }
.footer-inner .footer-map { width: 100%; }
.footer-map iframe { display: block; }
.footer-map-overlay { min-height: 44px; }
#footerContact { scroll-margin-top: 150px; }
.footer-bottom { max-width: 1280px; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: start; }
.footer-bottom p { margin: 0; line-height: 1.9; }
.footer-back-top { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 10px; min-height: 44px; padding: 8px 14px; border: 1px solid rgba(255,255,255,0.18); border-radius: var(--radius); color: var(--porcelain); }
.footer-back-top:hover { background: rgba(255,255,255,0.06); }
.site-footer a:focus-visible { outline: 2px solid var(--brass-light); outline-offset: 4px; }
.footer-tagline, .footer-bottom, .footer-contact-title { color: var(--footer-muted); }
@media (max-width: 900px) {
  .footer-highlights { gap: 8px; }
  .footer-highlight { flex-direction: column; align-items: flex-start; gap: 10px; padding: 8px; }
  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .footer-highlights { grid-template-columns: 1fr; padding: 20px 16px; gap: 4px; }
  .footer-highlight { flex-direction: row; align-items: center; gap: 14px; }
  .footer-inner { padding: 28px 16px; gap: 28px 20px; }
  .footer-inner .footer-brand, .footer-inner .footer-contact { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; align-items: flex-start; padding: 20px 16px; }
}
.footer-address, .footer-address span { white-space: normal !important; }
.footer-map-link:hover .footer-map-overlay { background: var(--copper-deep); }
.footer-link-whatsapp:hover { background: var(--whatsapp); border-color: var(--whatsapp); }
.footer-link-telegram:hover { background: var(--steel-dark); border-color: var(--steel-dark); }
summary:focus-visible { outline: 2px solid var(--copper-dark); outline-offset: 3px; }
@media (max-width: 1320px) {
  .store-banner { margin-inline: 20px; }
}
@media (max-width: 1024px) {
  .storefront .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .store-banner { margin-top: 104px; aspect-ratio: 3 / 1; }
  .storefront .home-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .storefront main { padding: 0; }
  .catalog-filters .filter-sidebar-box { max-height: none; }
  .catalog-filters > summary { padding: 14px 18px; }
  .filter-summary-hint { display: inline; margin-inline-start: 8px; }
  .storefront .grid { gap: 12px; }
  .card-body { padding: 12px; }
  .card-photo { padding: 12px; }
  .card-name { font-size: 0.85rem; }
  .card-price { font-size: 0.88rem; }
}
@media (max-width: 480px) {
  .storefront .header-row { flex-wrap: wrap; }
  .storefront .brand span:last-child { display: inline; font-size: 0.9rem; }
  .storefront .search-form { flex-basis: 100%; order: 3; }
  .storefront .store-banner { width: calc(100% - 32px); margin: 156px 16px 24px; aspect-ratio: 2 / 1; }
  .catalog-heading h2 { font-size: 1.1rem; }
  .filter-summary-hint { font-size: 0.68rem; }
  #catalog { scroll-margin-top: 150px; }
}
