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

:root {
  --bg: #faf9f7;
  --white: #ffffff;
  --text: #2c2c2c;
  --text-light: #6b6b6b;
  --border: #e8e6e3;
  --accent: #8b7355;
  --accent-light: #c4b29e;
  --shadow: rgba(0, 0, 0, 0.06);
  --shadow-hover: rgba(0, 0, 0, 0.12);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Heebo', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-name {
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--text);
}

/* ===== Category Navigation ===== */
.category-nav {
  position: sticky;
  top: 61px;
  z-index: 90;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 40px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-inner::-webkit-scrollbar {
  display: none;
}

.nav-pill {
  flex-shrink: 0;
  padding: 8px 24px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-light);
  font-family: 'Heebo', sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.nav-pill:hover {
  border-color: var(--accent-light);
  color: var(--text);
}

.nav-pill.active {
  background: var(--text);
  color: var(--white);
  border-color: var(--text);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 400px;
  max-height: 700px;
  overflow: hidden;
}

.hero-image-wrapper {
  width: 100%;
  height: 100%;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.15) 40%,
    rgba(0, 0, 0, 0.05) 100%
  );
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 60px;
}

.hero-title {
  color: var(--white);
  font-size: 2.8rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* ===== Loading Skeleton ===== */
.loading-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 60px 40px;
}

.loading-container.hidden {
  display: none;
}

.skeleton-section {
  margin-bottom: 60px;
}

.skeleton-title {
  width: 180px;
  height: 28px;
  background: linear-gradient(90deg, #eee 25%, #e0e0e0 50%, #eee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 30px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.skeleton-card {
  aspect-ratio: 4/5;
  background: linear-gradient(90deg, #eee 25%, #e0e0e0 50%, #eee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== Catalog ===== */
.catalog {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

.catalog.hidden {
  display: none;
}

/* ===== Category Section ===== */
.category-section {
  padding-top: 40px;
  margin-bottom: 70px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 30px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: 0.03em;
  color: var(--text);
}

.section-count {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 300;
}

.see-all {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.2s;
  cursor: pointer;
}

.see-all:hover {
  color: var(--text);
}

/* ===== Horizontal Scroll Row ===== */
.scroll-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.image-scroll-row {
  display: flex;
  flex-direction: row;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 8px 4px 16px;
  flex: 1;
}

.image-scroll-row::-webkit-scrollbar {
  display: none;
}

.scroll-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px var(--shadow);
  transition: all 0.2s ease;
  z-index: 2;
}

.scroll-btn:hover {
  background: var(--text);
  color: var(--white);
  border-color: var(--text);
}

.image-card {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: #f0eeeb;
  flex-shrink: 0;
  width: 260px;
  scroll-snap-align: start;
}

.image-card-link {
  display: block;
  aspect-ratio: 4/5;
  overflow: hidden;
  border-radius: 4px;
}

.image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
  display: block;
}

.image-card:hover img {
  transform: scale(1.03);
}

.image-card .card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: flex-end;
  padding: 16px;
  transition: background 0.4s ease;
  border-radius: 4px;
  pointer-events: none;
}

.image-card:hover .card-overlay {
  background: rgba(0, 0, 0, 0.2);
}

.card-overlay .card-name {
  color: white;
  font-size: 0.8rem;
  font-weight: 300;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s ease;
}

.image-card:hover .card-overlay .card-name {
  opacity: 1;
  transform: translateY(0);
}

/* Images fade in naturally */
.image-card img {
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.image-card img.loaded, .image-card img[src] {
  opacity: 1;
}

/* Box shadow on hover */
.image-card {
  box-shadow: 0 1px 3px var(--shadow);
  transition: box-shadow 0.3s ease;
}

.image-card:hover {
  box-shadow: 0 8px 30px var(--shadow-hover);
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  left: 24px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 2;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 2;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.35);
}

.lightbox-prev { right: 24px; }
.lightbox-next { left: 24px; }

.lightbox img {
  transition: opacity 0.2s ease;
}

/* ===== Cart Icon (Header) ===== */
.header-inner {
  position: relative;
  justify-content: center;
}

.cart-icon {
  position: absolute;
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.2s;
}

.cart-icon:hover { background: var(--border); }

.cart-total-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  background: var(--accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Cart Badge on Card ===== */
.cart-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  pointer-events: none;
}

/* ===== Qty Controls on Card ===== */
.card-qty-control {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 8px 12px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 3;
}

.image-card:hover .card-qty-control {
  opacity: 1;
  transform: translateY(0);
}

.qty-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.qty-btn:hover {
  background: var(--text);
  color: var(--white);
  border-color: var(--text);
}

.qty-value {
  min-width: 32px;
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  font-family: 'Heebo', sans-serif;
}

/* ===== Lightbox qty controls ===== */
.lightbox-bottom {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.lb-qty-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 40px;
  padding: 6px 10px;
}

.lb-qty-btn {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  color: white;
}

.lb-qty-btn:hover {
  background: rgba(255,255,255,0.4);
  border-color: white;
  color: var(--text);
}

.lb-qty-wrap .qty-value {
  color: white;
  min-width: 28px;
}

.lightbox-counter {
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  font-family: 'Heebo', sans-serif;
}

/* ===== Cart Drawer ===== */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 200;
}

.cart-drawer.open .cart-drawer-overlay {
  pointer-events: all;
}

.cart-drawer-panel {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 380px;
  max-width: 100vw;
  background: var(--white);
  box-shadow: -4px 0 30px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 201;
}

.cart-drawer.open .cart-drawer-overlay { opacity: 1; }
.cart-drawer.open .cart-drawer-panel { transform: translateX(0); }

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cart-drawer-title {
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text);
}

.cart-drawer-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text-light);
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}
.cart-drawer-close:hover { color: var(--text); }

.cart-drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-empty {
  text-align: center;
  color: var(--text-light);
  font-size: 0.95rem;
  margin-top: 40px;
}

.cart-item-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.cart-item-thumb {
  width: 64px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: #f0eeeb;
}

.cart-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cart-item-name {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-cat {
  font-size: 0.75rem;
  color: var(--text-light);
}

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

.ci-qty-val {
  min-width: 24px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.cart-drawer-footer {
  padding: 16px 24px 28px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.cart-drawer-total {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 14px;
}

.place-order-btn {
  width: 100%;
  padding: 14px;
  background: var(--text);
  color: white;
  border: none;
  border-radius: 4px;
  font-family: 'Heebo', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.place-order-btn:hover { background: var(--accent); }

/* ===== Order Modal ===== */
.order-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.order-modal.active {
  opacity: 1;
  pointer-events: all;
}
.order-modal-box {
  background: var(--white);
  border-radius: 8px;
  padding: 32px;
  width: 420px;
  max-width: 95vw;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.order-modal-title {
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text);
}
.order-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.order-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.9rem;
  color: var(--text-light);
}
.order-form input, .order-form textarea {
  font-family: 'Heebo', sans-serif;
  font-size: 0.95rem;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  direction: rtl;
  color: var(--text);
  transition: border-color 0.2s;
}
.order-form input:focus, .order-form textarea:focus {
  outline: none;
  border-color: var(--accent-light);
}
.required { color: var(--accent); }
.order-modal-msg {
  font-size: 0.9rem;
  min-height: 20px;
}
.order-modal-msg.success { color: #2e7d32; }
.order-modal-msg.error   { color: #c62828; }
.order-modal-actions {
  display: flex;
  gap: 10px;
}
.order-submit-btn {
  flex: 1;
  padding: 12px;
  background: var(--text);
  color: white;
  border: none;
  border-radius: 4px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}
.order-submit-btn:hover:not(:disabled) { background: var(--accent); }
.order-submit-btn:disabled { opacity: 0.5; cursor: default; }
.order-cancel-btn {
  padding: 12px 20px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s;
}
.order-cancel-btn:hover { border-color: var(--text); color: var(--text); }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--white);
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 40px;
  text-align: center;
}

.footer-inner p {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 300;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .skeleton-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .hero {
    height: 50vh;
    min-height: 300px;
  }

  .hero-title {
    font-size: 2.2rem;
    padding-bottom: 40px;
  }

  .header-inner,
  .nav-inner,
  .catalog,
  .loading-container,
  .footer-inner {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 640px) {
  .image-card {
    width: 180px;
  }

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

  .hero {
    height: 45vh;
    min-height: 250px;
  }

  .hero-title {
    font-size: 1.8rem;
    padding-bottom: 30px;
  }

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

  .section-title {
    font-size: 1.3rem;
  }

  .header-inner,
  .nav-inner,
  .catalog,
  .loading-container,
  .footer-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .nav-pill {
    padding: 6px 18px;
    font-size: 0.85rem;
  }

  .category-nav {
    top: 55px;
  }
}
