/* Theme variables */
:root {
  --color-primary: #ffba00;
  --color-primary-600: #ffa000; /* hover/darker */
  --color-accent: #ef4444; /* Tailwind red-500 */
  --color-text-strong: #374151; /* slate-700 */
  --color-text-muted: #6c757d;
  --color-border: #f1f5f9;
  --color-border-strong: #e2e8f0;
  --color-surface: #ffffff;
  --color-gray-100: #f8fafc;
  --color-gray-50: #fafbfc;
  --color-icon-muted: #cbd5e1;
}

.modern-shadow {
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.04);
}

.modern-shadow-lg {
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.05),
    0 2px 4px rgba(0, 0, 0, 0.03);
}

.modern-shadow-xl {
  box-shadow:
    0 10px 15px rgba(0, 0, 0, 0.08),
    0 4px 6px rgba(0, 0, 0, 0.03);
}

.modern-border {
  border: 1px solid var(--color-border);
}

.modern-radius {
  border-radius: 6px;
}

.modern-radius-lg {
  border-radius: 8px;
}

.modern-radius-xl {
  border-radius: 10px;
}

.glass-effect {
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.95);
}

.hover-lift {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-2px);
}

.smooth-transition {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.story-scroll {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.story-scroll::-webkit-scrollbar {
  display: none;
}

.story-item {
  min-width: 80px;
}

/* Tailwind plugin substitute (line-clamp) - keep UI stable without extra deps */
.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Modern Dropdown */
.modern-dropdown {
  position: relative;
}

.dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.08),
    0 4px 10px rgba(0, 0, 0, 0.03);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  min-width: 280px;
  padding: 12px; /* tighter, still comfortable */
  border: 1px solid var(--color-border);
}

.modern-dropdown:hover .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 5px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--color-text-strong);
  text-decoration: none;
  margin-bottom: 4px;
}

.dropdown-item:hover {
  background: var(--color-gray-100);
  color: var(--color-primary);
  transform: translateX(-4px);
}

.dropdown-item i {
  margin-left: 12px;
  width: 20px;
  text-align: center;
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: white;
  z-index: 9999;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.mobile-menu.active {
  right: 0;
}

.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Scroll area inside mobile menu when items overflow */
.mobile-menu .menu-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-strong);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  border: 0;
  width: 100%;
  text-align: start;
  cursor: pointer;
}

.mobile-menu-item:hover {
  background: var(--color-gray-100);
  color: var(--color-primary);
}

.mobile-menu-item i {
  margin-left: 12px;
  width: 20px;
  text-align: center;
}

.mobile-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 0 0; /* collapsed */
}

.mobile-submenu.active {
  max-height: 320px;
  padding: 6px 0; /* give some breathing when open */
}

/* Submenu items: clean, readable, one-per-line */
.mobile-submenu-item {
  display: block;
  padding: 10px 20px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-strong);
  font-size: 14px;
  line-height: 1.6;
}
.mobile-submenu-item:last-child { border-bottom: 0; }
.mobile-submenu-item:hover { background: var(--color-gray-100); color: var(--color-primary); }

/* Chevron visual feedback */
#products-toggle .fa-chevron-down,
#brands-toggle .fa-chevron-down { transition: transform 0.2s ease; }
#products-toggle[aria-expanded="true"] .fa-chevron-down,
#brands-toggle[aria-expanded="true"] .fa-chevron-down { transform: rotate(180deg); color: var(--color-primary); }

.mobile-submenu-item {
  padding: 12px 20px 12px 52px;
  border-bottom: 1px solid var(--color-border-strong);
  color: var(--color-text-strong);
  font-size: 14px;
}

.mobile-submenu-item:hover {
  background: var(--color-gray-100);
  color: var(--color-primary);
}

/* Price Toggle */
.price-toggle {
  position: relative;
  cursor: pointer;
}

/* Align old-price start edge with chevron using a subtle negative margin */
.price-toggle .old-price {
  margin-left: -4px;
}

.price-toggle.disabled {
  /* visually disabled */
  background: #f3f4f6; /* light gray */
  border-radius: 6px;
  padding: 6px 8px;
  /* interaction disabled */
  pointer-events: none;
  filter: grayscale(0.1);
}

.price-toggle.disabled i { color: var(--color-icon-muted); }

.price-options {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--color-surface);
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-120%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  /* Fit to content dynamically */
  width: max-content;
  min-width: initial;
  padding: 8px; /* slightly tighter overall padding */
  border: 1px solid var(--color-border);
}

.price-toggle.open .price-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(-100%);
}

.price-toggle.disabled:hover .price-options,
.price-toggle.disabled .price-options {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-120%) !important;
  pointer-events: none !important;
}

/* Force hide dropdown after selection until mouse leaves */
.price-toggle.closed .price-options {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-120%) !important;
  pointer-events: none !important;
}

.price-option {
  padding: 6px 10px; /* tighter row padding */
  border-radius: 4px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  margin-bottom: 2px; /* reduce inter-item gap */
}
.price-option:last-child { margin-bottom: 0; }

/* Reduce heading gap inside dropdown (overrides Tailwind mb-2) */
.price-options > .text-xs { margin-bottom: 4px !important; }

/* Compact line-height for price rows */
.price-option .font-medium { line-height: 1.2; }
.price-option .text-xs { line-height: 1.2; margin-top: 1px; }

/* Subtlely reduce dropdown price font size for elegance */
.price-options .price-option .font-medium {
  font-size: 0.85rem;
}

.price-option:hover {
  background: var(--color-gray-100);
  color: var(--color-primary);
}

/* Default Image */
.default-image {
  background: var(--color-gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 1.5rem;
}

/* Stock Status */
.stock-available {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.stock-unavailable {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* Global font family override (loaded after Tailwind) */
html, body, button, input, select, textarea {
  font-family: 'PeydaFaNumWeb', system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol' !important;
}

/* Product Card */
.product-card {
  background: white;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

/* In regular product grids (non-carousel), stretch card to grid cell width and center rows */
.product-list-grid .product-card {
  width: 100%;
  min-width: 0;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  border-color: var(--color-border-strong);
}

.product-image-container {
  background: var(--color-gray-50);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  margin: 8px; /* reduce gap around image */
  overflow: hidden;
}

/* Tighter, balanced padding for product card content */
.product-card > .p-4 {
  padding: 12px !important; /* override tailwind p-4 top/bottom to reduce gap */
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Ensure price text is smaller than title by default */
.product-card .price-display {
  font-size: 0.95rem !important;
}

/* Ensure brand chip fits content in product card and doesn't stretch */
.product-card .brand-chip {
  align-self: flex-start;
  width: max-content;
  display: inline-flex;
  gap: 4px;
}

/* Pin price and actions to card bottom when content grows */
.product-card > .p-4 .price-toggle {
  margin-top: auto;
}

/* Modern Button */
.btn-primary {
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
  background: var(--color-primary-600);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 186, 0, 0.3);
}

.btn-secondary {
  background: white;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  padding: 10px 20px;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary:hover {
  background: var(--color-gray-100);
  border-color: var(--color-icon-muted);
  transform: translateY(-1px);
}

/* Notification */
.notification {
  animation: slideInDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Carousel */
.carousel-container {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}

.carousel-container::-webkit-scrollbar {
  display: none;
}

.carousel-wrapper {
  display: flex;
  gap: 10px; /* slightly tighter between cards */
  padding: 0 4px;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.carousel-nav:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.carousel-nav.prev {
  right: 10px;
}

.carousel-nav.next {
  left: 10px;
}

/* Floating Animation */
.floating {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-8px);
  }
}

/* Brand Card */
.brand-card {
  background: white;
  border: 1px solid var(--color-border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 220px;
  flex-shrink: 0;
}

.brand-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.brand-badge {
  background: var(--color-primary);
  color: white;
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 10px;
  position: absolute;
  top: -8px;
  right: -8px;
  font-weight: 600;
  box-shadow: 0 4px 8px rgba(255, 186, 0, 0.3);
}

/* Service Card */
.service-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 20px; /* reduce for better density */
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.service-icon {
  width: 64px;
  height: 64px;
  background: var(--color-gray-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
  color: var(--color-text-muted);
}

/* Story Responsive */
@media (max-width: 768px) {
  .story-scroll {
    justify-content: flex-start;
    padding-right: 16px;
  }
}

/* Mobile density tuning: show exactly 2 product cards in carousels */
@media (max-width: 640px) {
  /* Tighter gaps and container padding */
  .carousel-wrapper { gap: 8px; padding: 0 2px; }

  /* Exactly two cards visible: (100% - gap)/2 */
  .carousel-wrapper .product-card {
    flex: 0 0 calc((100% - 8px) / 2);
    min-width: calc((100% - 8px) / 2);
  }

  /* Tighter image margin and card padding */
  .product-image-container { margin: 6px; }
  .product-card > .p-4 { padding: 10px !important; }

  /* Compact title and spacing (further reduced) */
  .product-card h4 { font-size: 0.9rem; line-height: 1.3; margin-bottom: 0.35rem; }
  .product-card .price-toggle { margin-bottom: 6px !important; }

  /* Price text smaller than title on mobile */
  .product-card .price-display { font-size: 0.85rem; }
  .product-card .price-type, .product-card .old-price { font-size: 0.75rem; }

  /* Buttons: reduce padding/font-size a bit */
  .product-card .btn-primary,
  .product-card .btn-secondary {
    padding: 8px 14px;
    font-size: 0.9rem;
  }

  /* Slightly smaller dropdown price on mobile */
  .price-options .price-option .font-medium { font-size: 0.9rem; }
}


/* ------------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------------ */
@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(2deg);
  }
}
@keyframes pulse-slow {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.05);
  }
}
@keyframes drift {
  0% {
    transform: translateX(0px) translateY(0px);
  }
  25% {
    transform: translateX(10px) translateY(-5px);
  }
  50% {
    transform: translateX(-5px) translateY(-10px);
  }
  75% {
    transform: translateX(-10px) translateY(-5px);
  }
  100% {
    transform: translateX(0px) translateY(0px);
  }
}
.float {
  animation: float 6s ease-in-out infinite;
}
.pulse-slow {
  animation: pulse-slow 4s ease-in-out infinite;
}
.drift {
  animation: drift 8s ease-in-out infinite;
}

/* Custom Scrollbar Styles */
.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: #4b5563 #1f2937;
}

.scrollbar-thin::-webkit-scrollbar {
  width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: #1f2937;
  border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 3px;
  transition: background 0.3s ease;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background: #ffba00;
}

.scrollbar-thumb-gray-600::-webkit-scrollbar-thumb {
  background: #4b5563;
}

.scrollbar-track-gray-800::-webkit-scrollbar-track {
  background: #1f2937;
}

.hover\:scrollbar-thumb-primary:hover::-webkit-scrollbar-thumb {
  background: var(--color-primary);
}

/* Enamad Badge */
.enamad-badge img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
