@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&family=Playfair+Display:wght@600;700&display=swap');

:root {
  --color-bg: #FAF6F1;
  --color-surface: #FFFFFF;
  --color-primary: #6B3A1F;
  --color-primary-light: #9C6B3E;
  --color-gold: #C9A227;
  --color-text: #2E2018;
  --color-text-light: #7A6A5C;
  --color-border: #E8DDD0;
  --shadow-soft: 0 4px 20px rgba(107, 58, 31, 0.08);
  --shadow-hover: 0 8px 30px rgba(107, 58, 31, 0.15);
  --radius: 12px;
  --max-width: 1200px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: 'Cairo', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  scroll-behavior: smooth;
}

img {
  max-width: 100%;
  display: block;
}

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

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 20px;
}

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 14px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  height: 48px;
  width: auto;
}

.brand-name {
  font-family: 'Playfair Display', 'Cairo', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

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

.lang-toggle button {
  background: transparent;
  border: none;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-light);
  transition: all 0.2s;
}

.lang-toggle button.active {
  background: var(--color-primary);
  color: #fff;
}

.cart-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.cart-link:hover {
  background: var(--color-primary-light);
}

.cart-count {
  background: var(--color-gold);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 4px;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, #4a2814 100%);
  color: #fff;
  text-align: center;
  padding: 60px 20px;
}

.hero h1 {
  font-family: 'Playfair Display', 'Cairo', serif;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.hero p {
  font-size: 1.1rem;
  color: #f0e6da;
  margin-bottom: 24px;
}

.btn-gold {
  display: inline-block;
  background: var(--color-gold);
  color: var(--color-primary);
  padding: 12px 32px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201, 162, 39, 0.4);
}

/* ---------- Section titles ---------- */
.section-title {
  font-family: 'Playfair Display', 'Cairo', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-block: 40px 20px;
  text-align: center;
}

/* ---------- Search bar ---------- */
.search-bar {
  margin-block: 24px 8px;
  display: flex;
  gap: 10px;
}

.search-bar input,
.search-bar select {
  padding: 12px 18px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--color-surface);
  color: var(--color-text);
}

.search-bar input {
  flex: 1;
  min-width: 0;
}

.search-bar select {
  flex: 0 0 auto;
  cursor: pointer;
}

.search-bar input:focus,
.search-bar select:focus {
  outline: none;
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(156, 107, 62, 0.15);
}

@media (max-width: 600px) {
  .search-bar {
    flex-wrap: wrap;
  }

  .search-bar input {
    flex: 1 1 100%;
  }

  .search-bar select {
    flex: 1 1 100%;
  }
}

/* ---------- Promotions section ---------- */
.promotions-section {
  margin-top: 24px;
}

.promotions-section .section-title {
  margin-block: 0 20px;
}

.promotions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 24px;
}

/* ---------- Category filter ---------- */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 32px;
}

.category-chip {
  padding: 8px 22px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-light);
  transition: all 0.2s;
}

.category-chip:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary);
}

.category-chip.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ---------- Product grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 24px;
  padding-bottom: 60px;
}

.product-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
}

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

.product-card-image {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f5efe6;
}

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

.discount-badge {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  background: #C0392B;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  z-index: 1;
}

/* ---------- Discount pricing ---------- */
.price-original {
  text-decoration: line-through;
  color: var(--color-text-light);
  font-size: 0.85em;
  font-weight: 500;
  margin-inline-end: 8px;
}

.price-discounted {
  color: #C0392B;
  font-weight: 700;
}

.product-detail-price .price-original {
  color: #E8D2BC;
}

.product-detail-price .price-discounted {
  color: #FF8A7A;
}

.product-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.product-card-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text);
}

.product-card-price {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1.05rem;
}

.product-card-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

.btn-outline, .btn-primary {
  flex: 1;
  text-align: center;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid var(--color-primary);
  transition: all 0.2s;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary-light);
}

.empty-message {
  text-align: center;
  color: var(--color-text-light);
  padding: 60px 20px;
  font-size: 1.05rem;
  grid-column: 1 / -1;
}

/* ---------- Product detail ---------- */
.product-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding-block: 40px;
}

@media (min-width: 768px) {
  .product-detail {
    grid-template-columns: 1fr 1fr;
  }
}

.product-detail-image {
  border-radius: var(--radius);
  overflow: hidden;
  background: #f5efe6;
  box-shadow: var(--shadow-soft);
}

.product-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

.product-detail-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.product-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  background: #f5efe6;
  cursor: pointer;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-thumb.active {
  border-color: var(--color-primary);
}

.product-detail-info h1 {
  font-family: 'Playfair Display', 'Cairo', serif;
  font-size: 2rem;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.product-detail-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-gold);
  background: var(--color-primary);
  display: inline-block;
  padding: 6px 18px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.product-detail-description-label {
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--color-primary);
}

.product-detail-description {
  color: var(--color-text-light);
  line-height: 1.8;
  margin-bottom: 24px;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.qty-control button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
}

.qty-control button:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.qty-control input {
  width: 50px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 8px 4px;
  background: var(--color-surface);
  color: var(--color-text);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  color: var(--color-primary);
  font-weight: 600;
}

.back-link::before {
  content: "←";
}

html[dir="rtl"] .back-link::before {
  content: "→";
}

.back-link:hover {
  text-decoration: underline;
}

/* ---------- Cart page ---------- */
.cart-page {
  padding-block: 40px 80px;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.cart-item-image {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  background: #f5efe6;
  flex-shrink: 0;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.cart-item-price {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-item-qty button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-weight: 700;
  color: var(--color-primary);
}

.cart-item-qty button:hover {
  background: var(--color-primary);
  color: #fff;
}

.cart-item-qty span {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
}

.cart-item-remove {
  color: #b3413c;
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  background: none;
  padding: 6px;
}

.cart-item-remove:hover {
  text-decoration: underline;
}

.cart-summary {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  max-width: 420px;
  margin-inline-start: auto;
  text-align: center;
}

.cart-summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
  padding-block: 8px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.cart-summary-note {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-block: 12px;
}

.btn-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #25D366;
  color: #fff;
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  width: 100%;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.empty-cart {
  text-align: center;
  padding: 60px 20px;
}

.empty-cart p {
  color: var(--color-text-light);
  font-size: 1.1rem;
  margin-bottom: 20px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: #fff;
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: var(--shadow-hover);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 999;
  white-space: nowrap;
}

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

.toast.show {
  opacity: 1;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-primary);
  color: #f0e6da;
  text-align: center;
  padding: 24px 20px;
  font-size: 0.9rem;
  margin-top: 40px;
}

.site-footer a {
  color: var(--color-gold);
  font-weight: 600;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .hero {
    padding: 40px 16px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .brand-name {
    font-size: 1.2rem;
  }

  .brand img {
    height: 38px;
  }

  .cart-summary {
    margin-inline-start: 0;
    max-width: 100%;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .promotions-grid {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 12px;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .promotions-grid .product-card {
    flex: 0 0 160px;
    scroll-snap-align: start;
  }

  .product-card-body {
    padding: 10px;
    gap: 6px;
  }

  .product-card-title {
    font-size: 0.85rem;
  }

  .product-card-price {
    font-size: 0.9rem;
  }

  .product-card-actions {
    flex-direction: column;
    gap: 6px;
  }

  .btn-outline, .btn-primary {
    padding: 7px 8px;
    font-size: 0.75rem;
  }

  .discount-badge {
    font-size: 0.65rem;
    padding: 3px 8px;
    top: 6px;
    inset-inline-start: 6px;
  }

  .price-original {
    display: block;
    margin-inline-end: 0;
    font-size: 0.8em;
  }
}
