/* ==========================================================
   AFRIDEALMARKET — PREMIUM HOMEPAGE REFRESH
   Compatible with the existing PHP sections and interactions
========================================================== */
:root{
  --afri-navy:#102b4e;
  --afri-blue:#1b4f83;
  --afri-green:#168653;
  --afri-green-dark:#0e6240;
  --afri-orange:#f5a900;
  --afri-ink:#182638;
  --afri-muted:#66758a;
  --afri-line:#e7edf2;
  --afri-bg:#f5f7f9;
  --afri-card:#fff;
  --afri-radius:18px;
  --afri-shadow:0 10px 30px rgba(16,43,78,.08);
}
html{scroll-behavior:smooth}
body{background:var(--afri-bg)!important;color:var(--afri-ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Arial,sans-serif!important}
body,main,#main-content{min-width:0;max-width:100%;overflow-x:clip}
img{max-width:100%}
.container,.site-container{width:min(1240px,calc(100% - 40px));max-width:1240px;margin-inline:auto}

/* Header and navigation */
.header{position:relative;z-index:100;background:#fff;box-shadow:0 3px 18px rgba(16,43,78,.06)}
.header-top{background:#fff!important;border-bottom:1px solid var(--afri-line)}
.header-flex{min-height:88px;gap:24px}
.logo img{width:auto!important;height:auto!important;max-height:72px;max-width:min(390px,42vw);object-fit:contain}
.auth-buttons{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.auth-buttons .btn{border-radius:999px!important;padding:10px 17px!important;font-weight:700!important;box-shadow:none!important;transition:transform .2s,background .2s}
.auth-buttons .btn:hover{transform:translateY(-2px)}
.auth-buttons .btn-login,.auth-buttons .btn-dashboard{background:#f1f5f9!important;color:var(--afri-navy)!important;border:1px solid #e2e8f0!important}
.auth-buttons .btn-register,.auth-buttons .btn-create{background:var(--afri-green)!important;color:#fff!important;border:1px solid var(--afri-green)!important}
.auth-buttons .btn-logout{background:#fff!important;color:#a33!important;border:1px solid #f0dada!important}
.menu{background:var(--afri-navy)!important;border:0!important}
.menu-flex{min-height:52px;gap:4px;align-items:center}
.menu a{color:#f8fbff!important;font-size:13px!important;font-weight:650!important;padding:13px 11px!important;border-radius:9px;white-space:nowrap;transition:background .2s,color .2s}
.menu a:hover,.menu a:focus{background:rgba(255,255,255,.13)!important;color:#fff!important}
.menu-toggle{border:0;border-radius:10px;background:var(--afri-green)!important;color:#fff!important;padding:9px 12px!important}
.lang-current{border-radius:9px!important}

/* Homepage rhythm */
#home-hero,#home-search,#home-categories,#home-slider,#home-youtube,#home-shops,#home-business,#home-hotels,#home-latest{width:100%;margin:0 auto}
#home-hero{padding:34px 20px 18px}
.hero{position:relative;isolation:isolate;overflow:hidden;max-width:1240px;margin:0 auto!important;min-height:390px;border-radius:26px!important;color:#fff!important;background:linear-gradient(100deg,rgba(10,37,66,.97) 0%,rgba(13,67,70,.88) 54%,rgba(14,72,62,.22) 100%),url('/public/assets/images/ecommerce.webp') right center/cover no-repeat!important;box-shadow:var(--afri-shadow)}
.hero:after{content:"";position:absolute;inset:auto -70px -170px auto;width:390px;height:390px;border:1px solid rgba(255,255,255,.17);border-radius:50%;z-index:-1}
.hero-content{position:relative;z-index:1;max-width:1160px!important;padding:48px 52px!important;text-align:left!important}
.hero-slogan{margin-bottom:12px}
.hero-slogan h1{font-size:clamp(13px,1.3vw,16px)!important;letter-spacing:.12em;text-transform:uppercase;color:#f8c64b!important;font-weight:800!important}
.hero-content>h1{max-width:690px;font-size:clamp(32px,4.3vw,54px)!important;line-height:1.08!important;letter-spacing:-.035em;font-weight:850!important;color:#fff!important;margin:0 0 16px!important}
.hero-content>p{max-width:650px;color:rgba(255,255,255,.88)!important;font-size:17px!important;line-height:1.7;margin:0 0 27px!important}
.hero-actions{display:flex!important;justify-content:flex-start!important;align-items:stretch;gap:10px!important;flex-wrap:wrap!important;max-width:850px}
.btn-hero{border:1px solid rgba(255,255,255,.28)!important;border-radius:12px!important;padding:12px 15px!important;min-height:48px;background:rgba(255,255,255,.12)!important;color:#fff!important;box-shadow:none!important;backdrop-filter:blur(8px);font-weight:700!important;transition:transform .2s,background .2s!important}
.btn-hero.primary{background:var(--afri-orange)!important;border-color:var(--afri-orange)!important;color:#172b3f!important}
.btn-hero:hover{transform:translateY(-3px);background:rgba(255,255,255,.22)!important}
.btn-hero.primary:hover{background:#ffc02e!important}

/* Search panel */
#home-search{padding:16px 20px 22px}
.search-section{max-width:1240px;margin:0 auto!important;padding:0!important;background:transparent!important;color:var(--afri-ink)!important;border-radius:0!important}
.search-section .section-title{font-size:21px!important;color:var(--afri-navy)!important;margin:0 0 12px!important;font-weight:800!important}
.search-section .search-meta{color:var(--afri-muted)!important}
.search-section .tabs{gap:8px!important;margin-bottom:12px!important}
.search-section .tab-btn{flex:0 0 auto!important;min-width:145px;border:1px solid var(--afri-line)!important;border-radius:999px!important;background:#fff!important;color:var(--afri-muted)!important;padding:11px 18px!important;font-weight:750!important}
.search-section .tab-btn.active{background:var(--afri-green)!important;border-color:var(--afri-green)!important;color:#fff!important}
.search-section .search-card{padding:22px!important;border:1px solid var(--afri-line);border-radius:18px!important;box-shadow:var(--afri-shadow)}
.search-section .form-title{color:var(--afri-navy)!important;font-weight:800!important;margin-bottom:15px!important}
.search-section input,.search-section select{min-height:46px!important;border:1px solid #dce4eb!important;border-radius:10px!important;background:#fff!important;color:var(--afri-ink)!important}
.search-section input:focus,.search-section select:focus{outline:3px solid rgba(22,134,83,.12)!important;border-color:var(--afri-green)!important}
.search-section .search-btn{border-radius:10px!important;background:var(--afri-green)!important;padding:12px 22px!important}

/* Shared section headings and cards */
.categories,.properties,.home-shops{max-width:1280px;margin:0 auto!important;padding:28px 20px!important}
.categories h2,.properties>h2,.properties .section-head h2,.home-shops>h2{font-size:clamp(22px,2.4vw,29px)!important;line-height:1.2;color:var(--afri-navy)!important;font-weight:850!important;text-align:left!important;margin:0 0 20px!important}
.categories h2:after,.properties>h2:after,.home-shops>h2:after{content:"";display:block;width:48px;height:4px;margin-top:10px;border-radius:4px;background:var(--afri-orange)}
.category-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:16px!important}
.category-card{position:relative!important;display:flex!important;align-items:flex-end!important;min-height:180px!important;overflow:hidden!important;border-radius:16px!important;background:#dfe8e8!important;box-shadow:0 6px 18px rgba(16,43,78,.08)!important;text-decoration:none!important;isolation:isolate}
.category-card:after{content:"";position:absolute;inset:35% 0 0;background:linear-gradient(transparent,rgba(8,25,44,.78));z-index:0}
.category-card img{position:absolute!important;inset:0;width:100%!important;height:100%!important;object-fit:cover!important;transition:transform .45s!important;z-index:-1}
.category-card:hover img{transform:scale(1.07)}
.category-card p{position:relative;z-index:1;width:100%;margin:0!important;padding:17px 16px!important;color:#fff!important;font-size:17px!important;font-weight:800!important;text-shadow:0 2px 8px rgba(0,0,0,.25)}

#home-slider{padding:18px 20px 8px}
.top-slide{max-width:1240px;margin:0 auto!important;padding:22px!important;background:#fff!important;border:1px solid var(--afri-line);border-radius:18px!important;box-shadow:var(--afri-shadow)}
.top-slide:before{content:"À découvrir";display:block;color:var(--afri-navy);font-size:20px;font-weight:850;margin:0 0 15px}
.slide-card{width:220px!important;border:1px solid var(--afri-line);border-radius:14px!important;box-shadow:0 5px 15px rgba(16,43,78,.07)!important}
.slide-card img{height:138px!important;object-fit:cover!important}
.slide-title{padding:10px 12px 2px!important;color:var(--afri-ink)!important;font-weight:750!important}
.ctrl-btn{background:var(--afri-navy)!important;box-shadow:0 4px 12px rgba(0,0,0,.14)}
.ctrl-btn:hover{background:var(--afri-green)!important}

.property-grid{grid-template-columns:repeat(auto-fit,minmax(235px,1fr))!important;gap:18px!important;justify-content:stretch!important}
.property-card,.business-card{height:100%;overflow:hidden;border:1px solid var(--afri-line)!important;border-radius:16px!important;background:#fff!important;box-shadow:0 5px 18px rgba(16,43,78,.06)!important;transition:transform .22s,box-shadow .22s!important}
.property-card:hover,.business-card:hover{transform:translateY(-4px);box-shadow:var(--afri-shadow)!important}
.property-card>img,.business-card>img{width:100%!important;height:190px!important;object-fit:cover!important;background:#edf1f4}
.card-content{padding:16px!important}
.card-content h3,.property-card h3{font-size:16px!important;line-height:1.4;color:var(--afri-ink)!important;font-weight:800!important}
.property-actions{gap:8px!important}
.btn-action{border-radius:9px!important;font-weight:750!important}
.badge{border-radius:999px!important;background:#eaf6ef!important;color:var(--afri-green-dark)!important;padding:5px 10px!important}

.home-shops .shops-scroll{gap:16px!important}
.shop-card-home{border:1px solid var(--afri-line)!important;border-radius:16px!important;overflow:hidden;background:#fff!important;box-shadow:0 5px 18px rgba(16,43,78,.06)!important}
.shop-banner img{width:100%;height:145px;object-fit:cover}
.shop-body{padding:15px!important}
.shop-logo{width:62px!important;height:62px!important;object-fit:cover!important;border:3px solid #fff!important;box-shadow:0 2px 10px rgba(0,0,0,.1)}

#home-youtube{padding:12px 20px}
#home-business,#home-hotels,#home-latest{padding-block:6px}
.results-wrapper{max-width:1240px;margin:22px auto!important;padding:20px!important;background:#fff;border:1px solid var(--afri-line);border-radius:18px}
.gallery-card{overflow:hidden;border:1px solid var(--afri-line)!important;border-radius:14px!important;box-shadow:0 5px 15px rgba(16,43,78,.05)!important}
.gallery-card .img-box{height:190px!important}
.gallery-card .img-box img{width:100%;height:100%;object-fit:cover}

/* Footer / floating helpers */
footer,.footer{background:#102b4e!important;color:#eaf1f8!important}
.assistant-float,.whatsapp-float{filter:drop-shadow(0 5px 12px rgba(0,0,0,.18))}

/* Responsive */
@media(max-width:900px){
  .header-flex{min-height:76px;flex-wrap:wrap;padding-block:10px}
  .logo img{max-width:52vw;max-height:58px}
  .menu-flex{align-items:stretch}
  .menu a{padding:11px 10px!important}
  .hero-content{padding:38px 30px!important}
  .category-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .category-card{min-height:155px!important}
}
@media(max-width:600px){
  .container,.site-container{width:calc(100% - 28px)}
  .header-flex{justify-content:space-between;gap:10px}
  .logo img{max-width:58vw;max-height:52px}
  .auth-buttons{width:100%;justify-content:flex-start;gap:6px}
  .auth-buttons .btn{font-size:12px!important;padding:8px 11px!important}
  #home-hero{padding:18px 12px 10px}
  .hero{min-height:420px;border-radius:18px!important;background-position:62% center!important}
  .hero-content{padding:30px 22px!important}
  .hero-content>h1{font-size:34px!important}
  .hero-content>p{font-size:14px!important}
  .hero-actions{display:grid!important;grid-template-columns:1fr 1fr;gap:8px!important}
  .btn-hero{min-width:0!important;padding:10px!important;font-size:12px!important;justify-content:center}
  #home-search{padding:12px}
  .search-section .search-card{padding:15px!important}
  .search-section .grid-3{grid-template-columns:1fr!important}
  .search-section .tabs{overflow-x:auto;padding-bottom:4px}
  .categories,.properties,.home-shops{padding:22px 14px!important}
  .category-grid{gap:10px!important}
  .category-card{min-height:128px!important;border-radius:12px!important}
  .category-card p{font-size:14px!important;padding:12px!important}
  #home-slider{padding:12px}
  .top-slide{padding:15px!important}
  .property-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  .property-card>img,.business-card>img{height:135px!important}
  .card-content{padding:11px!important}
  .card-content h3,.property-card h3{font-size:13px!important}
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition:none!important}}


/* ==========================================================
   LAYOUT REFINEMENT — TOP SLIDER, SEARCH, FULL-WIDTH HERO
   Less outer whitespace; wider galleries on desktop.
========================================================== */
#home-slider{order:1;width:100%;padding:10px 12px 6px!important;margin:0!important}
#home-search{order:2;width:100%;padding:8px 12px 12px!important;margin:0!important}
#home-hero{order:3;width:100%;padding:0 12px 12px!important;margin:0!important}
#home-categories{order:4;width:100%;padding:12px!important;margin:0!important}
.top-slide{width:100%!important;max-width:none!important;margin:0!important;padding:12px 14px!important;border-radius:12px!important}
.top-slide:before{margin-bottom:9px!important}
.search-section{width:100%!important;max-width:none!important;margin:0!important}
.search-section .search-card{padding:15px 18px!important}
.hero{width:100%!important;max-width:none!important;min-height:350px;margin:0!important;border-radius:14px!important;background-position:center!important}
.hero-content{width:100%!important;max-width:none!important;padding:42px clamp(22px,4vw,64px)!important}
.hero-content>h1,.hero-content>p{max-width:760px!important}
.hero-actions{max-width:100%!important}
.categories,.properties,.home-shops{width:100%!important;max-width:none!important;margin:0!important;padding:16px 12px!important}
#home-youtube{width:100%!important;padding:10px 12px!important}
#home-business,#home-hotels,#home-latest{width:100%!important;padding:6px 12px!important}
.results-wrapper{width:calc(100% - 24px)!important;max-width:none!important;margin:10px 12px!important;padding:14px!important;border-radius:12px!important}
.gallery-grid{width:100%!important;gap:12px!important}
.gallery-card{width:100%;min-width:0}
.category-grid{gap:12px!important}
.property-grid{gap:14px!important}
@media(min-width:1200px){
  .hero{min-height:370px!important}
  .category-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  .property-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  .gallery-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}
@media(max-width:900px){
  #home-slider{padding:8px 10px 4px!important}
  #home-search{padding:8px 10px!important}
  #home-hero{padding:0 10px 10px!important}
  .hero{min-height:320px!important}
  .hero-content{padding:30px 22px!important}
}
@media(max-width:600px){
  #home-slider{padding:6px 8px 3px!important}
  #home-search{padding:6px 8px 8px!important}
  #home-hero{padding:0 8px 8px!important}
  .top-slide{padding:10px!important}
  .hero{min-height:400px!important;border-radius:12px!important}
  .hero-content{padding:26px 18px!important}
  .categories,.properties,.home-shops{padding:14px 8px!important}
  #home-youtube,#home-business,#home-hotels,#home-latest{padding-left:8px!important;padding-right:8px!important}
  .results-wrapper{width:calc(100% - 16px)!important;margin:8px!important;padding:10px!important}
  .gallery-grid{gap:8px!important}
}

/* ==========================================================
   HEADER NAVIGATION — UNIFORM DESKTOP MENU
   All navigation entries share the same width, height and alignment.
========================================================== */
@media (min-width:769px){
  .menu-flex{
    display:grid!important;
    grid-template-columns:repeat(12,minmax(0,1fr));
    align-items:stretch!important;
    justify-content:stretch!important;
    gap:5px!important;
    padding:6px 0!important;
  }
  .menu-flex > a,
  .menu-flex > .lang-switch{
    min-width:0;
    width:100%;
    min-height:54px;
    height:54px;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
    border-radius:9px!important;
    padding:5px 4px!important;
    margin:0!important;
    line-height:1.15!important;
    white-space:normal!important;
    overflow-wrap:anywhere;
    font-size:12px!important;
    font-weight:700!important;
    background:transparent!important;
    border:1px solid transparent!important;
    color:#f8fbff!important;
  }
  .menu-flex > a:hover,
  .menu-flex > a:focus-visible,
  .menu-flex > .lang-switch:hover{
    background:rgba(255,255,255,.13)!important;
    border-color:rgba(255,255,255,.12)!important;
    color:#fff!important;
  }
  /* Remove special sizing/colors so every menu item follows one system. */
  .menu-flex > a.menu-emplois,
  .menu-flex > a.menu-transport,
  .menu-flex > a.menu-salle-fete{
    background:transparent!important;
    border-color:transparent!important;
    color:#f8fbff!important;
  }
  .menu-flex > .lang-switch{
    position:relative;
    padding:0!important;
  }
  .menu-flex > .lang-switch .lang-current{
    width:100%;
    height:100%;
    min-width:0;
    justify-content:center;
    gap:4px;
    padding:5px 3px!important;
    border:0!important;
    border-radius:9px!important;
    background:transparent!important;
    color:#f8fbff!important;
    font-size:12px!important;
  }
  .menu-flex > .lang-switch .lang-current:hover{
    background:rgba(255,255,255,.13)!important;
  }
  .menu-flex > .lang-switch .lang-name{display:none}
  .menu-flex > .lang-switch .flag{width:20px;height:20px}
  .menu-flex > .lang-switch .lang-arrow{color:#f8fbff}
}

@media (min-width:769px) and (max-width:1100px){
  .menu-flex{grid-template-columns:repeat(6,minmax(0,1fr))}
  .menu-flex > a,.menu-flex > .lang-switch{height:48px;min-height:48px}
}

@media (max-width:768px){
  .menu-flex{display:flex!important;grid-template-columns:none!important}
  .menu-flex > a{height:auto;min-height:0}
}
