/* =====================================================
   PRESTIGE PERFUMS — Thème Beige & Grenat v2
   ===================================================== */

:root {
  --garnet:       #722F37;
  --garnet-light: #9B4451;
  --garnet-dark:  #4E1F26;
  --beige:        #F5EFE6;
  --beige-mid:    #EDE5D8;
  --cream:        #FAF7F2;
  --gold:         #C9A84C;
  --gold-light:   #E8D08A;
  --black:        #1A1215;
  --dark:         #2D1F22;
  --dark-2:       #4a3338;
  --white:        #FFFFFF;
  --gray:         #8A7F82;
  --border:       #E0D5CC;
  --success:      #16a34a;
  --error:        #dc2626;
  --warning:      #d97706;
  --info:         #2563eb;
  --font-serif:   'Cormorant Garamond','Playfair Display',Georgia,serif;
  --font-sans:    'Jost','Inter',-apple-system,sans-serif;
  --font-ar:      'Cairo','Noto Sans Arabic',sans-serif;
  --radius:       8px;
  --radius-lg:    14px;
  --shadow:       0 4px 20px rgba(114,47,55,0.08);
  --shadow-lg:    0 16px 48px rgba(0,0,0,0.14);
  --transition:   all 0.28s cubic-bezier(0.4,0,0.2,1);
  --header-h:     150px; /* topbar ~36px + body ~68px + border */
}

/* ---- Reset ---- */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html { scroll-behavior:smooth; }
body { font-family:var(--font-sans); background:var(--cream); color:var(--black); line-height:1.7; font-size:15px; overflow-x:hidden; }
body[dir="rtl"] { font-family:var(--font-ar); }
img { max-width:100%; height:auto; display:block; }
a { color:inherit; text-decoration:none; transition:var(--transition); }
ul { list-style:none; }
button { cursor:pointer; border:none; background:none; font-family:inherit; }
input,select,textarea { font-family:inherit; font-size:14px; outline:none; }
h1,h2,h3,h4,h5 { font-family:var(--font-serif); font-weight:600; line-height:1.3; letter-spacing:0.02em; }
body[dir="rtl"] h1,body[dir="rtl"] h2,body[dir="rtl"] h3,body[dir="rtl"] h4 { font-family:var(--font-ar); letter-spacing:0; }

/* ---- Layout helpers ---- */
.container { max-width:1280px; margin:0 auto; padding:0 24px; }
.section { padding:80px 0; }
.grid { display:grid; gap:24px; }
.grid-2 { grid-template-columns:repeat(2,1fr); }
.grid-3 { grid-template-columns:repeat(3,1fr); }
.grid-4 { grid-template-columns:repeat(4,1fr); }

/* ---- Typography ---- */
.section-title { font-size:2rem; color:var(--dark); position:relative; display:inline-block; margin-bottom:1rem; }
/* .section-title::after { content:''; position:absolute; bottom:-8px; left:0; width:56px; height:2px; background:var(--garnet); }
body[dir="rtl"] .section-title::after { left:auto; right:0; } */
.section-header-center{display: flex; align-items: center; flex-direction: column; justify-content: center;}

/* ============================
   BUTTONS
   ============================ */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:11px 26px; border-radius:var(--radius); font-size:13px; font-weight:500; letter-spacing:0.06em; text-transform:uppercase; transition:var(--transition); white-space:nowrap; border:1.5px solid transparent; }
.btn-primary { background:var(--garnet); color:var(--white); border-color:var(--garnet); box-shadow:0 4px 14px rgba(114,47,55,0.28); }
.btn-primary:hover { background:var(--garnet-dark); box-shadow:0 8px 22px rgba(114,47,55,0.38); transform:translateY(-1px); }
.btn-outline { background:transparent; color:var(--garnet); border-color:var(--garnet); }
.btn-outline:hover { background:var(--garnet); color:var(--white); }
.btn-gold { background:var(--gold); color:var(--dark); border-color:var(--gold); font-weight:600; }
.btn-gold:hover { background:var(--gold-light); }
.btn-dark { background:var(--dark); color:var(--white); border-color:var(--dark); }
.btn-dark:hover { background:var(--garnet); border-color:var(--garnet); }
.btn-sm { padding:7px 14px; font-size:12px; }
.btn-lg { padding:14px 36px; font-size:14px; }
.btn-block { width:100%; }

/* ============================
   FORMS
   ============================ */
.form-group { margin-bottom:16px; }
.form-label { display:block; font-size:13px; font-weight:500; color:var(--dark); margin-bottom:6px; }
.form-control { width:100%; padding:10px 14px; border:1.5px solid var(--border); border-radius:var(--radius); font-size:14px; color:var(--black); background:var(--white); transition:border-color .2s,box-shadow .2s; }
.form-control:focus { border-color:var(--garnet); box-shadow:0 0 0 3px rgba(114,47,55,0.1); }
.form-control::placeholder { color:#bbb; }

/* ============================
   HEADER — TOP BAR
   ============================ */
.site-header { position:fixed; top:0; left:0; right:0; z-index:200; background:var(--white); box-shadow:0 1px 0 var(--border); transition:box-shadow .3s; }
.site-header.scrolled { box-shadow:0 4px 20px rgba(0,0,0,0.1); }

.header-topbar { background:var(--garnet); color:rgba(255,255,255,0.92); font-size:12px; letter-spacing:0.04em; }
.header-topbar-inner { max-width:1280px; margin:0 auto; padding:7px 24px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.header-topbar-msg { font-weight:500; }
.header-topbar-right { display:flex; align-items:center; gap:16px; }
.lang-switch { display:flex; align-items:center; gap:6px; font-size:12px; }
.lang-switch a { color:rgba(255,255,255,.7); font-weight:500; }
.lang-switch a:hover,.lang-switch a.lang-active { color:var(--white); }
.lang-switch span { color:rgba(255,255,255,.3); }
.header-topbar-user { color:rgba(255,255,255,.8); font-size:12px; }
.header-topbar-user:hover { color:white; }

/* ============================
   HEADER — MAIN BODY
   ============================ */
.header-body {
  max-width:1280px; margin:0 auto; padding:0 24px;
  height:64px; display:flex; align-items:center; gap:16px;
}

.header-nav-bar {
  border-top:1px solid var(--border);
  background:var(--beige);
}
.header-nav-bar-inner {
  max-width:1280px; margin:0 auto; padding:0 24px;
  height:42px; display:flex; align-items:center; gap:0;
}

/* Logo */
.site-logo { display:flex; flex-direction:column; justify-content:center; flex-shrink:0; line-height:1.15; }
.site-logo img { height:44px; object-fit:contain; }
.logo-name { font-family:var(--font-serif); font-size:1.35rem; font-weight:700; color:var(--garnet); letter-spacing:0.04em; }
.logo-sub { font-size:10px; letter-spacing:0.18em; text-transform:uppercase; color:var(--gray); }

/* Desktop nav */
.main-nav { display:flex; align-items:center; gap:0; flex:1; }
.main-nav-item { position:relative; }
.main-nav-link { display:flex; align-items:center; gap:4px; padding:6px 12px; font-size:12px; font-weight:500; letter-spacing:0.07em; text-transform:uppercase; color:var(--dark); white-space:nowrap; transition:color .2s; }
.main-nav-link:hover,.main-nav-link--active { color:var(--garnet); }
.main-nav-link--sale { color:var(--garnet); font-weight:700; }

/* Sub-menu dropdown */
.nav-sub-menu { display:none; position:absolute; top:100%; left:0; background:var(--white); min-width:200px; border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-lg); padding:8px; z-index:300; }
body[dir="rtl"] .nav-sub-menu { left:auto; right:0; }
.main-nav-item:hover .nav-sub-menu { display:block; animation:fadeDown .18s ease; }
.nav-sub-link { display:block; padding:8px 12px; font-size:13px; color:var(--dark); border-radius:6px; }
.nav-sub-link:hover { background:var(--beige); color:var(--garnet); }

/* Search */
.header-search { flex:1; max-width:320px; position:relative; }
.header-search .search-icon { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--gray); pointer-events:none; }
body[dir="rtl"] .header-search .search-icon { left:auto; right:12px; }
.search-input { width:100%; padding:8px 14px 8px 38px; background:var(--beige); border:1.5px solid transparent; border-radius:22px; font-size:13px; color:var(--dark); transition:.2s; }
body[dir="rtl"] .search-input { padding:8px 38px 8px 14px; }
.search-input:focus { border-color:var(--garnet); background:var(--white); }
.search-input::placeholder { color:var(--gray); }
.search-results { position:absolute; top:calc(100% + 4px); left:0; right:0; background:white; border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-lg); z-index:999; max-height:380px; overflow-y:auto; }

/* Header icons */
.header-icons { display:flex; align-items:center; gap:2px; flex-shrink:0; }
.hicon { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; padding:8px 10px; color:var(--dark); transition:color .2s; border-radius:var(--radius); min-width:52px; }
.hicon:hover { color:var(--garnet); background:var(--beige); }
.hicon svg { flex-shrink:0; }
.hicon-label { font-size:10px; font-weight:500; letter-spacing:0.04em; white-space:nowrap; }

.hicon-badge { position:absolute; top:4px; right:6px; background:var(--garnet); color:white; border-radius:50%; width:17px; height:17px; font-size:10px; font-weight:700; display:flex; align-items:center; justify-content:center; line-height:1; }
.cart-badge { min-width:17px; padding:0 3px; border-radius:10px; }

.hicon-badge-tot { position:absolute; bottom:20px; left:55px; background:var(--beige); color:var(--garnet); border-radius:10px; width:max-content; height:17px; font-size:10px; font-weight:700; display:flex; align-items:center; justify-content:center; line-height:1; }
.cart-badge-tot { min-width:17px; padding:0 3px; border-radius:10px; }

body[dir="rtl"] .hicon-badge-tot {right:55px;}


/* Account dropdown */
.account-wrap { position:relative; }
.account-trigger { display:flex; flex-direction:column; align-items:center; gap:2px; padding:8px 10px; color:var(--dark); border-radius:var(--radius); min-width:52px; transition:color .2s; }
.account-trigger:hover { color:var(--garnet); background:var(--beige); }
.account-trigger svg { flex-shrink:0; }
.account-dropdown { display:none; position:absolute; top:calc(100%+6px); right:0; background:var(--white); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-lg); min-width:210px; padding:6px; z-index:400; animation:fadeDown .18s ease; }
body[dir="rtl"] .account-dropdown { right:auto; left:0; }
.account-wrap:hover .account-dropdown { display:block; }
.account-dropdown-head { padding:10px 12px 10px; border-bottom:1px solid var(--border); margin-bottom:4px; }
.account-dropdown-head strong { display:block; font-size:14px; color:var(--dark); margin-bottom:2px; }
.account-dropdown-head small { font-size:12px; color:var(--gray); }
.account-dropdown a { display:flex; align-items:center; gap:10px; padding:9px 12px; font-size:13px; border-radius:6px; color:var(--dark); }
.account-dropdown a:hover { background:var(--beige); color:var(--garnet); }
.dropdown-sep { border:none; border-top:1px solid var(--border); margin:4px 0; }
.dropdown-logout { color:var(--error) !important; }
.dropdown-logout:hover { background:rgba(220,38,38,.06) !important; }
.notif-count-badge { margin-left:auto; background:var(--garnet); color:white; border-radius:10px; padding:1px 6px; font-size:10px; font-weight:700; }

/* Mobile toggle */
.mobile-menu-toggle { display:none; align-items:center; justify-content:center; width:40px; height:40px; border-radius:var(--radius); color:var(--dark); }
.mobile-menu-toggle:hover { background:var(--beige); color:var(--garnet); }

/* ============================
   MOBILE NAV
   ============================ */
.mobile-nav { display:block; position:fixed; top:0; left:0; width:290px; height:100vh; background:var(--white); z-index:500; overflow-y:auto; transform:translateX(-100%); transition:transform .3s cubic-bezier(0.4,0,0.2,1); box-shadow:var(--shadow-lg); }
body[dir="rtl"] .mobile-nav { left:auto; right:0; transform:translateX(100%); }
.mobile-nav.open { transform:translateX(0); }
body[dir="rtl"] .mobile-nav.open { transform:translateX(0); }
.mobile-nav-link { display:block; padding:13px 20px; font-size:14px; border-bottom:1px solid var(--border); color:var(--dark); transition:.15s; }
.mobile-nav-link:hover { color:var(--garnet); background:var(--beige); }
.mobile-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:499; }
.mobile-overlay.open { display:block; }

/* ============================
   HERO SLIDER
   ============================ */
.hero-slider { position:relative; height:86vh; min-height:520px; overflow:hidden; margin-top:var(--header-h); }
.hero-slide { position:absolute; inset:0; display:flex; align-items:center; opacity:0; transition:opacity .9s ease; }
.hero-slide.active { opacity:1; z-index:1; }
.hero-slide-bg { position:absolute; inset:0; background-size:cover; background-position:center; }
.hero-slide-bg::after { content:''; position:absolute; inset:0; background:linear-gradient(90deg,rgba(45,31,34,.82) 0%,rgba(45,31,34,.15) 65%); }
body[dir="rtl"] .hero-slide-bg::after { background:linear-gradient(270deg,rgba(45,31,34,.82) 0%,rgba(45,31,34,.15) 65%); }
.hero-content { position:relative; z-index:2; padding:0 10%; color:white; max-width:640px; }
.hero-tag { font-size:11px; letter-spacing:0.22em; text-transform:uppercase; color:var(--gold-light); margin-bottom:16px; opacity:.85; }
.hero-title { font-family:var(--font-serif); font-size:clamp(2rem,4.5vw,3.4rem); font-weight:700; line-height:1.15; margin-bottom:18px; }
.hero-sub { font-size:15px; color:rgba(255,255,255,.8); margin-bottom:32px; max-width:400px; line-height:1.65; }
.hero-dots { position:absolute; bottom:28px; left:50%; transform:translateX(-50%); z-index:2; display:flex; gap:8px; }
.hero-dot { width:8px; height:8px; border-radius:50%; background:rgba(255,255,255,.45); border:none; cursor:pointer; transition:.3s; }
.hero-dot.active { background:var(--gold); width:24px; border-radius:4px; }
.hero-arrow { position:absolute; top:50%; transform:translateY(-50%); z-index:2; width:46px; height:46px; border-radius:50%; background:rgba(255,255,255,.15); border:1px solid rgba(255,255,255,.3); color:white; display:flex; align-items:center; justify-content:center; transition:.2s; cursor:pointer; }
.hero-arrow:hover { background:rgba(255,255,255,.3); }
.arrow-prev { left:24px; }
.arrow-next { right:24px; }
body[dir="rtl"] .arrow-prev { left:auto; right:24px; }
body[dir="rtl"] .arrow-next { right:auto; left:24px; }

/* Features Bar */
.features-bar {
  background: var(--garnet);
  color: white;
  padding: 0;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.feature-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.75rem;
  border-right: 1px solid rgba(255,255,255,0.15);
}
.feature-item:last-child { border-right: none; }
.feature-icon {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.feature-text strong { display: block; font-size: 0.9rem; font-weight: 600; }
.feature-text span { font-size: 0.78rem; opacity: 0.8; }

/* ============================
   CATEGORY CARDS
   ============================ */
.category-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  display: block;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .3s ease, box-shadow .3s ease;
}
.category-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.category-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform .5s ease;
}
.category-card:hover .category-card-bg {
  transform: scale(1.07);
}

/* Overlay dégradé sombre en bas */
.category-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(45, 31, 34, 0.82) 0%,
    rgba(45, 31, 34, 0.25) 50%,
    transparent 100%
  );
  transition: opacity .3s;
}
.category-card:hover::after {
  opacity: 0.9;
}

.category-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  z-index: 1;
}

.category-card-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.category-card-count {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.05em;
}

/* Section header helpers */
.section-header { margin-bottom: 8px; }
.text-center { text-align: center; }
.section-subtitle {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--garnet);
  margin-bottom: 8px;
}
.gold-line {
  width: 56px;
  height: 2px;
  background: linear-gradient(90deg, var(--garnet), var(--garnet-light));
}

/* Responsive */
@media (max-width: 640px) {
  .category-card { aspect-ratio: 3/2; }
  .category-card-name { font-size: 1rem; }
}

/* ============================
   GENDER BADGES
   ============================ */
.gender-badge { display:inline-block; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:600; letter-spacing:.04em; }
.gender-homme { background:#dbeafe; color:#1e40af; }
.gender-femme { background:#fce7f3; color:#9d174d; }
.gender-mixte { background:#f3f4f6; color:#374151; }

/* ============================
   PRODUCT CARDS
   ============================ */
.product-card { background:var(--white); border-radius:var(--radius-lg); overflow:hidden; box-shadow:var(--shadow); transition:var(--transition); position:relative; }
.product-card:hover { transform:translateY(-5px); box-shadow:var(--shadow-lg); }
.product-card-img { position:relative; aspect-ratio:1; overflow:hidden; background:var(--beige); }
.product-card-img img { width:100%; height:100%; object-fit:cover; transition:transform .6s ease; }
.product-card:hover .product-card-img img { transform:scale(1.04); }
.product-card-body { padding:14px 16px 16px; }

/* Card hover actions */
.product-actions-hover { position:absolute; bottom:0; left:0; right:0; padding:12px; background:linear-gradient(0deg,rgba(45,31,34,.85) 0%,transparent 100%); display:flex; gap:8px; transform:translateY(100%); transition:transform .3s ease; }
.product-card:hover .product-actions-hover { transform:translateY(0); }

/* Badges */
.product-badges { position:absolute; top:10px; left:10px; display:flex; flex-direction:column; gap:6px; }
body[dir="rtl"] .product-badges { left:auto; right:10px; }
.badge { display:inline-block; padding:3px 9px; border-radius:4px; font-size:10px; font-weight:700; letter-spacing:.05em; }
.badge-new { background:var(--garnet); color:white; }
.badge-sale { background:var(--gold); color:var(--dark); }
.badge-promo { background:var(--garnet); color:white; }
.price-current { font-size:1.1rem; font-weight:700; color:var(--garnet); }
.price-original { font-size:13px; color:var(--gray); text-decoration:line-through; margin-left:6px; }
.price-discount { font-size:11px; font-weight:700; background:var(--garnet); color:white; padding:2px 6px; border-radius:4px; margin-left:4px; }
.product-name { font-family:var(--font-serif); font-size:1.05rem; font-weight:600; color:var(--dark); margin-bottom:6px; line-height:1.3; }
.product-categories { font-size:11px; color:var(--garnet); font-weight:600; letter-spacing:.08em; text-transform:uppercase; margin-bottom:4px; }
.product-price-box { display:flex; align-items:center; flex-wrap:wrap; gap:4px; margin-top:8px; }

/* ============================
   PRODUCT DETAIL
   ============================ */
.detail-gallery { position:relative; }

/* Main image + thumbs : le crop garde aspect + overflow ; les thumbs en static (mobile) restent visibles sous l'image */
.main-image-wrap { position:relative; background:var(--beige); cursor:zoom-in; }
.main-image-crop { position:relative; width:100%; border-radius:var(--radius-lg); overflow:hidden; background:var(--beige); aspect-ratio:1; }
.main-product-img { width:100%; height:100%; object-fit:cover; transition:transform .3s; display:block; }

/* Thumbnails — overlay top-left */
.thumbs-overlay { position:absolute; top:12px; left:12px; display:flex; flex-direction:column; gap:8px; z-index:2; }
.thumb-wrap { width:64px; height:64px; border-radius:8px; overflow:hidden; cursor:pointer; border:2px solid rgba(255,255,255,.85); box-shadow:0 2px 8px rgba(0,0,0,.18); transition:.2s; flex-shrink:0; background:white; }
.thumb-wrap.active,.thumb-wrap:hover { border-color:var(--garnet); }
.thumb-img { width:100%; height:100%; object-fit:cover; }

/* Lightbox */
#img-lightbox { display:none; position:fixed; inset:0; background:rgba(0,0,0,.92); z-index:9999; align-items:center; justify-content:center; }
#img-lightbox img { max-width:90vw; max-height:90vh; object-fit:contain; border-radius:var(--radius); }
.lb-close { position:absolute; top:18px; right:18px; color:white; font-size:32px; cursor:pointer; width:44px; height:44px; display:flex; align-items:center; justify-content:center; border-radius:50%; background:rgba(255,255,255,.12); transition:.2s; }
.lb-close:hover { background:rgba(255,255,255,.25); }

.detail-price-main { font-size:2rem; font-weight:700; color:var(--garnet); }
.detail-price-original { font-size:1.1rem; color:var(--gray); text-decoration:line-through; margin-left:10px; }
.price-discount-badge { background:var(--garnet); color:white; padding:3px 10px; border-radius:4px; font-size:13px; font-weight:700; }

/* Declinations grid — hauteur uniforme */
.declinations-grid { display:flex; flex-wrap:wrap; gap:10px; align-items:stretch; }
.declination-btn {
  padding:10px 14px; border-radius:var(--radius); border:1.5px solid var(--border);
  font-size:13px; font-weight:500; color:var(--dark); transition:.2s; cursor:pointer;
  text-align:left; display:flex; flex-direction:column; justify-content:center; background:white;
}
.declination-btn:hover { border-color:var(--garnet); }
/* Active : bordure grenat épaisse, fond très léger, contenu coloré */
.declination-btn.active { border:2px solid var(--garnet); background:rgba(114,47,55,.04); }
.declination-btn.active .decl-type { color:var(--garnet); font-weight:700; }
.declination-btn.active .decl-vol  { color:var(--garnet); }
.declination-btn.active .decl-price{ color:var(--garnet); font-weight:700; }
.decl-type  { font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--gray); margin-bottom:2px; }
.decl-vol   { font-size:13px; font-weight:600; margin-bottom:3px; }
.decl-price { font-size:13px; font-weight:500; }

/* Page produit — RTL : bloc prix + déclinaisons alignés à droite */
body[dir="rtl"] .product-detail-grid #price-box {
  text-align: right;
}
body[dir="rtl"] .product-detail-grid #price-main {
  display: inline-block;
  max-width: 100%;
}
/* En RTL, le début du flux flex est à droite : flex-start aligne prix barré + badge à droite */
body[dir="rtl"] .product-detail-grid #price-box > div:nth-child(2) {
  justify-content: flex-start;
  flex-direction: row;
}
body[dir="rtl"] .product-detail-grid #price-original {
  display: inline-block;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}
body[dir="rtl"] .product-detail-grid #price-badge {
  margin-inline-start: 8px;
}
body[dir="rtl"] .product-detail-grid #discount-duration {
  text-align: right;
}
body[dir="rtl"] .product-detail-grid .declination-btn {
  text-align: right;
  align-items: flex-start; /* cross-start = droite en RTL (colonne) */
}
body[dir="rtl"] .product-detail-grid .decl-type,
body[dir="rtl"] .product-detail-grid .decl-vol,
body[dir="rtl"] .product-detail-grid .decl-price {
  text-align: right;
  width: 100%;
}

/* order-success.php — métadonnées et lignes articles suivent le RTL (arabe) */
.order-success-card .order-success-meta,
.order-success-card .order-success-address,
.order-success-card .order-success-items,
.order-success-card .order-success-item-text {
  text-align: start;
}
.order-success-card .order-success-meta-grid {
  direction: inherit;
}

/* Quantité — centré exactement */
.qty-control { display:flex; align-items:stretch; border:1.5px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.qty-control-btn { width:42px; display:flex; align-items:center; justify-content:center; font-size:20px; background:var(--beige); color:var(--dark); transition:.2s; cursor:pointer; border:none; }
.qty-control-btn:hover { background:var(--garnet); color:white; }
#qty-input { width:48px; height:46px; text-align:center; border:none; border-left:1.5px solid var(--border); border-right:1.5px solid var(--border); font-size:16px; font-weight:600; color:var(--dark); line-height:1; padding:0; }

/* Ligne panier (qty + btn + wishlist) */
.add-to-cart-section { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }

/* ============================
   CART SIDEBAR
   ============================ */
.cart-overlay { position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:299; opacity:0; pointer-events:none; transition:opacity .3s; }
.cart-overlay.open { opacity:1; pointer-events:all; }
.cart-sidebar { position:fixed; top:0; right:0; width:380px; max-width:100vw; height:100vh; background:var(--white); z-index:300; display:flex; flex-direction:column; transform:translateX(100%); transition:transform .35s cubic-bezier(0.4,0,0.2,1); box-shadow:var(--shadow-lg); }
.cart-sidebar.open { transform:translateX(0); }
body[dir="rtl"] .cart-sidebar { right:auto; left:0; transform:translateX(-100%); }
body[dir="rtl"] .cart-sidebar.open { transform:translateX(0); }
.cart-sidebar-header { padding:16px 20px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; background:var(--beige); }
.cart-sidebar-title { display:flex; align-items:center; gap:8px; font-family:var(--font-serif); font-size:1.15rem; font-weight:600; color:var(--dark); }
.cart-close-btn { width:36px; height:36px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:var(--gray); transition:.2s; }
.cart-close-btn:hover { background:var(--border); color:var(--dark); }
.cart-sidebar-body { flex:1; overflow-y:auto; padding:14px; }
.cart-sidebar-footer { padding:16px 20px; border-top:1px solid var(--border); background:var(--beige); }
.cart-item { display:flex; gap:12px; padding:10px; border-radius:var(--radius); margin-bottom:8px; background:var(--cream); }
.cart-item img { width:66px; height:66px; object-fit:cover; border-radius:6px; flex-shrink:0; }
.cart-item-info { flex:1; min-width:0; }
.cart-item-name { font-weight:600; font-size:13px; color:var(--dark); margin-bottom:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cart-item-variant { font-size:11px; color:var(--gray); margin-bottom:4px; }
.cart-item-price { font-size:13px; color:var(--garnet); font-weight:500; margin-bottom:7px; }
.cart-item-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:space-between; }
body[dir="rtl"] .cart-item-info { text-align: right; }
body[dir="rtl"] .cart-item-price { text-align: right; }
body[dir="rtl"] .cart-item-actions { justify-content: flex-start; }
/* Total ligne à droite (début du flux RTL) */
body[dir="rtl"] .cart-item-actions .cart-item-line-total { order: -1; }
.qty-btn { width:27px; height:27px; border-radius:6px; background:var(--beige); border:1px solid var(--border); font-size:15px; display:flex; align-items:center; justify-content:center; cursor:pointer; transition:.15s; }
.qty-btn:hover { background:var(--garnet); color:white; border-color:var(--garnet); }
.cart-total-row { display:flex; justify-content:space-between; align-items:center; font-size:16px; font-weight:700; color:var(--dark); margin-bottom:12px; }
.cart-total-amount { color:var(--garnet); font-size:1.1rem; }
.qty-btn.disabled,
.qty-btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    background: #f0f0f0;
    border-color: #ddd;
    pointer-events: none;     /* bloque vraiment les clics */
}

/* ============================
   CATALOGUE & BREADCRUMB
   ============================ */
.page-wrap { padding-top:var(--header-h); }
.breadcrumb { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--gray); padding:18px 0; flex-wrap:wrap; }
.breadcrumb a { color:var(--garnet); }
.breadcrumb .sep { color:var(--border); }
.products-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:24px; }
.pagination { display:flex; gap:6px; justify-content:center; margin-top:40px; flex-wrap:wrap; }
.page-btn { width:38px; height:38px; display:flex; align-items:center; justify-content:center; border-radius:var(--radius); border:1px solid var(--border); font-size:14px; font-weight:500; color:var(--dark); transition:.2s; }
.page-btn:hover,.page-btn.active { background:var(--garnet); border-color:var(--garnet); color:white; }

/* ============================
   AUTH PAGES
   ============================ */
.auth-page { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:40px 20px; background:linear-gradient(135deg,var(--beige),var(--cream)); padding-top:calc(var(--header-h) + 40px); }
.auth-card { background:var(--white); border-radius:var(--radius-lg); padding:36px; box-shadow:var(--shadow-lg); width:100%; max-width:420px; }
.auth-title { font-family:var(--font-serif); font-size:1.8rem; font-weight:700; color:var(--dark); text-align:center; margin-bottom:6px; }
.auth-sub { text-align:center; color:var(--gray); font-size:14px; margin-bottom:24px; }
.auth-link { color:var(--garnet); font-weight:500; }

/* ============================
   PROFILE / ACCOUNT
   ============================ */
.profile-layout { display:grid; grid-template-columns:220px 1fr; gap:24px; padding:40px 0; }
.profile-sidebar { background:var(--white); border-radius:var(--radius-lg); padding:22px; box-shadow:var(--shadow); height:fit-content; }
.profile-avatar { width:68px; height:68px; border-radius:50%; background:linear-gradient(135deg,var(--garnet),var(--garnet-light)); color:white; font-size:26px; font-weight:700; display:flex; align-items:center; justify-content:center; margin:0 auto 10px; }
.profile-nav a { display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:var(--radius); font-size:13px; color:var(--dark); transition:.2s; margin-bottom:3px; }
.profile-nav a:hover,.profile-nav a.active { background:var(--beige); color:var(--garnet); }
.profile-nav a.active { font-weight:600; }

/* Order status badges */
.order-status { display:inline-block; padding:3px 12px; border-radius:20px; font-size:12px; font-weight:600; }
.status-pending    { background:#FEF3C7; color:#92400E; }
.status-confirmed  { background:#DBEAFE; color:#1E40AF; }
.status-processing { background:#EDE9FE; color:#5B21B6; }
.status-shipped    { background:#CFFAFE; color:#155E75; }
.status-delivered  { background:#D1FAE5; color:#065F46; }
.status-cancelled  { background:#FEE2E2; color:#991B1B; }
.status-refunded   { background:#F3F4F6; color:#374151; }

/* ============================
   CHECKOUT
   ============================ */
.checkout-layout { display:grid; grid-template-columns:1fr 380px; gap:28px; align-items:start; }
.checkout-section { background:var(--white); border-radius:var(--radius-lg); padding:26px; box-shadow:var(--shadow); margin-bottom:18px; }
.checkout-section-title { font-family:var(--font-serif); font-size:1.15rem; font-weight:600; color:var(--dark); margin-bottom:18px; padding-bottom:12px; border-bottom:1px solid var(--border); }

/* ============================
   FOOTER
   ============================ */
.site-footer { background:var(--dark); color:rgba(255,255,255,.75); padding:64px 0 24px; margin-top:80px; }
.footer-brand { font-family:var(--font-serif); font-size:1.55rem; color:var(--gold); margin-bottom:10px; }
.footer-desc { font-size:13px; color:rgba(255,255,255,.45); line-height:1.7; max-width:260px; margin-bottom:18px; }
.footer-title { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.12em; color:var(--gold-light); margin-bottom:14px; }
.footer-link { display:block; font-size:13px; color:rgba(255,255,255,.5); margin-bottom:8px; transition:.2s; }
.footer-link:hover { color:var(--gold-light); padding-left:4px; }
body[dir="rtl"] .footer-link:hover { padding-left:0; padding-right:4px; }
.footer-bottom { border-top:1px solid rgba(255,255,255,.08); margin-top:36px; padding-top:18px; display:flex; align-items:center; justify-content:space-between; font-size:12px; color:rgba(255,255,255,.28); flex-wrap:wrap; gap:8px; }
.social-links { display:flex; gap:10px; }
.social-link { width:36px; height:36px; border-radius:50%; background:rgba(255,255,255,.08); display:flex; align-items:center; justify-content:center; color:rgba(255,255,255,.55); transition:.2s; }
.social-link:hover { background:var(--garnet); color:white; }
.footer-top { display:grid; grid-template-columns:1.4fr 1fr 1fr 1.2fr; gap:40px; }
.footer-bottom-links { display:flex; gap:16px; }

/* ============================
   ALERTS & TOASTS
   ============================ */
.alert { padding:13px 16px; border-radius:var(--radius); margin-bottom:16px; font-size:14px; display:flex; align-items:flex-start; gap:10px; }
.alert-success { background:#d1fae5; color:#065f46; border:1px solid #6ee7b7; }
.alert-error   { background:#fee2e2; color:#991b1b; border:1px solid #fca5a5; }
.alert-info    { background:#dbeafe; color:#1e40af; border:1px solid #93c5fd; }
.alert-warning { background:#fef3c7; color:#92400e; border:1px solid #fcd34d; }

.toast-container { position:fixed; bottom:24px; right:24px; z-index:9999; display:flex; flex-direction:column; gap:8px; pointer-events:none; }
body[dir="rtl"] .toast-container { right:auto; left:24px; }
.toast { display:flex; align-items:center; gap:10px; padding:12px 18px; background:var(--white); border-radius:var(--radius); box-shadow:var(--shadow-lg); font-size:14px; min-width:240px; border-left:4px solid var(--garnet); animation:slideInToast .32s ease; transition:opacity .32s,transform .32s; pointer-events:auto; }
.toast.success { border-color:var(--success); }
.toast.error   { border-color:var(--error); }
.toast.info    { border-color:var(--info); }
.toast-icon { font-size:16px; font-weight:800; flex-shrink:0; }
.toast.success .toast-icon { color:var(--success); }
.toast.error   .toast-icon { color:var(--error); }
.toast.info    .toast-icon { color:var(--info); }

/* ============================
   SPINNERS & ANIMATIONS
   ============================ */
.spinner { display:inline-block; width:20px; height:20px; border:2px solid rgba(255,255,255,.3); border-top-color:white; border-radius:50%; animation:spin .7s linear infinite; }
@keyframes spin         { to { transform:rotate(360deg); } }
@keyframes slideInToast { from { opacity:0; transform:translateX(56px); } to { opacity:1; transform:translateX(0); } }
@keyframes fadeDown     { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width:1080px) {
  .main-nav { display:none; }
  .mobile-menu-toggle { display:flex; }
  .header-search { max-width:220px; }
}
@media (max-width:768px) {
  :root { --header-h: 108px; }
  .hero-slider { height:65vh; }
  .grid-4 { grid-template-columns:repeat(2,1fr); }
  .grid-3 { grid-template-columns:repeat(2,1fr); }
  .grid-2 { grid-template-columns:1fr; }
  .cart-sidebar { width:100%; }
  .section { padding:50px 0; }
  .products-grid { grid-template-columns:repeat(2,1fr); gap:16px; }
  .checkout-layout { grid-template-columns:1fr; }
  .profile-layout { grid-template-columns:1fr; }
  .hicon-label { display:none; }
  .header-search { display:none; }
}
@media (max-width:480px) {
  :root { --header-h: 105px; }
  .products-grid { grid-template-columns:1fr; }
  .grid-4,.grid-3,.grid-2 { grid-template-columns:1fr; }
  .hero-title { font-size:1.7rem; }
}

/* ---- Tom Select overrides ---- */
.ts-wrapper.single .ts-control {

  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: white;
  font-size: 14px;
  font-family: var(--font-body);
}
.ts-dropdown { font-size: 13px; border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.ts-dropdown .option.selected, .ts-dropdown .option:hover { background: var(--garnet-light,#9B4451); color: white; }

/* ---- Arabic price fix — keep numbers LTR inside RTL text ---- */
body[dir="rtl"] .price-current,
body[dir="rtl"] .price-original,
body[dir="rtl"] .price-discount,
body[dir="rtl"] .cart-total-amount,
body[dir="rtl"] .cart-item-price,
body[dir="rtl"] .cart-badge-tot,
body[dir="rtl"] .hicon-badge-tot,
body[dir="rtl"] .floating-total,
body[dir="rtl"] #sum-subtotal,
body[dir="rtl"] #sum-shipping,
body[dir="rtl"] #sum-total,
body[dir="rtl"] #price-main,
body[dir="rtl"] #price-original,
.price-ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

/* ---- Wishlist active heart ---- */
[data-wishlist].wishlist-active svg path { fill: currentColor; }
[data-wishlist].wishlist-active { color: var(--garnet); }

/* ---- Confirmation modal ---- */
#confirm-modal { font-family: var(--font-body); }

/* ---- Status badge colors ---- */
.badge-pending    { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-confirmed  { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.badge-processing { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }
.badge-shipped    { background: #cffafe; color: #155e75; border: 1px solid #a5f3fc; }
.badge-delivered  { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.badge-cancelled  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Combobox (même style que app métier) ── */
.combo-wrap{position:relative}
.combo-input{cursor:pointer!important;background:white}
.combo-dropdown{
  position:absolute;top:100%;left:0;right:0;background:white;
  border:1.5px solid var(--border);border-top:none;
  border-radius:0 0 var(--radius) var(--radius);
  box-shadow:0 8px 24px rgba(0,0,0,.1);z-index:500;
  max-height:190px;overflow-y:auto;display:none}
.combo-dropdown.open{display:block}
.combo-search{padding:6px 9px;border-bottom:1px solid var(--border);
  position:sticky;top:0;background:white}
.combo-search input{border:1px solid var(--border);border-radius:5px;
  padding:4px 8px;font-size:.81rem;width:100%;outline:none;font-family:inherit}
.combo-opt{padding:7px 11px;font-size:.84rem;cursor:pointer;transition:background .15s}
.combo-opt:hover,.combo-opt.highlighted{background:rgba(114,47,55,.07)}
.combo-opt.selected{color:var(--garnet);font-weight:600}
.combo-mobile-head{display:none}

@media (max-width: 768px) {
  .combo-wrap.combo-mobile-fullscreen .combo-dropdown.open{
    position:fixed;
    inset:0;
    z-index:12000;
    max-height:none;
    border:none;
    border-radius:0;
    box-shadow:none;
    display:flex;
    flex-direction:column;
    background:var(--white);
  }
  .combo-wrap.combo-mobile-fullscreen .combo-mobile-head{
    display:flex;
    align-items:center;
    gap:10px;
    padding:12px 14px;
    border-bottom:1px solid var(--border);
    background:var(--white);
    position:sticky;
    top:0;
    z-index:2;
  }
  .combo-wrap.combo-mobile-fullscreen .combo-mobile-close{
    width:34px;
    height:34px;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--white);
    color:var(--dark);
    font-size:18px;
    line-height:1;
    cursor:pointer;
    flex-shrink:0;
  }
  .combo-wrap.combo-mobile-fullscreen .combo-mobile-title{
    font-size:15px;
    font-weight:700;
    color:var(--dark);
  }
  .combo-wrap.combo-mobile-fullscreen .combo-search{
    position:sticky;
    top:59px;
    z-index:2;
    padding:10px 14px;
    border-bottom:1px solid var(--border);
  }
  .combo-wrap.combo-mobile-fullscreen .combo-search input{
    font-size:15px;
    padding:10px 12px;
    border-radius:10px;
  }
  .combo-wrap.combo-mobile-fullscreen .combo-opts{
    flex:1;
    overflow:auto;
    -webkit-overflow-scrolling:touch;
  }
  .combo-wrap.combo-mobile-fullscreen .combo-opt{
    padding:13px 14px;
    font-size:15px;
    border-bottom:1px solid rgba(0,0,0,.05);
  }
}

/* ── Hover image cycling ── */
.product-img-dots {
  position: absolute;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 3;
  opacity: 0;
  transition: opacity .2s;
}
.product-card:hover .product-img-dots { opacity: 1; }
.product-img-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transition: background .2s, transform .2s;
  cursor: pointer;
}
.product-img-dot.active {
  background: white;
  transform: scale(1.3);
}
.product-card-main-img {
  transition: opacity .25s ease;
}
.product-card-main-img.fading { opacity: 0; }

/* ───────────────────────────────────────────────
   Floating Cart Button
─────────────────────────────────────────────── */
.floating-cart-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--garnet);
  color: white;
  border: none;
  box-shadow: 0 8px 32px rgba(139, 0, 47, 0.28);
  cursor: pointer;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
  transform: scale(0.7) translateY(40px);
  pointer-events: none;
}

.floating-cart-btn.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.floating-cart-btn:hover {
  transform: scale(1.08) translateY(-4px);
  box-shadow: 0 12px 40px rgba(139, 0, 47, 0.38);
}

.floating-cart-btn:active {
  transform: scale(0.94);
}

.floating-cart-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-badge {
  position: absolute;
  top: -20px;
  right: -20px;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  color: var(--garnet);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.floating-total {
  position: absolute;
  bottom: -28px;
  right: 50%;
  transform: translateX(50%);
  font-size: 11px;
  font-weight: 600;
  color: var(--dark);
  background: rgba(255,255,255,0.92);
  padding: 3px 9px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  white-space: nowrap;
  pointer-events: none;
}

/* Cacher quand le panier est ouvert */
.cart-sidebar.open ~ .floating-cart-btn,
.cart-overlay.open ~ .floating-cart-btn {
  opacity: 0 !important;
  transform: scale(0.6) translateY(60px) !important;
  pointer-events: none;
}

/* Responsive : plus petit sur mobile */
@media (max-width: 640px) {
  .floating-cart-btn {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
  }
  .floating-total {
    font-size: 10px;
    padding: 2px 7px;
    bottom: -24px;
  }
}

/* Bouton suppression dans le panier */
.cart-remove-btn {
  color: var(--error);
  font-size: 18px;           /* un peu plus petit que 20px pour l'icône */
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.cart-remove-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  transform: scale(1.1);
}

.cart-remove-btn:active {
  transform: scale(0.95);
}

.cart-remove-btn i {
  transition: transform 0.2s ease;
}

.cart-remove-btn:hover i {
  transform: scale(1.15);
}/* =====================================================
   PRESTIGE PERFUMS — Mobile Responsive Fixes & Sliders
   Ajouter APRÈS le fichier style principal
   ===================================================== */

/* ============================
   VARIABLES MOBILE
   ============================ */
:root {
  --header-h-desktop: 150px;
  --header-h-tablet:  108px;
  --header-h-mobile:  56px; /* header ultra-compact mobile */
}

/* ============================
   RESET SCROLL HORIZONTAL
   ============================ */
html, body {
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ============================
   HORIZONTAL SCROLL SLIDER
   (catégories, produits, marques…)
   ============================ */
.h-slider-wrap {
  position: relative;
  overflow: hidden;
}

.h-slider {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}
.h-slider::-webkit-scrollbar { display: none; }

.h-slider > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* Boutons flèches des sliders (visibles uniquement desktop) */
.h-slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--white);
  border: 1.5px solid var(--border);
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition);
}
.h-slider-btn:hover {
  background: var(--garnet);
  color: white;
  border-color: var(--garnet);
}
.h-slider-btn.prev { left: -16px; }
.h-slider-btn.next { right: -16px; }

/* Sur mobile : masquer les boutons, le swipe suffit */
@media (max-width: 768px) {
  .h-slider-btn { display: none; }
}

/* ============================
   CATEGORY SLIDER MOBILE
   ============================ */
.category-h-slider .h-slider > * {
  width: 140px;
}
@media (min-width: 769px) {
  .category-h-slider .h-slider > * {
    width: 220px;
  }
}

/* ============================
   PRODUCT SLIDER MOBILE
   ============================ */
.product-h-slider .h-slider > * {
  width: 200px;
}
@media (min-width: 769px) {
  .product-h-slider .h-slider > * {
    width: 260px;
  }
}
@media (min-width: 1080px) {
  .product-h-slider .h-slider > * {
    width: 290px;
  }
}

/* ============================
   BRAND SLIDER MOBILE
   ============================ */
.brand-h-slider .h-slider > * {
  width: 110px;
}

/* ============================
   INDICATOR DE SCROLL (petits dots)
   ============================ */
.h-slider-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}
.h-slider-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: background .25s, width .25s;
  border: none;
  cursor: pointer;
  padding: 0;
}
.h-slider-dot.active {
  background: var(--garnet);
  width: 18px;
  border-radius: 3px;
}
@media (min-width: 769px) {
  .h-slider-dots { display: none; }
}

/* ============================
   HEADER MOBILE — REFONTE COMPLÈTE
   ============================ */

/* ─── Topbar : caché sur petits écrans ─── */
@media (max-width: 640px) {
  .header-topbar { display: none; }
}

/* ─── Header body mobile ─── */
@media (max-width: 768px) {
  :root { --header-h: var(--header-h-tablet); }

  .header-body {
    height: 56px;
    padding: 0 14px;
    gap: 10px;
  }

  /* Logo plus petit */
  .site-logo img { height: 34px; }
  .logo-name { font-size: 1.1rem; }
  .logo-sub  { display: none; }

  /* Recherche cachée dans le body, visible dans la barre mobile */
  .header-search { display: none !important; }

  /* Icônes header */
  .hicon { padding: 6px 8px; min-width: 40px; }
  .hicon-label { display: none; }
  .header-icons { gap: 0; }

  /* Barre de navigation masquée */
  .header-nav-bar { display: none; }
}

@media (max-width: 480px) {
  :root { --header-h: 56px; }
  .header-body {
    height: 56px;
    padding: 0 12px;
    gap: 8px;
  }
  .site-logo img { height: 30px; }
}

/* ─── Barre de recherche mobile (sous le header) ─── */
.mobile-search-bar {
  display: none;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 10px 14px;
  position: sticky;
  top: 56px;
  z-index: 190;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.mobile-search-bar .header-search {
  display: block !important;
  max-width: 100% !important;
  flex: 1;
}
.mobile-search-bar .search-input {
  font-size: 14px;
  padding: 10px 14px 10px 40px;
}
@media (max-width: 768px) {
  .mobile-search-bar { display: flex; align-items: center; gap: 10px; }
}

/* Ajustement du padding-top des pages avec barre de recherche mobile */
@media (max-width: 768px) {
  .hero-slider { margin-top: calc(var(--header-h) + 52px); }
  .page-wrap   { padding-top: calc(var(--header-h) + 52px); }
}
@media (max-width: 480px) {
  .hero-slider { margin-top: calc(56px + 52px); }
  .page-wrap   { padding-top: calc(56px + 52px); }
}

/* ============================
   MOBILE NAV — AMÉLIORÉ
   ============================ */
.mobile-nav {
  width: 100%;
  max-width: 300px;
}
.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--garnet);
  color: white;
}
.mobile-nav-logo {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
}
.mobile-nav-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: white;
  font-size: 20px;
  cursor: pointer;
}

/* Catégorie slider horizontal dans le nav mobile */
.mobile-nav-cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  background: var(--beige);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.mobile-nav-cats::-webkit-scrollbar { display: none; }
.mobile-nav-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--dark);
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  width: 64px;
}
.mobile-nav-cat-img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--beige);
}
.mobile-nav-cat:hover .mobile-nav-cat-img {
  border-color: var(--garnet);
}

/* Sections du menu */
.mobile-nav-section-title {
  padding: 10px 20px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gray);
}
.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--dark);
  transition: .15s;
}
.mobile-nav-link svg {
  color: var(--garnet);
  flex-shrink: 0;
}
.mobile-nav-link:hover { color: var(--garnet); background: var(--beige); }
.mobile-nav-link--sale { color: var(--garnet); font-weight: 700; }

/* ============================
   HERO SLIDER MOBILE
   ============================ */
@media (max-width: 768px) {
  .hero-slider { height: 55vh; min-height: 320px; }
  .hero-content { padding: 0 20px; max-width: 100%; }
  .hero-title { font-size: clamp(1.4rem, 6vw, 2.2rem); }
  .hero-sub { font-size: 13px; margin-bottom: 20px; }
  .hero-arrow { width: 36px; height: 36px; }
  .arrow-prev { left: 12px; }
  .arrow-next { right: 12px; }
}
@media (max-width: 480px) {
  .hero-slider { height: 50vh; min-height: 280px; }
  .hero-title { font-size: 1.4rem; }
  .hero-tag { font-size: 10px; margin-bottom: 10px; }
  .hero-sub { display: none; }
  .hero-content { padding: 0 16px; }
  .hero-arrow { display: none; }
}

/* ============================
   FEATURES BAR MOBILE — SLIDER
   ============================ */
@media (max-width: 768px) {
  .features-bar { overflow: hidden; }
  .features-grid {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    grid-template-columns: none;
  }
  .features-grid::-webkit-scrollbar { display: none; }
  .feature-item {
    min-width: 220px;
    scroll-snap-align: start;
    border-right: 1px solid rgba(255,255,255,.15);
    flex-shrink: 0;
    padding: 1rem 1.25rem;
  }
  .feature-item:last-child { border-right: none; }
  .feature-icon { width: 40px; height: 40px; font-size: 1rem; }
  .feature-text strong { font-size: .8rem; }
  .feature-text span { font-size: .72rem; }
}

/* ============================
   CATEGORY SECTION MOBILE
   ============================ */
@media (max-width: 768px) {
  /* Quand les catégories sont en grille, passer en slider horizontal */
  .categories-section .grid-3,
  .categories-section .grid-4,
  .categories-section .grid-2 {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }
  .categories-section .grid-3::-webkit-scrollbar,
  .categories-section .grid-4::-webkit-scrollbar,
  .categories-section .grid-2::-webkit-scrollbar { display: none; }

  .categories-section .grid-3 > *,
  .categories-section .grid-4 > *,
  .categories-section .grid-2 > * {
    min-width: 145px;
    max-width: 145px;
    scroll-snap-align: start;
    flex-shrink: 0;
  }
  .category-card { aspect-ratio: 4/3; }

  /* Evite la zone grise trop grande en bas des cards sur mobile */
  .category-card::after {
    background: linear-gradient(
      to top,
      rgba(45, 31, 34, 0.58) 0%,
      rgba(45, 31, 34, 0.16) 48%,
      transparent 100%
    );
  }
}

/* ============================
   PRODUCT CARDS GRID MOBILE
   ============================ */
@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .product-card-body { padding: 10px 12px 12px; }
  .product-name { font-size: .9rem; }
  .price-current { font-size: 1rem; }
}

@media (max-width: 380px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .product-card-body { padding: 8px 10px 10px; }
}

/* Produits en slider horizontal quand classe .products-slider */
.products-slider {
  display: flex !important;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 6px;
}
.products-slider::-webkit-scrollbar { display: none; }
.products-slider > .product-card {
  min-width: 195px;
  max-width: 195px;
  scroll-snap-align: start;
  flex-shrink: 0;
}
@media (min-width: 769px) {
  .products-slider > .product-card {
    min-width: 260px;
    max-width: 260px;
  }
}

/* ============================
   PRODUCT DETAIL MOBILE
   ============================ */
@media (max-width: 768px) {
  .detail-gallery { margin-bottom: 20px; }
  /* Bandeau miniatures : règles détaillées sous .product-detail-grid (évite overlay rogné) */
  .thumb-wrap { width: 50px; height: 50px; }
  .add-to-cart-section { flex-wrap: wrap; }
  .add-to-cart-section .btn-primary { flex: 1; min-width: 0; }
  .declinations-grid { gap: 8px; }
  .declination-btn { padding: 8px 10px; font-size: 12px; }
  .detail-price-main { font-size: 1.6rem; }
}

/* ============================
   CART SIDEBAR MOBILE
   ============================ */
@media (max-width: 768px) {
  .cart-sidebar {
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    top: auto;
    bottom: 0;
    height: 85vh;
    transform: translateY(100%);
  }
  .cart-sidebar.open { transform: translateY(0); }
  body[dir="rtl"] .cart-sidebar {
    left: 0;
    right: 0;
    transform: translateY(100%);
  }
  body[dir="rtl"] .cart-sidebar.open { transform: translateY(0); }
}

/* ============================
   CHECKOUT & PROFILE MOBILE
   ============================ */
@media (max-width: 768px) {
  .checkout-layout { grid-template-columns: 1fr; gap: 16px; }
  .profile-layout  { grid-template-columns: 1fr; gap: 16px; }
  .profile-sidebar { padding: 16px; }
  .checkout-section { padding: 18px; }
  .auth-card { padding: 24px 20px; }
  .auth-title { font-size: 1.5rem; }
}

/* ============================
   FOOTER MOBILE
   ============================ */
@media (max-width: 768px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .site-footer { padding: 40px 0 24px; margin-top: 40px; }
}
@media (max-width: 480px) {
  .footer-top { grid-template-columns: 1fr; gap: 20px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-bottom-links { justify-content: center; }
}

/* ============================
   SECTION PADDING MOBILE
   ============================ */
@media (max-width: 768px) {
  .section { padding: 40px 0; }
  .container { padding: 0 16px; }
  .section-title { font-size: 1.5rem; }
  .section-subtitle { font-size: 11px; }
}
@media (max-width: 480px) {
  .section { padding: 32px 0; }
  .container { padding: 0 14px; }
  .section-title { font-size: 1.35rem; }
}

/* ============================
   GRIDS MOBILE — override général
   ============================ */
@media (max-width: 640px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}

/* ============================
   BREADCRUMB MOBILE
   ============================ */
@media (max-width: 480px) {
  .breadcrumb { font-size: 12px; padding: 12px 0; gap: 6px; }
  .breadcrumb .sep { font-size: 10px; }
}

/* ============================
   PAGINATION MOBILE
   ============================ */
@media (max-width: 480px) {
  .pagination { gap: 4px; }
  .page-btn { width: 34px; height: 34px; font-size: 13px; }
}

/* ============================
   TOAST MOBILE
   ============================ */
@media (max-width: 640px) {
  .toast-container {
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    bottom: auto;
    right: 12px;
    left: 12px;
  }
  .toast { min-width: unset; width: 100%; font-size: 13px; padding: 10px 14px; }
}

/* ============================
   FLOATING CART MOBILE
   ============================ */
@media (max-width: 640px) {
  .floating-cart-btn {
    bottom: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
  }
}

/* ============================
   CATALOGUE FILTRES MOBILE
   ============================ */
.filter-mobile-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  z-index: 200;
  gap: 10px;
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
}
@media (max-width: 768px) {
  .filter-mobile-bar { display: flex; }
  /* Laisser de la place en bas pour la barre de filtres */
  .catalogue-page { padding-bottom: 72px; }
}

/* Drawer filtres mobile */
.filter-drawer {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.18);
  z-index: 500;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(0.4,0,0.2,1);
}
.filter-drawer.open {
  display: block;
  transform: translateY(0);
}
.filter-drawer-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 0;
}
.filter-drawer-header {
  padding: 16px 20px;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--dark);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.filter-drawer-body { padding: 20px; }

/* ============================
   INPUT / FORM MOBILE
   ============================ */
@media (max-width: 640px) {
  .form-control { font-size: 16px; } /* évite zoom auto iOS */
  #qty-input { font-size: 16px; }
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px !important; /* évite zoom auto iOS */
  }
}

/* ============================
   ORDER DETAIL MOBILE
   ============================ */
@media (max-width: 640px) {
  .order-card { padding: 16px; }
  .order-items-table { font-size: 13px; }
}

/* ============================
   COMPTE / PROFIL MOBILE
   ============================ */
@media (max-width: 768px) {
  .profile-nav {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding: 8px 0;
    scrollbar-width: none;
  }
  .profile-nav::-webkit-scrollbar { display: none; }
  .profile-nav a {
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 20px;
    padding: 8px 14px;
    background: var(--beige);
    border: 1px solid var(--border);
    margin-bottom: 0;
    font-size: 13px;
  }
  .profile-nav a.active {
    background: var(--garnet);
    color: white;
    border-color: var(--garnet);
  }
}

/* ============================
   TABLE COMMANDES MOBILE
   ============================ */
@media (max-width: 640px) {
  .orders-table-wrap { overflow-x: auto; }
  .orders-table { min-width: 520px; }
}

/* ============================
   SWIPE INDICATOR (flèche animated)
   ============================ */
.swipe-hint {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--gray);
  margin-bottom: 8px;
}
.swipe-hint svg { animation: swipeAnim 1.5s ease-in-out infinite; }
@keyframes swipeAnim {
  0%,100% { transform: translateX(0); }
  50%      { transform: translateX(6px); }
}
@media (max-width: 768px) {
  .swipe-hint { display: flex; }
}

/* ============================
   SECTION "VIEW ALL" HEADER
   ============================ */
.section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.section-head-row .section-title { margin-bottom: 0; }

@media (max-width: 480px) {
  .section-head-row { margin-bottom: 14px; }
  .section-head-row .btn { font-size: 11px; padding: 6px 12px; }
}

/* ============================
   FIX DROPDOWN SUR MOBILE
   ============================ */
@media (max-width: 768px) {
  .account-dropdown { display: none !important; }
  .nav-sub-menu { display: none !important; }
}

/* ============================
   FIX LIGHTBOX MOBILE
   ============================ */
@media (max-width: 640px) {
  #img-lightbox img {
    max-width: 96vw;
    max-height: 75vh;
  }
  .lb-close { top: 12px; right: 12px; font-size: 26px; }
}

/* ============================
   SAFE AREA (iPhone notch)
   ============================ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .floating-cart-btn {
    bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .filter-mobile-bar {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
  .cart-sidebar {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ============================
   LANG SWITCH MOBILE (dans topbar)
   ============================ */
@media (max-width: 768px) {
  /* Visible dans le menu mobile à la place */
  .header-topbar-right .lang-switch { font-size: 11px; gap: 4px; }
}

/* ============================
   BOUTON "Retour en haut" MOBILE
   ============================ */
#scroll-top-btn {
  display: none;
  position: fixed;
  bottom: 80px;
  right: 16px;
  width: 42px;
  height: 42px;
  background: var(--garnet);
  color: white;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  z-index: 800;
  box-shadow: var(--shadow);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
#scroll-top-btn.visible { display: flex; }
#scroll-top-btn:hover { background: var(--garnet-dark); }

/* ============================
   PRODUCT CARD HOVER — DÉSACTIVÉ SUR TOUCH
   ============================ */
@media (hover: none) {
  .product-actions-hover {
    transform: translateY(0) !important;
    background: linear-gradient(0deg, rgba(45,31,34,.75) 0%, transparent 100%);
    padding: 8px;
  }
  .product-card:hover .product-card-img img { transform: none; }
  .product-card:hover { transform: none; box-shadow: var(--shadow); }
  .category-card:hover { transform: none; }
  .category-card:hover .category-card-bg { transform: none; }
}

/* ============================
   MEDIA (images) MOBILE FIX
   ============================ */
img { max-width: 100%; height: auto; }
.product-card-img img { object-fit: cover; }

/* ============================
   TEXT OVERFLOW FIX
   ============================ */
.cart-item-name,
.product-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .cart-item-name { font-size: 12px; }
  .cart-item img { width: 54px; height: 54px; }
}

/* ============================
   SEARCH RESULTS MOBILE
   ============================ */
@media (max-width: 768px) {
  .search-results {
    position: fixed;
    top: calc(56px + 52px);
    left: 0;
    right: 0;
    border-radius: 0;
    max-height: 60vh;
    border-left: none;
    border-right: none;
    z-index: 999;
  }
}
/* =====================================================
   PRESTIGE PERFUMS — Corrections pages produit & checkout
   Ajouter APRÈS style_mobile_responsive.css
   ===================================================== */

/* ============================
   PAGE PRODUIT — GRILLE PRINCIPALE
   ============================ */

/* Desktop : 2 colonnes égales */
.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

/* Tablette */
@media (max-width: 1024px) {
  .product-detail-grid {
    gap: 36px;
  }
}

/* Mobile : 1 seule colonne, image EN PREMIER, info EN DESSOUS */
@media (max-width: 768px) {
  .product-detail-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* Image en pleine largeur */
  .product-detail-grid .detail-gallery {
    width: 100%;
  }

  /* Réduire l'image principale sur mobile (zone carrée uniquement) */
  .product-detail-grid .main-image-crop {
    aspect-ratio: 1;
    max-height: 360px;
    border-radius: 12px;
  }

  /* Thumbnails en ligne horizontale sous l'image (hors du crop overflow:hidden) */
  .product-detail-grid .thumbs-overlay {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 8px;
    margin-top: 10px;
    padding-bottom: 4px;
    top: auto;
    left: auto;
    bottom: auto;
    right: auto;
  }
  .product-detail-grid .thumbs-overlay::-webkit-scrollbar { display: none; }
  .product-detail-grid .thumb-wrap {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
  }

  /* Info produit */
  .product-detail-grid > div:last-child {
    padding: 0;
  }
}

@media (max-width: 480px) {
  .product-detail-grid .main-image-crop {
    aspect-ratio: 1;
    max-height: 300px;
    border-radius: 10px;
  }
  .product-detail-grid .thumb-wrap {
    width: 50px;
    height: 50px;
  }
}

/* ============================
   PAGE PRODUIT — SECTION INFO
   ============================ */

/* Titre produit */
@media (max-width: 768px) {
  .product-detail-grid h1 {
    font-size: 1.5rem !important;
    margin-bottom: 8px !important;
  }

  /* Prix */
  #price-main {
    font-size: 1.6rem !important;
  }

  /* Déclinaisons : scroll horizontal sur mobile si beaucoup */
  .declinations-grid {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .declinations-grid::-webkit-scrollbar { display: none; }
  .declination-btn {
    min-width: 100px;
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  .product-detail-grid h1 {
    font-size: 1.3rem !important;
  }
  #price-main {
    font-size: 1.4rem !important;
  }
}

/* ============================
   PAGE PRODUIT — SECTION PANIER
   ============================ */
@media (max-width: 480px) {
  .add-to-cart-section {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
  }
  .add-to-cart-section .qty-control {
    grid-column: 1;
  }
  .add-to-cart-section .btn-primary {
    grid-column: 2;
    width: 100%;
  }
  .add-to-cart-section .wishlist-toggle-btn {
    grid-column: 3;
    width: 44px !important;
    height: 44px !important;
  }
}

/* ============================
   PAGE PRODUIT — ONGLETS (TABS)
   ============================ */
.product-tabs-section {
  margin-top: 40px;
}
@media (min-width: 769px) {
  .product-tabs-section {
    margin-top: 60px;
  }
}

.product-tabs-nav {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 28px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
}
.product-tabs-nav::-webkit-scrollbar { display: none; }

/* Boutons onglets - style inline conservé depuis PHP mais position corrigée */
.product-tabs-nav .tab-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .product-tabs-nav .tab-btn {
    padding: 10px 16px !important;
    font-size: 12px !important;
  }
  .product-tabs-section [id^="tab-"] {
    font-size: 14px;
    line-height: 1.75;
  }
}

/* ============================
   PAGE PRODUIT — PRODUITS SIMILAIRES
   ============================ */

/* Sur mobile : slider horizontal */
@media (max-width: 768px) {
  /* Section produits similaires */
  .product-tabs-section ~ div .grid-4,
  section .grid.grid-4 {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 12px;
    padding-bottom: 8px;
  }
  section .grid.grid-4::-webkit-scrollbar { display: none; }
  section .grid.grid-4 > * {
    min-width: 175px;
    max-width: 175px;
    scroll-snap-align: start;
    flex-shrink: 0;
  }
}

/* Section produits similaires */
@media (max-width: 768px) {
  [style*="margin-top:60px"] .grid-4 {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    gap: 12px;
    padding-bottom: 8px;
  }
  [style*="margin-top:60px"] .grid-4::-webkit-scrollbar { display: none; }
  [style*="margin-top:60px"] .grid-4 > * {
    min-width: 175px;
    max-width: 175px;
    scroll-snap-align: start;
    flex-shrink: 0;
  }
}

/* ============================
   CHECKOUT — GRILLE PRINCIPALE
   ============================ */

/* Desktop : 2 colonnes */
.checkout-form-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 32px;
  align-items: start;
}

/* Tablette */
@media (max-width: 1024px) {
  .checkout-form-grid {
    grid-template-columns: 1fr 340px;
    gap: 24px;
  }
}

/* Mobile : 1 colonne, récap EN PREMIER (visible sans scroller) */
@media (max-width: 768px) {
  .checkout-form-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    /* Inverser l'ordre : récap d'abord, formulaire ensuite */
    display: flex;
    flex-direction: column;
  }
  /* La colonne droite (récap) remonte en premier sur mobile */
  .checkout-form-grid .checkout-summary-col {
    order: -1;
  }
}

/* ============================
   CHECKOUT — RÉCAPITULATIF (colonne droite)
   ============================ */

/* Desktop : sticky */
.checkout-summary-col {
  position: sticky;
  top: 100px;
}

/* Mobile : plus de sticky, hauteur libre */
@media (max-width: 768px) {
  .checkout-summary-col {
    position: static;
    top: auto;
  }

  /* Récapitulatif collapsé sur mobile avec accordion */
  .checkout-summary-col > div {
    padding: 16px !important;
  }

  /* Limiter la hauteur de la liste articles */
  .checkout-summary-col [style*="max-height:280px"] {
    max-height: 200px !important;
  }

  /* Articles du récap */
  .checkout-summary-col img[style*="width:56px"] {
    width: 48px !important;
    height: 48px !important;
  }
}

/* ============================
   CHECKOUT — SECTIONS FORMULAIRE
   ============================ */
@media (max-width: 768px) {
  /* Sections 1, 2, 3 du checkout */
  [style*="background:var(--white);border-radius:var(--radius-lg);padding:28px"] {
    padding: 18px !important;
  }

  /* Titres de section numérotés */
  .checkout-form-grid h2[style] {
    font-size: 1.1rem !important;
    margin-bottom: 16px !important;
  }

  /* Labels transporteurs */
  [name="carrier_id"] + div {
    font-size: 14px;
  }
  [name="carrier_id"] ~ span {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  /* Les grid-2 (prénom/nom, wilaya/commune) passent en 1 colonne */
  .checkout-form-grid .grid-2 {
    grid-template-columns: 1fr;
  }

  /* Sections */
  [style*="background:var(--white);border-radius:var(--radius-lg);padding:28px"] {
    padding: 14px !important;
    border-radius: 10px !important;
  }

  /* Bouton valider commande */
  #place-order-btn {
    font-size: 15px;
    padding: 14px 20px;
  }
}

/* ============================
   CHECKOUT — BANDEAU LIVRAISON GRATUITE
   ============================ */
@media (max-width: 640px) {
  /* Message "livraison gratuite dès X DA" */
  [style*="background:var(--beige)"][style*="border-radius"] {
    font-size: 13px;
  }
}

/* ============================
   FIX GLOBAL : override inline styles avec !important
   (sécurité supplémentaire pour les styles restants)
   ============================ */

/* Force la grille produit en 1 colonne sur mobile */
@media (max-width: 768px) {
  /* Cible le container de la grille produit si la classe n'est pas appliquée */
  .detail-gallery + div {
    margin-top: 0;
  }

  /* Authenticity box & share sur mobile */
  [style*="background:var(--off-white)"][style*="border-radius"][style*="font-size:13px"] {
    margin-top: 16px !important;
  }

  /* Partage */
  [style*="display:flex;align-items:center;gap:12px;font-size:13px"] {
    margin-top: 12px !important;
  }
}

/* ============================
   LIGHTBOX — FIX MOBILE
   ============================ */
@media (max-width: 640px) {
  #img-lightbox {
    padding: 16px;
  }
  #img-lightbox img {
    max-width: 100%;
    max-height: 72vh;
    border-radius: 8px;
  }
  .lb-close {
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    font-size: 24px;
  }
}

/* ============================
   PAGE PRODUIT — BANDEAU AUTH + SHARE
   ============================ */
@media (max-width: 480px) {
  /* Badges genre + référence */
  .gender-badge {
    font-size: 11px !important;
    padding: 3px 10px !important;
  }

  /* Étoiles + avis */
  [style*="display:flex;align-items:center;gap:8px;margin-bottom:16px"] span:first-child {
    font-size: 14px !important;
  }
}

/* ============================
   CHECKOUT — SECTION ARTICLES
   (accordéon récap mobile)
   ============================ */

/* Sur très petit écran : résumé compact */
@media (max-width: 380px) {
  .checkout-summary-col .checkout-summary-col > div {
    padding: 12px !important;
  }
}

/* ============================
   FIXES SUPPLÉMENTAIRES INLINE STYLES
   ============================ */

/* Section produit : padding réduit sur mobile */
@media (max-width: 768px) {
  section[style*="background:var(--white);padding:40px 0 60px"] {
    padding: 20px 0 40px !important;
  }
  /* Hauteur du spacer header */
  [style*="height:var(--header-h"] {
    height: var(--header-h, 108px);
  }
}

@media (max-width: 480px) {
  section[style*="background:var(--white);padding:40px 0 60px"] {
    padding: 16px 0 32px !important;
  }
}
