:root {
  --brand: #8b1a2e;
  --brand-dark: #5c101c;
  --brand-light: #fdf2f4;
  --crimson: #6b1424;
  --text: #1a1a1a;
  --text-muted: #666;
  --border: #e5e5e5;
  --bg: #fff;
  --star: #f5a623;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --container: min(1280px, 100% - 2rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Cairo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

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

button,
input,
select {
  font: inherit;
}

.container {
  width: var(--container);
  margin-inline: auto;
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Promo bar */
.promo-bar {
  background: var(--brand-dark);
  color: #fff;
  text-align: center;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

.promo-bar p {
  margin: 0;
}

.promo-bar--pulse {
  background: linear-gradient(90deg, var(--brand-dark), var(--brand), var(--brand-dark));
  background-size: 200% 100%;
  animation: promo-shimmer 4s ease-in-out infinite;
}

@keyframes promo-shimmer {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.sub-nav a.sub-nav-active {
  color: var(--brand);
  font-weight: 700;
}

/* Offers hero */
.offers-hero {
  background: linear-gradient(135deg, #fff5f6 0%, #fff 45%, #fef9f0 100%);
  border-bottom: 1px solid var(--border);
  padding: 2rem 0 1.75rem;
}

.offers-hero-inner {
  text-align: center;
  max-width: 820px;
}

.offers-tag {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.offers-hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.85rem, 4vw, 2.5rem);
}

.offers-lead {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.offers-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.offers-stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 1.1rem;
  min-width: 120px;
  box-shadow: var(--shadow);
}

.offers-stat strong {
  display: block;
  font-size: 1.25rem;
  color: var(--brand);
  line-height: 1.2;
}

.offers-stat span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.collection-hero--compact {
  padding-top: 1.25rem;
  padding-bottom: 0.75rem;
}

.collection-hero--compact h1 {
  display: none;
}

.offers-empty {
  text-align: center;
  color: var(--text-muted);
  margin: 2rem 0 0;
}

.offers-empty.hidden {
  display: none;
}

.popular-badge {
  position: absolute;
  top: 0.65rem;
  inset-inline-end: 0.65rem;
  background: var(--brand);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.28rem 0.45rem;
  border-radius: 4px;
  z-index: 2;
  max-width: calc(100% - 1rem);
}

.discount-pct {
  position: absolute;
  top: 0.65rem;
  inset-inline-start: 0.65rem;
  background: #111;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.3rem 0.45rem;
  border-radius: 4px;
  z-index: 2;
}

.product-card--offer {
  border-color: #f0d4da;
}

.page-offers .discount-badge {
  top: 2.35rem;
  max-width: calc(100% - 3rem);
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 0;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo img {
  display: block;
  height: 48px;
  width: 48px;
  object-fit: contain;
}

.search-form {
  display: flex;
  align-items: center;
  background: #f5f5f5;
  border-radius: 999px;
  padding: 0.35rem 0.35rem 0.35rem 1rem;
  border: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}

.search-form:focus-within {
  background: #fff;
  border-color: var(--border);
}

.search-form input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  min-width: 0;
}

.search-form button {
  border: none;
  background: var(--brand);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-switch {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.lang {
  border: none;
  background: transparent;
  padding: 0.25rem 0.65rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.lang.active {
  background: var(--brand);
  color: #fff;
}

.header-link {
  font-size: 0.9rem;
  font-weight: 500;
}

.cart-btn {
  position: relative;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.35rem;
  display: inline-flex;
  align-items: center;
  color: inherit;
}

.cart-count {
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  background: var(--brand);
  color: #fff;
  font-size: 0.65rem;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-nav {
  border-top: 1px solid var(--border);
  overflow-x: auto;
}

.nav-scroll {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem 0;
  min-width: max-content;
}

.nav-item {
  border: none;
  background: transparent;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  border-radius: var(--radius);
  font-weight: 500;
  color: var(--text);
}

.nav-item:hover,
.nav-item.active {
  background: var(--brand-light);
  color: var(--brand);
}

.sub-nav {
  border-top: 1px solid var(--border);
  background: #fafafa;
  font-size: 0.8rem;
  overflow-x: auto;
}

.sub-nav-inner {
  display: flex;
  gap: 1.25rem;
  padding: 0.45rem 0;
  min-width: max-content;
}

.sub-nav a {
  color: var(--text-muted);
}

.sub-nav a:hover {
  color: var(--brand);
}

/* Hero */
.collection-hero {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
  max-width: 820px;
}

.collection-hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
}

.hero-desc p {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.hero-extra.hidden {
  display: none;
}

.read-more {
  border: none;
  background: none;
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 1rem;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.9rem;
  color: #2d6a4f;
}

.trust-badge .check {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  background: #d8f3dc;
  border-radius: 50%;
  font-size: 0.7rem;
}

/* Layout */
.collection-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  padding-bottom: 3rem;
  align-items: start;
}

.collection-layout--full {
  grid-template-columns: 1fr;
}

.filters {
  position: sticky;
  top: 96px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: #fff;
}

.filters h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.filter-block + .filter-block {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.filter-toggle {
  width: 100%;
  text-align: start;
  border: none;
  background: none;
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-toggle::after {
  content: "−";
  color: var(--text-muted);
}

.filter-toggle:not(.open)::after {
  content: "+";
}

.filter-body {
  display: none;
  padding-top: 0.5rem;
}

.filter-body.open {
  display: block;
}

.price-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

#priceRange {
  width: 100%;
  accent-color: var(--brand);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.9rem;
  cursor: pointer;
}

.checkbox-row input {
  accent-color: var(--brand);
}

/* Toolbar */
.products-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.product-count {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.sort-wrap select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.75rem;
  background: #fff;
  cursor: pointer;
}

/* Product grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.product-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  transition: box-shadow 0.2s, transform 0.2s;
}

.product-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.product-media {
  position: relative;
  display: block;
  aspect-ratio: 1;
  background: #f8f8f8;
  overflow: hidden;
  color: inherit;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.discount-badge {
  position: absolute;
  top: 0.65rem;
  inset-inline-start: 0.65rem;
  background: var(--brand);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
  max-width: calc(100% - 3rem);
}

.wishlist-btn {
  position: absolute;
  top: 0.65rem;
  inset-inline-end: 0.65rem;
  border: none;
  background: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  font-size: 1rem;
  line-height: 1;
}

.product-body {
  padding: 0.85rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-title {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  min-height: 2.7em;
}

.product-title a {
  color: inherit;
}

.product-title a:hover {
  color: var(--brand);
}


.stars {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  color: var(--star);
}

.stars span {
  color: var(--text-muted);
  margin-inline-start: 0.25rem;
}

.product-prices {
  margin-top: auto;
  margin-bottom: 0.75rem;
}

.price-current {
  font-weight: 700;
  font-size: 0.95rem;
}

.price-from {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.price-compare {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-inline-start: 0.35rem;
}

.add-btn {
  width: 100%;
  border: none;
  background: var(--brand);
  color: #fff;
  padding: 0.65rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.add-btn:hover {
  background: var(--brand-dark);
}

.add-btn.secondary {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand);
}

.load-more {
  display: block;
  margin: 2rem auto 0;
  padding: 0.75rem 2rem;
  border: 1px solid var(--text);
  background: #fff;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
}

.load-more:hover {
  background: #f5f5f5;
}

.load-more.hidden {
  display: none;
}

/* Footer */
.site-footer {
  background: #111;
  color: #ddd;
  padding: 3rem 0 0;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding-bottom: 2rem;
}

.footer-col h3,
.footer-col h4 {
  color: #fff;
  margin: 0 0 1rem;
}

.footer-col p {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: 0.4rem;
}

.footer-col a:hover {
  color: #fff;
}

.social-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  font-size: 0.85rem;
}

.newsletter-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.newsletter-form input {
  flex: 1;
  border: 1px solid #444;
  background: #222;
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
}

.newsletter-form button {
  border: none;
  background: var(--brand);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
}

.footer-bottom {
  border-top: 1px solid #333;
  padding: 1rem 0;
  text-align: center;
  font-size: 0.85rem;
}

.footer-bottom p {
  margin: 0;
}

/* Toast & chat */
html[dir="ltr"] body {
  font-family: "Cairo", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.toast {
  position: fixed;
  bottom: 5rem;
  inset-inline-start: 50%;
  transform: translateX(-50%) translateY(120%);
  background: #222;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  z-index: 200;
  transition: transform 0.3s;
  pointer-events: none;
}

[dir="rtl"] .toast {
  transform: translateX(50%) translateY(120%);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

[dir="rtl"] .toast.show {
  transform: translateX(50%) translateY(0);
}

.chat-fab {
  position: fixed;
  bottom: 1.25rem;
  inset-inline-start: 1.25rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: #111;
  color: #fff;
  font-size: 1.35rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 150;
}

/* Responsive */
@media (max-width: 1100px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .collection-layout {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }

  .logo {
    grid-column: 1;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .search-form {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

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

@media (max-width: 420px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}

/* Cart page */
.cart-page {
  padding: 2rem 0 3rem;
}

.cart-page h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}

.cart-lines {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-line {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  align-items: center;
}

.cart-line-image {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: #f8f8f8;
}

.cart-line-image img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  display: block;
}

.cart-line-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  line-height: 1.35;
}

.cart-line-unit {
  margin: 0 0 0.65rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.cart-line-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.qty-btn {
  border: none;
  background: #f5f5f5;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.qty-value {
  min-width: 2rem;
  text-align: center;
  font-weight: 600;
}

.cart-remove {
  border: none;
  background: none;
  color: var(--brand);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
}

.cart-line-total {
  margin: 0;
  font-weight: 700;
  white-space: nowrap;
}

.cart-summary {
  position: sticky;
  top: 96px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: #fff;
}

.cart-summary h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.cart-delivery-banner {
  background: var(--brand-light);
  border: 1px solid #f0d4da;
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
  margin-bottom: 1rem;
}

.cart-delivery-free {
  margin: 0 0 0.25rem;
  font-weight: 700;
  color: var(--brand);
  font-size: 0.95rem;
}

.cart-delivery-time {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.summary-row--delivery strong {
  color: #2d6a4f;
  font-weight: 700;
}

.summary-note {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cart-empty {
  text-align: center;
  padding: 3rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.cart-empty p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.cart-empty.hidden,
.cart-lines.hidden,
.cart-summary.hidden {
  display: none;
}

.btn-primary {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-block {
  width: 100%;
  margin-bottom: 0.65rem;
}

.btn-text {
  width: 100%;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
}

.btn-link {
  display: block;
  text-align: center;
  color: var(--brand);
  font-weight: 600;
  font-size: 0.9rem;
}

.site-footer--compact {
  padding-top: 0;
}

.site-footer--compact .footer-bottom {
  border-top: none;
}

@media (max-width: 900px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }

  .cart-summary {
    position: static;
  }
}

@media (max-width: 560px) {
  .cart-line {
    grid-template-columns: 72px 1fr;
  }

  .cart-line-total {
    grid-column: 2;
    justify-self: start;
  }

  .cart-line-image img {
    width: 72px;
    height: 72px;
  }
}
