/* ============================================
   DESKTOP HEADER - 2 LINES LAYOUT
   ============================================ */

/* Top Bar */
.desktop-bar .top-bar .container {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 100px !important;
  margin-bottom: 72px !important;
}

.top-bar {
  height: 100px !important;
}

.desktop-bar .top-bar-left,
.desktop-bar .top-bar-center,
.desktop-bar .top-bar-right {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-items: center !important;
  max-width: 600px;
}
.top-bar-center {
  flex: 1;
}

.top-bar-center .header-element {
  width: 100% !important;
}

.desktop-bar .top-bar-left {
  flex: 0 0 200px;
  flex-wrap: nowrap;
}

.desktop-bar .top-bar-center {
  margin: 0 20px;
}

.desktop-bar .top-bar-right {
  flex: 0 0 auto;
}

/* ============================================
   SEARCH FORM INLINE
   ============================================ */

.search-form-inline {
  width: 100%;
}

.search-input-inline {
  display: flex;
  align-items: center;
  background: transparent;
  border: none; /* No border on container */
  border-radius: 25px;
  padding: 0;
  position: relative;
}

@media (max-width: 768px) {
  .desktop-bar .top-bar-left {
    flex: 0 0 70px;
  }
}

.search-input-inline input {
  flex: 1;
  border: 2px solid #e38b29 !important; /* Orange border on input */
  background: transparent;
  padding: 10px 15px;
  padding-right: 55px !important; /* Space for button on the right */
  font-size: 14px;
  text-align: right;
  direction: rtl;
  outline: none;
  width: 100%;
  border-radius: 25px;
}

.search-input-inline input:focus {
  outline: none;
  border-color: #d17a1f; /* Darker orange on focus */
}

.search-input-inline button {
  position: absolute;
  right: 8px; /* Position on the right inside input */
  top: 50%;
  transform: translateY(-50%);
  background: #e38b29;
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  outline: none;
  transition: transform 0.2s ease, background 0.2s ease;
}

.search-input-inline button:hover {
  transform: translateY(-50%) scale(1.05);
  background: #d17a1f;
}

.search-input-inline button:focus {
  outline: none;
}
/* ============================================
   NAVIGATION BAR - TAN/BEIGE BACKGROUND
   ============================================ */

.desktop-bar .navigation-bar {
  padding: 12px 0;
  position: relative;
  height: 72px;
  background-color: #c79e6c;
}

.desktop-bar .navigation-bar .header-list {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 40px;
  margin: 0;
  padding: 0;
  direction: rtl;
  list-style: none;
}

.desktop-bar .navigation-bar .header-list li {
  list-style: none;
  position: relative;
}

.desktop-bar .navigation-bar .header-list li a {
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  color: #ffffff;

  display: inline-block;
  transition: all 0.3s ease;
  border-radius: 6px;

  /* حل المشكلة: إزالة أي outline أو background غير مرغوب */
  outline: none !important;
  background: transparent;
  border: none;
  box-shadow: none !important;
}

/* Hover Effect للروابط الرئيسية */
.desktop-bar .navigation-bar .header-list li a:hover {
  color: #ffffff;
  transform: translateY(-2px);
  outline: none !important;
  background: transparent;
  border: none;
  box-shadow: none !important;
}

.desktop-bar .navigation-bar .header-list li a:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* ============================================
   DROPDOWN MEGA MENU - CLEAN & MODERN
   ============================================ */
/* ============================================
   DROPDOWN MEGA MENU - FULL WIDTH FIX
   ============================================ */
/* ============================================
   DROPDOWN MEGA MENU - CLICK TO TOGGLE
   ============================================ */
/* ============================================
   DROPDOWN MEGA MENU - FULL WIDTH WITHOUT SHIFT
   ============================================ */

.has-dropdown {
  position: static !important; /* Keep it static so dropdown can span full width */
}

.dropdown-mega-menu {
  position: absolute;
  top: 100%; /* Position below the navigation bar */
  left: 0; /* Start from left edge */
  right: 0; /* Extend to right edge */
  width: 100%;
  background: #ffffff;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px); /* Only vertical animation */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0 !important;
  padding: 0 !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  border: none;
  outline: none;
  pointer-events: none;
}

/* Show dropdown when active OR hover */
.has-dropdown.active .dropdown-mega-menu,
.has-dropdown:hover .dropdown-mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0); /* Only slide down, no horizontal shift */
  pointer-events: auto;
}

/* Visual indicator for active state */
.has-dropdown.active > a {
  color: #ffdf6d !important;
  background: rgba(199, 158, 108, 0.1);
  border-radius: 4px;
}

.mega-menu-wrapper {
  max-width: 100%;
  width: 100%;
  padding: 20px 0; /* Vertical padding only */
  margin: 0;
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px 20px;
  direction: rtl;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto; /* Center the grid content */
  padding: 0 20px; /* Add horizontal padding to the grid itself */
}

/* Mega menu items */
.mega-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #2c2c2c !important;
  font-size: 16px;
  text-decoration: none;
  padding: 12px 18px;
  border-radius: 8px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: "Cairo", sans-serif;
  text-align: right;
  position: relative;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.mega-menu-item:hover {
  background: #f8f5f0 !important;
  color: #c79e6c !important;
  transform: translateX(+5px);
  box-shadow: 0 2px 8px rgba(199, 158, 108, 0.1) !important;
}

.mega-menu-item:focus,
.mega-menu-item:active {
  outline: none !important;
  box-shadow: none !important;
  background: #f8f5f0 !important;
}

.mega-menu-arrow {
  font-size: 16px;
  color: #c79e6c;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: bold;
  display: inline-block;
}

.mega-menu-item:hover .mega-menu-arrow {
  transform: translateX(-2px);
  color: #a67c52;
}

.mega-menu-item::before {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 60%;
  background: linear-gradient(to bottom, #c79e6c, #a67c52);
  border-radius: 4px;
  transition: width 0.25s ease;
}

.mega-menu-item:hover::before {
  width: 4px;
}

/* Make sure the navigation bar is positioned relative */
.navigation-bar {
  position: relative;
}

/* Responsive adjustments */
@media (max-width: 1124px) {
  .desktop-bar {
    display: block !important;
  }
  .header-list {
    gap: 10px !important;
  }

  .mega-menu-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .mega-menu-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 15px;
  }
}

@media (max-width: 480px) {
  .desktop-bar .navigation-bar .header-list li a {
    font-size: 12px;
    padding: 8px;
  }
  .header-list {
    gap: 4px !important;
  }
  .mega-menu-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 10px;
    padding: 0 10px;
  }

  .mega-menu-item {
    font-size: 14px;
    padding: 10px 14px;
  }
}
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/
/********************/

.cart-icon {
  margin-top: auto;
  margin-bottom: auto;
  height: 24px;
}

/* Force le background orange sur le cart-switcher */
.cart-switcher {
  background-color: #e38b29 !important;
  color: white !important;
}

/* Force tous les textes enfants à être blancs */
.cart-switcher * {
  color: white !important;
}

/* Force spécifiquement l'icône à être blanche */
.cart-switcher .cart-icon i {
  color: white !important;
}

/* Force les éléments de prix à être blancs */
.cart-switcher .currency-value,
.cart-switcher .currency-value .value,
.cart-switcher .currency-value .currency {
  color: white !important;
}

/* Force le compteur à être blanc aussi */
.cart-switcher .cart-count {
  color: white !important;
}

.overlay .side-navigation {
  z-index: 50 !important;
}

.category-sort li a.active {
  color: #fff !important;
  background: #ff7a00 !important;
  border-radius: 4px;
  padding: 0px 20px;
}

/* Out of Stock Overlay */
.out-of-stock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.out-of-stock-bar {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.out-of-stock-icon {
  color: #e30613;
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
}

.out-of-stock-text {
  color: #000000;
  font-weight: bold;
  font-size: 20px;
  font-family: "Cairo", sans-serif;
}

/* Force price styling */
.product-price {
  display: flex;
  align-items: baseline !important;
  justify-content: center;
  gap: 12px;
}

.product-price .currency-value-new.before {
  color: #e30613 !important;
  font-weight: bold !important;
  font-size: 20px !important;
  text-decoration: none;
  padding: auto;
}

.product-price .currency-value-new.before .value,
.product-price .currency-value-new.before .currency {
  color: #e30613 !important;
}

.product-price .currency-value-old.after {
  color: #999999 !important;
  text-decoration: line-through !important;
  font-size: 16px !important;
  padding: auto;
}

.product-price .currency-value-old.after .value,
.product-price .currency-value-old.after .currency {
  color: #999999 !important;
}

/* When there's no old price */
.product-price .currency-value.after:not(.currency-value-old) {
  color: #e30613 !important;
  font-weight: bold !important;
  font-size: 20px !important;
  text-decoration: none;
}

.product-price .currency-value.after:not(.currency-value-old) .value,
.product-price .currency-value.after:not(.currency-value-old) .currency {
  color: #e30613 !important;
  text-decoration: none;
}

.product-price .before,
.product-price .after {
  display: inline-flex !important;
  width: auto !important;
}
/* Discount Badge */
.product-item {
  position: relative;
}

.product-thumbnail {
  position: relative;
  display: block;
}

.discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #e30613;
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 5px;
  border: 2px solid #ffffff;
  font-weight: bold;
  font-size: 13px;
  z-index: 2;

  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-family: "Cairo", sans-serif;
}

/* Product Info Reorder */
.product-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.product-title {
  order: 1;
  margin-bottom: 10px;
}

.product-price {
  order: 2;
  margin-top: 5px;
  flex-direction: row !important;
}

.category-sort a .yc {
  left: 2px !important;
}

.c

/* Out of Stock Overlay */
.out-of-stock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.out-of-stock-bar {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.out-of-stock-icon {
  color: #e30613;
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
}

.out-of-stock-text {
  color: #000000;
  font-weight: bold;
  font-size: 20px;
  font-family: "Cairo", sans-serif;
}

/* Base styles */
.carousel-inner .carousel-item,
.carousel-inner .item {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
}

.slider-desktop,
.slider-mobile {
  position: absolute;
  top:0; left:0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Show desktop by default */
   .desktop-img { display: block; }
    .mobile-img { display: none; }

/* Mobile override */
@media (max-width: 767px) {
  .carousel-inner .carousel-item,
  .carousel-inner .item { max-height: 400px; }
  

}

@media (max-width: 767px) {
    .desktop-img { display: none; }
    .mobile-img { display: block; }
}



@media (max-width: 767px) {
    /* Reset carousel-item and item */
    .carousel-inner .carousel-item,
    .carousel-inner .item   .carousel-item .item .active{
        all: unset;         /* remove all previous CSS */
        width: 100%;
        height: auto;       /* natural height */
        position: relative; /* to keep text positioning */
    }

    /* Remove overlay on mobile */
    .carousel-inner .bs-slider-overlay {
        display: none !important;
    }

    /* Make sure text stays visible and positioned normally */
    .slide-text {
        position: relative !important;
        transform: none !important;
        text-align: center !important;
        margin: 10px auto;
        z-index: 2;
    }
}

/* Mobile Navigation - Categories Submenu */
.has-submenu {
  position: relative;
}

.has-submenu > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.submenu-arrow {
  transition: transform 0.3s ease;
  font-size: 14px;
}

.has-submenu.active .submenu-arrow {
  transform: rotate(180deg);
}

.submenu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  background-color: rgba(0, 0, 0, 0.05);
}

.submenu-list.active {
  max-height: 1000px;
}

.submenu-list li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.submenu-list li:last-child {
  border-bottom: none;
}

.submenu-list li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px 12px 40px;
  color: #666;
  text-decoration: none;
  font-size: 15px;
  transition: all 0.3s ease;
  font-family: "Cairo", sans-serif;
}

.submenu-list li a:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #000;
  padding-right: 35px;
}

.submenu-arrow-icon {
  color: #c79e6c;
  font-size: 14px;
}

.page-wrapper {
  padding-top: 72px !important;
}

/* Extra Small Mobile (below 480px) */
@media (max-width: 480px) {
  .page-wrapper {
    padding-top: 32px !important;
    overflow-x: hidden !important;
  }

  .desktop-bar .navigation-bar {
    height: 32px !important;
  }
}

@media (max-width: 1124px) {
  .container {
    padding: 0 16px !important;
  }
}

/* Fix for product detail page images - A4 Dimensions */
.product-preview .preview {
  width: 100% !important;
  max-width: 600px !important; /* A4 width */
  min-height: 848px !important; /* A4 height (600px * 1.414) */
  height: auto !important;
}

/* For tablet */
@media (max-width: 992px) {
  .product-preview .preview {
    max-width: 500px !important;
    min-height: 707px !important; /* 500px * 1.414 */
  }
}

/* For mobile responsiveness */
@media (max-width: 768px) {
  .product-preview .preview {
    max-width: 400px !important;
    min-height: 566px !important; /* 400px * 1.414 */
  }
}

/* For small mobile */
@media (max-width: 480px) {
  .product-preview .preview {
    max-width: 300px !important;
    min-height: 424px !important; /* 300px * 1.414 */
  }
}

#p_description img {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* ==========================================
   SELECT STYLING - SAFARI & IPHONE OPTIMIZED
   ========================================== */

select {
    /* Reset de base */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    /* Styling de base */
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 40px 10px 12px;
    font-size: 16px; /* CRITIQUE pour iOS - empêche le zoom auto */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    line-height: 1.5;
    color: #333;
    width: 100%;
    
    /* Comportement tactile */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    
    /* Flèche personnalisée */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    
    /* Transitions douces */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    
    /* Performance */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* État focus */
select:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* État disabled */
select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Hover sur desktop seulement */
@media (hover: hover) {
    select:hover:not(:disabled) {
        border-color: #999;
    }
}

/* CRUCIAL: Optimisations iPhone/iPad */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    select {
        /* Force le renderer natif sur iOS */
        -webkit-appearance: none;
    }
    
    select:focus {
        /* Améliore le rendu sur iOS */
        font-size: 16px !important;
    }
}

/* Fix pour iPhone X et plus récents */
@supports (padding: max(0px)) {
    select {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(40px, env(safe-area-inset-right));
    }
}

/* Responsive - Tablettes */
@media (max-width: 1024px) {
    select {
        font-size: 16px; /* Maintient 16px pour éviter zoom */
        padding: 12px 40px 12px 14px;
    }
}

/* Responsive - Mobile */
@media (max-width: 767px) {
    select {
        font-size: 16px !important; /* IMPORTANT: empêche zoom auto */
        padding: 14px 40px 14px 14px;
        border-radius: 8px;
        min-height: 48px; /* Meilleur pour le touch */
    }
}

/* Fix pour mode sombre iOS */
@media (prefers-color-scheme: dark) {
    select {
        background-color: #1c1c1e;
        border-color: #38383a;
        color: #fff;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23fff' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    }
    
    select option {
        background-color: #1c1c1e;
        color: #fff;
    }
}

/* Container du select (optionnel) */
.checkout-select {
    position: relative;
    display: block;
}

.checkout-select select {
    cursor: pointer;
}

/* Fix pour Safari 15+ */
@supports (-webkit-backdrop-filter: blur(1px)) {
    select {
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
}
