/* ========================================
   Juthoor Theme (جذور) — Heritage & Roots
   Design: Warm, organic, artisanal, serif
   ======================================== */

/* ===== Base Reset ===== */
.loading { opacity: 0.6; pointer-events: none; }
.removing { transform: translateX(-100%); opacity: 0; transition: all 0.3s ease; }

/* ===== Line Clamp ===== */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ===================================================
   JUTHOOR SECTION HEADER — Centered + ornamental divider
   (NOT left-aligned like Athar, NOT underlined like Qamar)
   =================================================== */
.juthoor-heading {
  text-align: center;
  margin-bottom: 2.5rem;
}

.juthoor-heading h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

.juthoor-heading p,
.juthoor-heading > div {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin-top: 0.5rem;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.juthoor-heading .ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.juthoor-heading .ornament::before,
.juthoor-heading .ornament::after {
  content: '';
  width: 2.5rem;
  height: 1px;
  background: var(--color-border);
}

.juthoor-heading .ornament .dot {
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Light variant for dark backgrounds */
.juthoor-heading--light h2 { color: #fff; }
.juthoor-heading--light p,
.juthoor-heading--light > div { color: rgba(255,255,255,0.7); }
.juthoor-heading--light .ornament::before,
.juthoor-heading--light .ornament::after { background: rgba(255,255,255,0.2); }

@media (min-width: 768px) {
  .juthoor-heading h2 { font-size: 2.25rem; }
}

/* ===================================================
   JUTHOOR BUTTONS — Warm, organic
   =================================================== */
.btn-primary {
  background-color: var(--color-accent);
  color: #fff;
  padding: 0.75rem 2rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
}

.btn-primary:hover {
  background-color: var(--color-primary);
  box-shadow: 0 4px 16px rgba(92, 64, 51, 0.2);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  padding: 0.625rem 1.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

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

.btn-warm {
  background-color: var(--color-primary);
  color: #fff;
  padding: 0.75rem 2rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
}

.btn-warm:hover {
  background-color: var(--color-primary-dark);
  box-shadow: 0 4px 16px rgba(59, 40, 33, 0.2);
}

/* ===================================================
   JUTHOOR PRODUCT CARD — Warm, rounded, hover glow
   (NOT sharp-edged like Athar, NOT heavy shadow like Qamar)
   =================================================== */
.product-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.product-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 8px 24px rgba(181, 101, 59, 0.1);
}

.product-card.hover-zoom .card-img img {
  transition: transform 0.6s ease;
}
.product-card.hover-zoom:hover .card-img img {
  transform: scale(1.05);
}

/* ===================================================
   JUTHOOR CARD — Universal warm hover
   =================================================== */
.juthoor-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.juthoor-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 8px 24px rgba(181, 101, 59, 0.1);
}

/* ===================================================
   SCROLLBAR
   =================================================== */
.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: var(--color-text-secondary); }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ===================================================
   SWIPER
   =================================================== */
.swiper-pagination-bullet { background: var(--color-primary) !important; opacity: 0.3; }
.swiper-pagination-bullet-active { opacity: 1 !important; }

.swiper-button-next,
.swiper-button-prev {
  color: var(--color-primary) !important;
  background: var(--color-surface);
  width: 40px !important;
  height: 40px !important;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.swiper-button-next::after,
.swiper-button-prev::after { font-size: 14px !important; font-weight: bold; }

.swiper-outside-pagination .swiper-wrapper { align-items: stretch; }
.swiper-outside-pagination .swiper-slide { height: auto; }
.swiper-outside-pagination { overflow-x: clip; overflow-y: visible; }
.swiper-outside-pagination > .swiper-pagination {
  position: relative !important;
  bottom: auto !important;
  margin-top: 1.5rem;
}

/* ===================================================
   TOAST NOTIFICATIONS
   =================================================== */
.toast {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  pointer-events: auto;
  animation: toastIn 0.3s ease;
}
.toast-success { background-color: #5B8C51; }
.toast-error { background-color: #B84A3E; }
.toast-warning { background-color: #C49A4B; }
.toast-info { background-color: var(--color-primary); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===================================================
   OVERLAY & DRAWER
   =================================================== */
.overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(45, 35, 24, 0.5);
  z-index: 40;
  backdrop-filter: blur(3px);
}

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 100%;
  max-width: 400px;
  background: var(--color-surface);
  z-index: 50;
  overflow-y: auto;
  transition: transform 0.3s ease;
}
html[dir="rtl"] .drawer-start { right: 0; transform: translateX(100%); }
html[dir="ltr"] .drawer-start { left: 0; transform: translateX(-100%); }
html[dir="rtl"] .drawer-end { left: 0; transform: translateX(-100%); }
html[dir="ltr"] .drawer-end { right: 0; transform: translateX(100%); }
.drawer.open { transform: translateX(0) !important; }

/* ===================================================
   JUTHOOR TESTIMONIAL — Warm quote card with accent top
   =================================================== */
.juthoor-testimonial {
  padding: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  position: relative;
  border-top: 3px solid var(--color-accent);
}

.juthoor-testimonial .quote-icon {
  color: var(--color-accent);
  opacity: 0.3;
}

/* ===================================================
   JUTHOOR STATS
   =================================================== */
.juthoor-stat {
  text-align: center;
  padding: 1.5rem;
}

.juthoor-stat .stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.juthoor-stat .stat-label {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* Light variant for dark backgrounds */
.juthoor-stat--light .stat-number { color: var(--color-accent); }
.juthoor-stat--light .stat-label { color: rgba(255,255,255,0.7); }

/* ===================================================
   SKELETON LOADING
   =================================================== */
.skeleton {
  background: linear-gradient(90deg, var(--color-border) 25%, rgba(0,0,0,0.03) 50%, var(--color-border) 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; }
}

/* ===================================================
   ANIMATIONS
   =================================================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes checkPop { 0% { transform: scale(0); opacity: 0; } 50% { transform: scale(1.3); } 100% { transform: scale(1); opacity: 1; } }

.animate-fade-in { animation: fadeIn 0.3s ease; }
.animate-slide-up { animation: slideUp 0.4s ease; }
.animate-slide-down { animation: slideDown 0.3s ease; }
.animate-spin { animation: spin 0.8s linear infinite; }
.animate-check { animation: checkPop 0.4s ease; }

@keyframes cartItemEnter {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.cart-item-enter { animation: cartItemEnter 0.3s ease-out; }

@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-count-up { animation: countUp 0.6s ease-out; }

/* ===================================================
   RATING STARS
   =================================================== */
.stars { display: inline-flex; gap: 2px; }
.stars .star-filled { color: #C49A4B; }
.stars .star-empty { color: var(--color-border); }

/* ===================================================
   PRICE RANGE SLIDER
   =================================================== */
.price-slider { position: relative; height: 28px; display: flex; align-items: center; }
.price-slider .slider-track { position: absolute; width: 100%; height: 4px; background: var(--color-border); border-radius: 4px; }
.price-slider .slider-range { position: absolute; height: 4px; background: var(--color-primary); border-radius: 4px; }
.price-slider input[type="range"] {
  position: absolute; width: 100%; -webkit-appearance: none; appearance: none;
  background: transparent; pointer-events: none; margin: 0; padding: 0; height: 4px; outline: none;
}
.price-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; width: 20px; height: 20px;
  border-radius: 50%; background: white; border: 2px solid var(--color-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.price-slider input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.1); }
.price-slider input[type="range"]::-moz-range-thumb {
  pointer-events: auto; width: 20px; height: 20px; border-radius: 50%;
  background: white; border: 2px solid var(--color-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); cursor: pointer;
}
.price-slider input[type="range"]::-moz-range-track { background: transparent; border: none; }

/* ===================================================
   LOGO WALL
   =================================================== */
.logo-grayscale { filter: grayscale(100%); opacity: 0.5; transition: all 0.3s ease; }
.logo-grayscale:hover { filter: grayscale(0%); opacity: 1; }

@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.animate-ticker { animation: ticker 30s linear infinite; }
html[dir="rtl"] .animate-ticker { animation-direction: reverse; }

/* ===================================================
   JUTHOOR ORNAMENTAL DIVIDER
   =================================================== */
.juthoor-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.juthoor-divider::before,
.juthoor-divider::after {
  content: '';
  height: 1px;
  width: 40px;
  background: var(--color-accent);
  opacity: 0.4;
}

.juthoor-divider .dot {
  width: 5px;
  height: 5px;
  background: var(--color-accent);
  border-radius: 50%;
}

/* ===================================================
   WARM SECTION helpers
   =================================================== */
.section-warm {
  background-color: var(--color-primary);
  color: #fff;
}

.section-warm h2,
.section-warm h3,
.section-warm h4 { color: #fff; }

.section-warm p { color: rgba(255,255,255,0.75); }

.section-cream {
  background-color: var(--color-background);
}

/* ===================================================
   DISABLE ANIMATIONS (from settings)
   =================================================== */
.no-animations *,
.no-animations *::before,
.no-animations *::after {
  animation-duration: 0s !important;
  transition-duration: 0s !important;
}

/* ===================================================
   DYNAMIC BUTTON RADIUS (from settings)
   =================================================== */
.btn-primary,
.btn-secondary,
.btn-warm {
  border-radius: var(--radius-btn, 8px);
}
