/* ============================================================================
   World Reseller — Vitrines de boutiques (multi-tenant) · v2.1
   Relooking complet : chaque boutique garde SES couleurs (--sf-primary,
   --sf-secondary injectées par le layout) qui irriguent tout le thème —
   dégradés, halos, accents, boutons. Base commune importée de app.css.
   ============================================================================ */

@import url('app.css');

/* ---- Application du thème boutique ---- */
.storefront {
    --primary: var(--sf-primary, #7C3AED);
    --primary-dark: color-mix(in srgb, var(--sf-primary, #7C3AED) 72%, #000);
    --primary-soft: color-mix(in srgb, var(--sf-primary, #7C3AED) 10%, #fff);
    --secondary: var(--sf-secondary, #06B6D4);
    --secondary-dark: color-mix(in srgb, var(--sf-secondary, #06B6D4) 72%, #000);
    --bg: color-mix(in srgb, var(--sf-primary, #7C3AED) 4%, #FAFAFC);
    font-family: var(--sf-font, var(--font));
    background: var(--bg);
}

/* ============================================================
   EN-TÊTE BOUTIQUE
   ============================================================ */
.sf-header {
    /* Fond OPAQUE : en sticky, aucun contenu ne doit transparaître derrière
       l'en-tête (le backdrop-filter n'est pas fiable sur tous les mobiles). */
    background: var(--card, #fff);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 12px rgba(11, 17, 32, .06);
    position: sticky; top: 0; z-index: 100;
}
/* Liseré signature aux couleurs de la boutique */
.sf-header::after {
    content: ''; display: block; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
}
.sf-header-inner {
    display: flex; align-items: center; gap: 1.2rem;
    padding-top: .8rem; padding-bottom: .8rem; flex-wrap: wrap;
}
.sf-brand { display: inline-flex; align-items: center; }
.sf-brand:hover { text-decoration: none; }
.sf-logo { max-height: 44px; width: auto; }
.sf-brand-name {
    font-weight: 800; font-size: 1.3rem;
    background: linear-gradient(120deg, var(--primary), var(--secondary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.sf-nav { display: flex; gap: .2rem; flex-wrap: wrap; align-items: center; }
.sf-nav a {
    color: var(--ink-soft); font-weight: 600; font-size: .93rem;
    padding: .45rem .85rem; border-radius: 999px; transition: .15s;
}
.sf-nav a:hover {
    color: var(--primary); background: var(--primary-soft);
    text-decoration: none;
}
.sf-header-actions { display: flex; align-items: center; gap: .55rem; }
.sf-account {
    display: inline-flex; align-items: center; gap: .3rem;
    color: var(--ink-soft); font-weight: 600; font-size: .9rem; white-space: nowrap;
}
.sf-account:hover { color: var(--primary); text-decoration: none; }

/* Bouton hamburger (masqué en desktop, visible en mobile) */
.sf-burger {
    display: none; flex: 0 0 auto;
    width: 42px; height: 42px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--card);
    cursor: pointer; place-items: center; transition: .15s;
}
.sf-burger:hover { border-color: var(--primary); background: var(--primary-soft); }
.sf-burger > span, .sf-burger > span::before, .sf-burger > span::after {
    content: ''; display: block; width: 20px; height: 2px;
    background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease, top .2s ease;
}
.sf-burger > span { position: relative; }
.sf-burger > span::before { position: absolute; top: -6px; }
.sf-burger > span::after  { position: absolute; top:  6px; }
/* Animation en croix quand le menu est ouvert */
.sf-menu-chk:checked ~ .sf-header-actions .sf-burger > span { background: transparent; }
.sf-menu-chk:checked ~ .sf-header-actions .sf-burger > span::before { top: 0; transform: rotate(45deg); }
.sf-menu-chk:checked ~ .sf-header-actions .sf-burger > span::after  { top: 0; transform: rotate(-45deg); }
.sf-search { flex: 1; min-width: 150px; }
.sf-search input {
    width: 100%; padding: .6rem 1rem; border: 1px solid var(--line);
    border-radius: 999px; background: var(--bg); transition: .15s;
}
.sf-search input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.sf-cart {
    font-size: 1.15rem; position: relative; color: var(--ink);
    display: inline-grid; place-items: center;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--primary-soft); transition: .15s;
}
.sf-cart:hover { transform: scale(1.06); text-decoration: none; }
.cart-count {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff; border-radius: 999px;
    font-size: .68rem; padding: .1rem .4rem; font-weight: 800;
    position: absolute; top: -3px; right: -5px;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 45%, transparent);
}

/* ============================================================
   SLIDER / BANNIÈRE
   ============================================================ */
.sf-slider { position: relative; overflow: hidden; }
.sf-slide { display: none; position: relative; }
.sf-slide.active { display: block; animation: sf-fade .5s ease; }
@keyframes sf-fade { from { opacity: .4; } to { opacity: 1; } }
.sf-slide img { width: 100%; max-height: 480px; object-fit: cover; display: block; }
/* Voile dégradé aux couleurs de la boutique pour la lisibilité */
.sf-slide::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(75deg,
        color-mix(in srgb, var(--primary-dark) 72%, transparent) 0%,
        color-mix(in srgb, var(--primary) 25%, transparent) 45%,
        transparent 75%);
}
.sf-slide-caption {
    position: absolute; left: 6%; bottom: 14%; color: #fff; max-width: 520px; z-index: 1;
}
.sf-slide-caption h2 {
    color: #fff; font-size: clamp(1.5rem, 4.5vw, 2.6rem); margin: 0 0 .45rem;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}
.sf-slide-caption p {
    margin: 0 0 1.1rem; font-size: 1.05rem; opacity: .95;
    text-shadow: 0 1px 10px rgba(0, 0, 0, .4);
}
.sf-slider-prev, .sf-slider-next {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
    background: rgba(255, 255, 255, .18); color: #fff;
    backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .35);
    width: 46px; height: 46px; border-radius: 50%; font-size: 1.4rem;
    cursor: pointer; transition: .15s;
}
.sf-slider-prev:hover, .sf-slider-next:hover { background: rgba(255, 255, 255, .35); }
.sf-slider-prev { left: 1.1rem; }
.sf-slider-next { right: 1.1rem; }
.sf-banner img { width: 100%; max-height: 400px; object-fit: cover; display: block; }

/* ============================================================
   SECTIONS & TITRES
   ============================================================ */
.storefront .section-title {
    position: relative; display: inline-block; padding-bottom: .45rem;
}
.storefront .section-title::after {
    content: ''; position: absolute; left: 0; bottom: 0;
    width: 46px; height: 4px; border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

/* ---- Cartes produit : lifting aux couleurs boutique ---- */
.storefront .product-card {
    border-radius: var(--radius);
    box-shadow: 0 1px 4px rgba(11, 17, 32, .05);
}
.storefront .product-card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 32px color-mix(in srgb, var(--primary) 22%, transparent);
}
.storefront .product-card-price strong { color: var(--primary); font-size: 1.06rem; }
.storefront .product-card-placeholder {
    background: linear-gradient(135deg,
        var(--primary-soft),
        color-mix(in srgb, var(--secondary) 12%, #fff));
}
.storefront .badge-sale {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

/* ============================================================
   FILTRES BOUTIQUE
   ============================================================ */
.sf-filters {
    display: flex; gap: .7rem; flex-wrap: wrap; margin: 1.1rem 0 1.7rem;
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: .9rem 1rem;
    box-shadow: var(--shadow);
}
.sf-filters input, .sf-filters select {
    padding: .6rem .85rem; border: 1px solid var(--line);
    border-radius: var(--radius-sm); font-family: inherit; background: #fff;
}
.sf-filters input[type="search"] { flex: 1; min-width: 180px; }
.sf-filters input:focus, .sf-filters select:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

/* ============================================================
   FICHE PRODUIT
   ============================================================ */
.product-layout {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2.2rem; margin-top: 1rem;
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow);
}
.product-main-image {
    width: 100%; aspect-ratio: 4/3; object-fit: cover;
    border-radius: var(--radius-sm); border: 1px solid var(--line);
    background: linear-gradient(135deg, var(--primary-soft),
        color-mix(in srgb, var(--secondary) 10%, #fff));
}
/* Miniatures de la galerie : petites vignettes cliquables (jamais pleine largeur). */
.thumb-row {
    display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem;
}
.thumb {
    width: 64px; height: 64px; flex: 0 0 auto;
    object-fit: cover; cursor: pointer;
    border-radius: var(--radius-sm); border: 1px solid var(--line);
    transition: border-color .15s ease, transform .15s ease;
}
.thumb:hover { border-color: var(--primary); transform: translateY(-1px); }
.product-info h1 { margin-top: 0; font-size: 1.65rem; }
.product-price {
    margin: 1rem 0; display: flex; gap: .7rem; align-items: baseline;
    background: var(--primary-soft);
    border-left: 4px solid var(--primary);
    padding: .8rem 1.1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.price-value {
    font-size: 2rem;
    background: linear-gradient(120deg, var(--primary), var(--secondary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.product-short { color: var(--ink-soft); font-size: 1.02rem; }
.product-actions { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin: 1.3rem 0; }
.qty-selector input {
    width: 80px; padding: .75rem; border: 1px solid var(--line);
    border-radius: var(--radius-sm); text-align: center; font-size: 1rem;
}
.product-description { margin-top: 2rem; }
/* Contenu riche (description produit / pages CMS) */
.rich-text { color: var(--ink-soft); line-height: 1.7; }
.rich-text h2 { font-size: 1.35rem; margin: 1.2rem 0 .5rem; }
.rich-text h3 { font-size: 1.15rem; margin: 1rem 0 .4rem; }
.rich-text h4 { font-size: 1.02rem; margin: .9rem 0 .35rem; }
.rich-text p { margin: 0 0 .9rem; }
.rich-text ul, .rich-text ol { margin: 0 0 .9rem 1.5rem; }
.rich-text li { margin: .2rem 0; }
.rich-text a { color: var(--primary); text-decoration: underline; }
.rich-text img { max-width: 100%; height: auto; border-radius: 8px; margin: .6rem 0; }
.rich-text blockquote {
    margin: 0 0 .9rem; padding: .5rem 0 .5rem 1rem; border-left: 3px solid var(--primary);
    color: var(--muted); font-style: italic;
}
.rich-text table { width: 100%; border-collapse: collapse; margin: 0 0 .9rem; }
.rich-text th, .rich-text td { border: 1px solid var(--line); padding: .5rem .7rem; text-align: left; }

/* ---- Avis clients ---- */
.review-list { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .8rem; }
.review {
    background: var(--bg); border: 1px solid var(--line);
    border-radius: var(--radius-sm); padding: 1rem 1.15rem;
    border-left: 4px solid var(--primary);
}
.review-head { display: flex; gap: .8rem; align-items: baseline; flex-wrap: wrap; }
.storefront .rating { color: var(--accent, #F59E0B); }

/* ============================================================
   PIED DE PAGE BOUTIQUE
   ============================================================ */
.sf-footer {
    position: relative; color: #CBD5E1; margin-top: 3.5rem;
    background:
        radial-gradient(640px 260px at 90% 0%, color-mix(in srgb, var(--primary) 30%, transparent), transparent),
        radial-gradient(640px 260px at 5% 100%, color-mix(in srgb, var(--secondary) 22%, transparent), transparent),
        var(--ink);
}
.sf-footer::before {
    content: ''; display: block; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
}
.sf-footer a { color: #CBD5E1; display: block; padding: .26rem 0; transition: color .15s, transform .15s; }
.sf-footer a:hover { color: #fff; transform: translateX(3px); }
.sf-footer h3 { color: #fff; font-size: .95rem; margin: 0 0 .7rem; }
.sf-footer .sf-brand-name {
    background: none; -webkit-text-fill-color: currentColor; color: #fff; font-size: 1.2rem; font-weight: 700;
}
.sf-footer-grid {
    display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; padding: 2.8rem 1.25rem 1.6rem;
}
.sf-footer-brand .sf-logo { max-height: 46px; margin-bottom: .6rem; }
.sf-footer-brand .muted { font-size: .88rem; margin: .4rem 0 .8rem; }
.sf-footer-cta {
    display: inline-block; color: #fff !important; font-weight: 600;
    border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; padding: .45rem 1rem;
}
.sf-footer-cta:hover { background: rgba(255, 255, 255, .12); transform: none !important; }
.sf-footer-bottom {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    border-top: 1px solid rgba(148, 163, 184, .2); padding: 1.1rem 1.25rem; font-size: .85rem;
}
.sf-footer-bottom p { margin: 0; }
.sf-powered { color: #fff !important; font-weight: 600; display: inline !important; }

/* Bannière héro (repli sans slider) */
.sf-hero {
    position: relative; overflow: hidden; color: #fff;
    background: linear-gradient(120deg, var(--primary), var(--secondary));
}
.sf-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .28; }
.sf-hero-inner { position: relative; padding: 4rem 1.25rem; max-width: 720px; }
.sf-hero-title { color: #fff; font-size: clamp(1.8rem, 5vw, 3rem); margin: 0 0 .6rem; }
.sf-hero-sub { color: rgba(255, 255, 255, .92); font-size: 1.1rem; margin: 0 0 1.4rem; }

/* Indicateurs (points) du slider */
.sf-slider-dots {
    position: absolute; left: 0; right: 0; bottom: 1rem; z-index: 2;
    display: flex; justify-content: center; gap: .5rem;
}
.sf-dot {
    width: 11px; height: 11px; border-radius: 50%; cursor: pointer;
    background: rgba(255, 255, 255, .5); border: 0; padding: 0; transition: .15s;
}
.sf-dot.active { background: #fff; transform: scale(1.25); }

/* ============================================================
   ESPACE CLIENT (tableau de bord)
   ============================================================ */
.account-dash { max-width: 920px; }
.account-head {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    flex-wrap: wrap; margin-bottom: 1.4rem;
}
.account-id { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.account-avatar {
    flex: 0 0 auto; width: 58px; height: 58px; border-radius: 50%;
    display: grid; place-items: center; font-size: 1.5rem; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 35%, transparent);
}
.account-name { margin: 0; font-size: 1.4rem; }
.account-mail { margin: .1rem 0 0; color: var(--ink-soft); font-size: .92rem; word-break: break-all; }
.account-store { margin: .15rem 0 0; }

.account-stats { display: flex; gap: .9rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.stat-chip {
    flex: 1 1 140px; background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 1rem 1.2rem;
    display: flex; flex-direction: column; gap: .15rem; box-shadow: var(--shadow);
}
.stat-chip-value {
    font-size: 1.9rem; font-weight: 800; line-height: 1;
    background: linear-gradient(120deg, var(--primary), var(--secondary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-chip-label { color: var(--muted); font-size: .85rem; font-weight: 600; }

.account-card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 1.3rem 1.4rem; margin-bottom: 1.4rem;
}
.account-card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.account-card-head h2 { margin: 0; font-size: 1.15rem; }
.account-note { margin: .4rem 0 .8rem; }
.account-empty { margin: .6rem 0 0; }
.table-wrap { overflow-x: auto; margin-top: .6rem; }
.account-table { min-width: 460px; }
.account-table tbody tr { transition: background .15s; }
.account-table tbody tr:hover { background: var(--primary-soft); }

/* Tableaux en « cartes » sur petits écrans : chaque ligne devient un bloc lisible */
@media (max-width: 560px) {
    .account-table { min-width: 0; }
    .account-table thead { display: none; }
    .account-table, .account-table tbody, .account-table tr, .account-table td { display: block; width: 100%; }
    .account-table tr {
        border: 1px solid var(--line); border-radius: var(--radius-sm);
        padding: .4rem .2rem; margin-bottom: .7rem;
    }
    .account-table td {
        display: flex; justify-content: space-between; align-items: center; gap: 1rem;
        border: 0; padding: .4rem .7rem; text-align: right;
    }
    .account-table td::before {
        content: attr(data-label); color: var(--muted); font-size: .78rem;
        font-weight: 700; text-transform: uppercase; letter-spacing: .03em; text-align: left;
    }
    .account-table td:last-child { justify-content: flex-end; }
    .account-table td:last-child::before { content: ''; }
}

/* ---- Choix compte / connexion au panier (onglets) ---- */
.auth-switch { display: flex; gap: .5rem; margin-bottom: 1.1rem; }
.auth-switch-btn {
    flex: 1; padding: .72rem .8rem; border: 1.5px solid var(--line);
    background: var(--card); border-radius: var(--radius-sm);
    font-weight: 700; font-size: .92rem; cursor: pointer; color: var(--ink-soft);
    transition: .15s ease;
}
.auth-switch-btn:hover { border-color: var(--primary); color: var(--primary); }
.auth-switch-btn.is-active {
    background: linear-gradient(120deg, var(--primary), var(--secondary));
    color: #fff; border-color: transparent;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 30%, transparent);
}
.auth-panel-login {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius-sm); padding: 1.15rem; margin-bottom: 1rem;
}

/* ---- Sélecteur de devise du panier ---- */
.cart-currency {
    display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
    margin: 0 0 1rem; padding: .7rem .9rem; background: var(--card);
    border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.cart-currency select {
    padding: .45rem .7rem; border: 1px solid var(--line);
    border-radius: var(--radius-sm); background: #fff; font-family: inherit;
}
.cart-currency [data-currency-note] { color: var(--muted); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
    /* --- En-tête mobile : logo à gauche, actions + hamburger à droite,
           recherche pleine largeur, menu en tiroir déroulant. --- */
    .sf-header-inner { gap: .6rem .55rem; padding-top: .7rem; padding-bottom: .7rem; }
    .sf-brand { margin-right: auto; }
    .sf-burger { display: inline-grid; }

    .sf-search { order: 10; flex-basis: 100%; min-width: 0; }

    .sf-nav {
        order: 11; flex-basis: 100%; width: 100%;
        display: none; flex-direction: column; gap: .15rem;
        background: var(--card); border: 1px solid var(--line);
        border-radius: var(--radius-sm); padding: .45rem; margin-top: .15rem;
        box-shadow: var(--shadow);
    }
    .sf-menu-chk:checked ~ .sf-nav { display: flex; animation: sf-fade .2s ease; }
    .sf-nav a { padding: .72rem .9rem; border-radius: var(--radius-sm); font-size: 1rem; }

    .product-layout { grid-template-columns: 1fr; padding: 1.1rem; }
    .sf-slide-caption { left: 5%; right: 5%; bottom: 9%; }
    .sf-footer-grid { grid-template-columns: 1fr 1fr; gap: 1.4rem; }
    .sf-hero-inner { padding: 2.8rem 1.25rem; }
}
@media (max-width: 480px) {
    /* L'étiquette texte du compte cède la place à l'icône seule. */
    .sf-account-label { display: none; }
    .sf-brand-name { font-size: 1.1rem; }
    .sf-header-actions { gap: .4rem; }

    .sf-footer-grid { grid-template-columns: 1fr; }
    .sf-footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ---- Moyens de paiement (logos sous le panier / paiement) ---- */
.payment-methods { margin-top: 1.5rem; text-align: center; }
.payment-methods-title { font-size: .85rem; color: var(--muted); margin: 0 0 .6rem; }
.payment-methods-logos { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; align-items: center; }
.payment-logo { height: 42px; width: auto; border-radius: 7px; box-shadow: 0 1px 4px rgba(0,0,0,.08); background: #fff; }
