/*
Theme Name: Ajlal Pro
Theme URI: https://ajlal.com
Author: Ajlal Team
Description: Theme professionnel pour e-commerce multi-vendeur. Compatible WooCommerce + Dokan Pro + Elementor Pro. Style Shein mobile-first, ultra-leger.
Version: 1.6.6
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
License: GPL-2.0
Tags: ecommerce, woocommerce, dokan, elementor, mobile-first, lightweight, rtl-support
*/

/* ============ DESIGN TOKENS — AJLAL PROFESSIONAL ============ */
:root {
  --bg: #ffffff;
  --bg2: #f9f9f9;
  --bg3: #f2f2f2;
  --text: #333333;
  --text2: #777777;
  --primary: #ff8c00;
  --primary-dark: #e67e00;
  --primary-light: #ffa500;
  --accent: #e64f24;
  --gold: #e9a900;
  --border: #dddddd;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow: 0 4px 16px rgba(255,140,0,0.08);
  --shadow-md: 0 12px 32px rgba(255,140,0,0.12);
  --font-ui: 'Poppins','Cairo',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --font-ar: 'Cairo','Poppins',Tahoma,Arial,sans-serif;
  --header-h: 52px;
  --nav-h: 56px;
  color-scheme: light;
}

/* ============ RESET + TYPOGRAPHIE ============ */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{font-size:15px;-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{font-family:var(--font-ui);color:var(--text);background:var(--bg);font-weight:400;line-height:1.55;letter-spacing:-0.006em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}
html[lang^='ar'] body,[dir='rtl'] body,body[dir='rtl']{font-family:var(--font-ar);letter-spacing:0;line-height:1.65}
a{text-decoration:none;color:var(--text)}
img{max-width:100%;height:auto;display:block}
ul,ol{list-style:none}
h1,h2,h3,h4,h5,h6{font-family:var(--font-ui);font-weight:700;line-height:1.28;letter-spacing:-0.025em}
html[lang^='ar'] h1,html[lang^='ar'] h2,html[lang^='ar'] h3,html[lang^='ar'] h4,html[lang^='ar'] h5,html[lang^='ar'] h6,[dir='rtl'] h1,[dir='rtl'] h2,[dir='rtl'] h3,[dir='rtl'] h4,[dir='rtl'] h5,[dir='rtl'] h6{font-family:var(--font-ar);letter-spacing:0}
input,button,select,textarea{font-family:inherit;font-size:inherit;letter-spacing:inherit}
::selection{background:rgba(255,140,0,.18);color:var(--primary-dark)}
:focus-visible{outline:3px solid rgba(255,165,0,.28);outline-offset:2px}

/* ============ CONTAINER ============ */
.container{max-width:100%;padding:0 10px}
.site-main{margin-top:var(--header-h);padding-bottom:0}

/* ============ HEADER (3 colonnes: menu + panier + wishlist) ============ */
.site-header{
  position:fixed;top:0;left:0;right:0;
  height:var(--header-h);
  background:var(--primary);
  display:flex;align-items:center;
  padding:0 10px;
  z-index:1000;
  box-shadow:0 1px 4px rgba(0,0,0,0.1);
}
.header-col{
  display:flex;align-items:center;
  flex:1;
}
.header-col.center{justify-content:center}
.header-col.right{justify-content:flex-end;gap:12px}

.site-logo img{
  height:30px;width:auto;
  filter:brightness(0) invert(1);
}

.header-icon{
  display:flex;align-items:center;justify-content:center;
  width:34px;height:34px;border-radius:50%;
  background:rgba(255,255,255,0.15);
  border:none;cursor:pointer;position:relative;
  color:#fff;font-size:1.1rem;
  transition:background 0.2s;
}
.header-icon:hover{background:rgba(255,255,255,0.25)}
.header-icon .count{
  position:absolute;top:-2px;right:-2px;
  background:var(--accent);color:#fff;
  font-size:0.55rem;font-weight:700;
  min-width:16px;height:16px;border-radius:8px;
  display:flex;align-items:center;justify-content:center;
  padding:0 4px;
}

/* Mobile menu toggle */
.menu-toggle{
  background:none;border:none;color:#fff;
  font-size:1.3rem;cursor:pointer;padding:4px;
}

/* ============ HEADER POPUP (Panier / Wishlist) ============ */
.popup-overlay{
  display:none;position:fixed;top:0;left:0;right:0;bottom:0;
  background:rgba(0,0,0,0.5);z-index:1100;
}
.popup-overlay.active{display:block}
.popup-panel{
  position:fixed;top:0;right:0;bottom:0;
  width:85%;max-width:360px;
  background:var(--bg);z-index:1200;
  transform:translateX(100%);transition:transform 0.3s ease;
  display:flex;flex-direction:column;
}
.popup-panel.active{transform:translateX(0)}
.popup-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:14px;border-bottom:1px solid var(--border);
}
.popup-header h3{font-size:1rem}
.popup-close{
  background:none;border:none;font-size:1.4rem;
  cursor:pointer;color:var(--text2);
}
.popup-body{flex:1;overflow-y:auto;padding:12px}

/* ============ HERO CAROUSEL ============ */
.hero-carousel{
  position:relative;width:100%;height:180px;
  overflow:hidden;background:linear-gradient(135deg,var(--primary),var(--primary-light));
}
.hero-track{display:flex;width:100%;height:100%;transition:transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94)}
.hero-slide{
  min-width:100%;height:100%;
  display:flex;align-items:center;justify-content:center;
  position:relative;overflow:hidden;flex-shrink:0;
}
.hero-slide img{
  position:absolute;top:0;left:0;width:100%;height:100%;
  object-fit:cover;
  animation:zoomIn 0.6s ease;
}
@keyframes zoomIn{from{transform:scale(1.1);opacity:0}to{transform:scale(1);opacity:1}}
.hero-slide .slide-overlay{
  position:absolute;top:0;left:0;width:100%;height:100%;
  background:linear-gradient(135deg,rgba(6,61,56,0.7),rgba(255,140,0,0.4));z-index:1;
}
.hero-slide .slide-content{
  position:relative;z-index:2;text-align:center;padding:0 20px;color:#fff;
}
.hero-slide .slide-content h1{font-size:1.2rem;text-shadow:0 1px 4px rgba(0,0,0,0.2)}
.hero-slide .slide-content h1 span{display:block;font-size:0.75rem;font-weight:400;opacity:0.9;margin-top:4px}
.carousel-dots{
  position:absolute;bottom:8px;left:50%;transform:translateX(-50%);
  display:flex;gap:4px;z-index:3;
}
.carousel-dots span{
  width:5px;height:5px;border-radius:50%;
  background:rgba(255,255,255,0.5);transition:all 0.3s;
}
.carousel-dots span.active{background:#fff;width:16px;border-radius:3px}

/* ============ CATEGORIES CAROUSEL ============ */
.cat-carousel{
  border-bottom:1px solid var(--border);
  background:var(--bg);
}
.cat-carousel-inner{
  display:flex;overflow-x:auto;gap:0;
  padding:10px 0;-webkit-overflow-scrolling:touch;
  scroll-snap-type:x mandatory;
}
.cat-carousel-inner::-webkit-scrollbar{display:none}
.cat-item{
  display:flex;flex-direction:column;align-items:center;
  min-width:64px;padding:4px 8px;text-align:center;
  font-size:0.65rem;color:var(--text);
  scroll-snap-align:start;flex-shrink:0;
  position:relative;
}
.cat-item .cat-icon{
  width:46px;height:46px;border-radius:50%;
  background:var(--bg3);margin-bottom:4px;
  display:flex;align-items:center;justify-content:center;
  font-size:1.3rem;overflow:hidden;
  transition:all 0.2s;
}
.cat-item .cat-icon img{width:100%;height:100%;object-fit:cover;border-radius:50%}
.cat-item.active .cat-icon{border:2px solid var(--primary)}
.cat-item.active{color:var(--primary);font-weight:600}

/* ============ SECTION TITLE ============ */
.section-title{
  display:flex;justify-content:space-between;align-items:center;
  padding:14px 0 8px;
}
.section-title h2{font-size:0.92rem;color:var(--text);font-weight:700}
.section-title a{font-size:0.7rem;color:var(--primary);font-weight:600}

/* ============ PRODUCTS GRID (Shein: 2 colonnes mobile) ============ */
.products-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:6px;
  padding-bottom:12px;
}

.product-card{
  background:var(--bg);
  border-radius:var(--radius);
  overflow:hidden;
  position:relative;
  transition:transform 0.2s,box-shadow 0.2s;
}
.product-card:active{transform:scale(0.98)}
.product-card .product-image{
  position:relative;width:100%;padding-top:125%;
  background:var(--bg2);overflow:hidden;
}
.product-card .product-image img{
  position:absolute;top:0;left:0;width:100%;height:100%;
  object-fit:cover;
  transition:transform 0.4s;
}
.product-card:hover .product-image img{transform:scale(1.05)}

.product-card .product-badge{
  position:absolute;top:4px;left:4px;
  background:var(--primary);color:#fff;
  font-size:0.55rem;font-weight:700;
  padding:2px 6px;border-radius:3px;z-index:2;
}
.product-card .product-badge.sale{background:var(--accent)}
.product-card .product-badge.bio{background:var(--primary-dark)}
.product-card .product-badge.new{background:var(--primary-light)}

.product-card .wishlist-btn{
  position:absolute;top:4px;right:4px;
  width:26px;height:26px;border-radius:50%;
  background:rgba(255,255,255,0.85);
  border:none;display:flex;align-items:center;justify-content:center;
  font-size:0.8rem;cursor:pointer;z-index:2;
  transition:all 0.2s;
}
.product-card .wishlist-btn:hover{background:#fff}
.product-card .wishlist-btn.active{color:#ff2d55}

.product-card .product-info{padding:6px 6px 8px}
.product-card .vendor-name{
  font-size:0.56rem;color:var(--text2);
  text-transform:uppercase;letter-spacing:0.3px;
  margin-bottom:2px;
}
.product-card .product-title{
  font-size:0.72rem;font-weight:400;
  color:var(--text);line-height:1.35;
  display:-webkit-box;-webkit-line-clamp:2;
  -webkit-box-orient:vertical;overflow:hidden;
  margin-bottom:4px;min-height:1.9em;
}
.product-card .product-price{
  display:flex;align-items:baseline;gap:4px;flex-wrap:wrap;
}
.product-card .price-now{
  font-size:0.85rem;font-weight:700;color:var(--primary);
}
.product-card .price-was{
  font-size:0.6rem;color:var(--text2);text-decoration:line-through;
}
.product-card .discount-pct{
  font-size:0.55rem;color:var(--accent);font-weight:700;
  background:#FFF3E0;padding:1px 4px;border-radius:3px;
}

/* Add to cart button */
.product-card .add-cart-btn{
  display:block;width:100%;
  padding:6px;background:var(--primary);color:#fff;
  border:none;border-radius:0 0 var(--radius) var(--radius);
  font-size:0.68rem;font-weight:600;cursor:pointer;
  text-align:center;transition:background 0.2s;
}
.product-card .add-cart-btn:hover{background:var(--primary-dark)}

/* ============ PROMO STRIP ============ */
.promo-strip{
  display:grid;grid-template-columns:repeat(4,1fr);
  gap:1px;background:var(--border);margin:10px 0;
  border-radius:var(--radius);overflow:hidden;
}
.promo-strip div{
  background:var(--bg);text-align:center;padding:8px 4px;
  font-size:0.58rem;color:var(--text2);
}
.promo-strip div .p-icon{font-size:0.85rem;margin-bottom:2px;color:var(--primary)}

/* ============ BANNERS DOUBLE ============ */
.banners-double{
  display:grid;grid-template-columns:1fr 1fr;gap:6px;
  padding:8px 0;
}
.banner-card{
  height:100px;border-radius:var(--radius);
  display:flex;align-items:flex-end;padding:10px;
  position:relative;overflow:hidden;
}
.banner-card:first-child{background:linear-gradient(135deg,var(--primary),var(--primary-light))}
.banner-card:last-child{background:linear-gradient(135deg,var(--accent),#ff9a5c)}
.banner-card .banner-text{color:#fff;font-size:0.7rem;font-weight:700}

/* ============ NEWSLETTER ============ */
.newsletter{
  background:var(--bg3);padding:20px 10px;text-align:center;
  margin:12px 0;border-radius:var(--radius);
}
.newsletter h2{font-size:1rem;color:var(--primary);margin-bottom:4px}
.newsletter p{font-size:0.78rem;color:var(--text2);margin-bottom:12px}
.newsletter form{display:flex;gap:6px}
.newsletter input{
  flex:1;padding:10px 12px;border:1px solid var(--border);
  border-radius:20px;font-size:0.82rem;outline:none;
}
.newsletter button{
  background:var(--primary);color:#fff;border:none;
  padding:10px 16px;border-radius:20px;font-size:0.78rem;
  font-weight:600;cursor:pointer;
}

/* ============ FOOTER (desktop) ============ */
.site-footer{
  background:var(--primary);color:#fff;
  padding:24px 10px;
}
.footer-grid{
  display:grid;grid-template-columns:repeat(2,1fr);gap:16px;
}
.footer-grid h4{font-size:0.85rem;margin-bottom:8px}
.footer-grid a,.footer-grid p{font-size:0.72rem;color:rgba(255,255,255,0.8);line-height:1.6}
.footer-bottom{
  text-align:center;padding-top:12px;margin-top:12px;
  border-top:1px solid rgba(255,255,255,0.2);
  font-size:0.65rem;color:rgba(255,255,255,0.6);
}

/* ============ MOBILE BOTTOM NAV (5 icônes) ============ */
.mobile-nav{
  display:none;
  position:fixed;
  bottom:0;
  left:0;
  right:0;
  width:100%;
  background:#fff;
  border-top:1px solid #e8e8e8;
  box-shadow:0 -2px 10px rgba(0,0,0,0.08);
  z-index:9999;
  justify-content:space-around;
  align-items:center;
  padding:6px 0 8px;
  height:60px;
}
.mobile-nav a,.mobile-nav .nav-btn{
  display:flex;
  flex-direction:column;
  align-items:center;
  font-size:0.58rem;
  color:#ff8c00;
  padding:4px 6px;
  position:relative;
  text-decoration:none;
  background:none;
  border:none;
  cursor:pointer;
  font-family:inherit;
  line-height:1.1;
}
.mobile-nav .nav-icon{
  width:20px;
  height:20px;
  margin-bottom:2px;
  display:block;
}
/* Accueil Recherche Compte = #ff8c00 */
.mobile-nav a svg:not(.whatsapp-icon):not(.instagram-icon){
  stroke:#ff8c00;
  stroke-width:2;
}
/* Active state */
.mobile-nav a.active,.mobile-nav .nav-btn.active{
  color:#ff8c00;
  font-weight:700;
}
.mobile-nav a.active::before,.mobile-nav .nav-btn.active::before{
  content:'';
  position:absolute;
  top:0;
  left:50%;
  transform:translateX(-50%);
  width:20px;
  height:2px;
  background:#ff8c00;
  border-radius:1px;
}
/* WhatsApp = vert officiel */
.whatsapp-icon{fill:#25D366!important}
/* Instagram = rose officiel */
.instagram-icon rect{fill:#E4405F!important}
.instagram-icon circle{fill:#fff;stroke:#fff}

/* ============ SEARCH OVERLAY ============ */
.search-overlay{
  display:none;position:fixed;top:0;left:0;width:100%;height:100%;
  background:rgba(0,0,0,0.5);z-index:1000;
  align-items:flex-start;justify-content:center;
  opacity:0;transition:opacity 0.3s;
}
.search-overlay.active{display:flex;opacity:1}
.search-panel{
  background:#fff;width:100%;max-width:420px;
  border-radius:0 0 var(--radius) var(--radius);
  box-shadow:0 4px 20px rgba(0,0,0,0.15);
  transform:translateY(-100%);transition:transform 0.3s;
  position:absolute;top:0;
}
.search-overlay.active .search-panel{transform:translateY(0)}
.search-header{
  display:flex;justify-content:space-between;align-items:center;
  padding:14px 16px;border-bottom:1px solid var(--border);
}
.search-header h3{font-size:1rem;color:var(--primary)}
.search-close{
  background:none;border:none;font-size:1.5rem;color:var(--text2);cursor:pointer;
  padding:0;width:30px;height:30px;display:flex;align-items:center;justify-content:center;
}
.search-body{padding:16px}
.search-body form{display:flex;gap:8px}
.search-body input[type="search"]{
  flex:1;padding:10px 14px;border:1.5px solid var(--border);border-radius:8px;
  font-size:0.9rem;outline:none;background:var(--bg2);
}
.search-body input[type="search"]:focus{border-color:var(--primary)}
.search-body button{
  padding:10px 18px;background:var(--primary);color:#fff;border:none;
  border-radius:8px;font-size:0.85rem;font-weight:600;cursor:pointer;
}

/* ============ SHOP LAYOUT ============ */
.shop-layout{display:grid;gap:12px;padding:8px 0}
.shop-sidebar{display:none}
.shop-content{width:100%}
.shop-bar{
  display:flex;justify-content:space-between;align-items:center;
  padding:8px 0;border-bottom:1px solid var(--border);margin-bottom:8px;
  font-size:0.75rem;color:var(--text2);
}

/* ============ SINGLE PRODUCT ============ */
.single-product{padding:8px 0}
.single-product .product-gallery{margin-bottom:12px;border-radius:var(--radius);overflow:hidden}
.single-product .product-summary h1{font-size:1.1rem;margin-bottom:8px;font-weight:600}
.single-product .price{font-size:1.3rem;font-weight:700;color:var(--primary);margin-bottom:12px}
.single-product .product-description{font-size:0.85rem;line-height:1.6;color:var(--text);margin-bottom:16px}

/* ============ MON COMPTE (Social Login) ============ */
.account-page{max-width:400px;margin:0 auto;padding:24px 10px}
.account-page h1{font-size:1.2rem;text-align:center;margin-bottom:16px;color:var(--primary)}
.social-login{display:flex;flex-direction:column;gap:10px;margin-bottom:20px}
.social-btn{
  display:flex;align-items:center;justify-content:center;gap:8px;
  width:100%;padding:12px;border:1px solid var(--border);
  border-radius:8px;font-size:0.85rem;font-weight:600;
  cursor:pointer;background:#fff;transition:all 0.2s;
}
.social-btn:hover{background:var(--bg2)}
.social-btn.google{color:#4285F4;border-color:#4285F4}
.social-btn.facebook{color:#1877F2;border-color:#1877F2}
.social-btn .s-icon{font-size:1.1rem}
.account-divider{
  display:flex;align-items:center;gap:10px;
  margin:16px 0;color:var(--text2);font-size:0.75rem;
}
.account-divider::before,.account-divider::after{
  content:'';flex:1;height:1px;background:var(--border);
}

/* ============ MY ACCOUNT TABS ============ */
.my-account-wrapper{padding:10px 0}
.my-account-wrapper nav.woocommerce-MyAccount-navigation{
  display:flex;overflow-x:auto;border-bottom:1px solid var(--border);
  margin-bottom:12px;gap:12px;-webkit-overflow-scrolling:touch;
}
.my-account-wrapper nav.woocommerce-MyAccount-navigation a{
  padding:8px 0;font-size:0.78rem;color:var(--text2);
  white-space:nowrap;border-bottom:2px solid transparent;
}
.my-account-wrapper nav.woocommerce-MyAccount-navigation a.is-active{
  color:var(--primary);border-bottom-color:var(--primary);font-weight:600;
}
.my-account-wrapper .woocommerce-MyAccount-content{
  font-size:0.85rem;line-height:1.6;
}
.woocommerce-MyAccount-content form{display:flex;flex-direction:column;gap:10px}
.woocommerce-MyAccount-content form input{
  padding:12px;border:1px solid var(--border);border-radius:8px;
  font-size:0.88rem;outline:none;
}
.woocommerce-MyAccount-content form input:focus{border-color:var(--primary)}
.woocommerce-MyAccount-content form button{
  background:var(--primary);color:#fff;border:none;
  padding:12px;border-radius:8px;font-size:0.88rem;
  font-weight:600;cursor:pointer;
}

/* ============ WOOCOMMERCE DEFAULT OVERRIDES ============ */
.woocommerce .products ul.products{
  display:grid;grid-template-columns:repeat(2,1fr);gap:6px;
}
.woocommerce ul.products li.product{margin:0!important;padding:0!important;width:auto!important}
.woocommerce nav.woocommerce-pagination{text-align:center;padding:16px 0}
.woocommerce nav.woocommerce-pagination .page-numbers{display:inline-flex;gap:6px}
.woocommerce nav.woocommerce-pagination .page-numbers a,
.woocommerce nav.woocommerce-pagination .page-numbers span{
  display:inline-flex;align-items:center;justify-content:center;
  width:32px;height:32px;border:1px solid var(--border);
  border-radius:50%;font-size:0.8rem;
}
.woocommerce nav.woocommerce-pagination .page-numbers span.current{background:var(--primary);color:#fff;border-color:var(--primary)}

/* Cart widget */
.woocommerce-mini-cart-item{padding:8px 0;border-bottom:1px solid var(--border)}
.widget_shopping_cart .total{font-size:1rem;font-weight:700;color:var(--primary);padding:10px 0}

/* ============ DOKAN OVERRIDES ============ */
.dokan-dashboard{max-width:100%}
.dokan-store-header{border-radius:var(--radius);overflow:hidden;margin-bottom:12px}

/* ============ BUTTONS ============ */
.btn{
  display:inline-block;padding:10px 20px;
  border-radius:8px;font-weight:600;font-size:0.82rem;
  cursor:pointer;text-align:center;border:none;
  transition:all 0.2s;
}
.btn-primary{background:var(--primary);color:#fff}
.btn-primary:hover{background:var(--primary-dark)}
.btn-outline{background:transparent;border:1.5px solid var(--primary);color:var(--primary)}

/* ============ ELEMENTOR COMPATIBILITY ============ */
.elementor-widget-container{box-sizing:border-box}
.elementor .products-grid{grid-template-columns:repeat(2,1fr)}

/* ============ RTL SUPPORT ============ */
[dir="rtl"] .header-col.right{flex-direction:row-reverse}
[dir="rtl"] .product-card .product-badge{left:auto;right:4px}
[dir="rtl"] .product-card .wishlist-btn{right:auto;left:4px}

/* ============ TABLET ============ */
@media(min-width:600px){
  .products-grid{grid-template-columns:repeat(3,1fr);gap:10px}
  .woocommerce .products ul.products{grid-template-columns:repeat(3,1fr)}
  .promo-strip{grid-template-columns:repeat(4,1fr)}
  .hero-carousel{height:240px}
}

/* ============ DESKTOP ============ */
@media(min-width:992px){
  .container{max-width:1200px;margin:0 auto}
  .products-grid{grid-template-columns:repeat(4,1fr);gap:14px}
  .woocommerce .products ul.products{grid-template-columns:repeat(4,1fr)}
  .shop-layout{grid-template-columns:240px 1fr}
  .shop-sidebar{display:block}
  .footer-grid{grid-template-columns:repeat(4,1fr)}
  .hero-carousel{height:400px}
  .hero-slide .slide-content h1{font-size:2.2rem}
  .cat-item{min-width:80px}
  .cat-item .cat-icon{width:56px;height:56px}
}

/* ============ LARGE DESKTOP ============ */
@media(min-width:1200px){
  .container{max-width:1400px}
  .products-grid{grid-template-columns:repeat(5,1fr)}
  .woocommerce .products ul.products{grid-template-columns:repeat(5,1fr)}
}

/* ============ MOBILE NAV VISIBILITY ============ */
@media(max-width:768px){
  .mobile-nav{display:flex!important}
  body{padding-bottom:65px}
  .site-main{margin-top:var(--header-h)}
}

/* ============ SAFE AREA (iPhone) ============ */
@supports(padding-bottom:env(safe-area-inset-bottom)){
  .mobile-nav{
    padding-bottom:calc(8px + env(safe-area-inset-bottom));
    height:calc(60px + env(safe-area-inset-bottom));
  }
  .site-footer{padding-bottom:calc(65px + env(safe-area-inset-bottom) + 16px)}
}
