/* ═══════════════════════════════════════════════════════════════
   HERO PRODUCT V5 — Logo Communication — hero-product.css
   Chargé uniquement sur les 5 pages produits
   Sélecteurs scopés à .product-template .hero
   ═══════════════════════════════════════════════════════════════ */

/* ─── Variables locales (héritage du design system) ─────────── */
.product-template {
    --text: #0a0a0f;
    --text-sec: #3a3a44;
    --text-muted: #6e6e78;
    --border: rgba(10,10,15,0.09);
    --bg-cream: #faf8f2;
    --bg-subtle: #f4f1ea;
    --red: #b01d2c;
    --purple: #5b21b6;
    --blue: #1e40af;
    --grad: linear-gradient(135deg, #b01d2c 0%, #5b21b6 55%, #1e40af 100%);
    --font-display: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── HERO WRAPPER ──────────────────────────────────────────── */
.product-template .hero {
    position: relative;
    height: 100vh;
    padding: 120px 0 20px;
    background: var(--bg-cream);
    overflow: hidden;
    display: flex;
    align-items: center;
}
.product-template .hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 18% 28%, rgba(91,33,182,0.05) 0%, transparent 42%),
        radial-gradient(circle at 88% 72%, rgba(176,29,44,0.04) 0%, transparent 42%),
        linear-gradient(to right, rgba(10,10,15,0.022) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(10,10,15,0.022) 1px, transparent 1px);
    background-size: auto, auto, 80px 80px, 80px 80px;
    mask-image: radial-gradient(ellipse at center, #000 28%, transparent 82%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 28%, transparent 82%);
}

/* ─── INNER GRID ────────────────────────────────────────────── */
.product-template .hero-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1440px;
    height: 100%;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 48px);
    display: grid;
    grid-template-columns: 1.9fr 1fr;
    gap: 16px 32px;
    align-items: stretch;
}

/* ─── STAGE (configurateur) ─────────────────────────────────── */
.product-template .stage {
    position: relative;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 28px 28px 18px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.09), 0 6px 18px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}
.product-template .stage-head {
    order: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.product-template .stage-head-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 640px;
}
.product-template .stage-badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(176,29,44,0.06) 0%, rgba(91,33,182,0.06) 55%, rgba(30,64,175,0.06) 100%);
    border: 1px solid rgba(91,33,182,0.15);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 700;
    color: var(--purple);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.product-template .stage-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--purple);
    box-shadow: 0 0 12px var(--purple);
    animation: heroProductPulse 1.8s ease-in-out infinite;
}
@keyframes heroProductPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
}
.product-template .stage-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.7rem, 2.6vw, 2.6rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    margin: 0;
    color: var(--text);
}
.product-template .stage-title .grad {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.product-template .stage-sub {
    font-size: 0.95rem;
    color: var(--text-sec);
    line-height: 1.5;
    margin: 0;
}

/* ─── CANVAS 3D ─────────────────────────────────────────────── */
.product-template .canvas {
    flex: 1 1 0;
    min-height: 620px;
    background: linear-gradient(135deg, #fafafa 0%, #eeece4 100%);
    border: none;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.product-template .canvas::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(10,10,15,0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(10,10,15,0.04) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: radial-gradient(circle at center, #000 38%, transparent 78%);
    -webkit-mask-image: radial-gradient(circle at center, #000 38%, transparent 78%);
    pointer-events: none;
}
.product-template .canvas-tag {
    position: absolute;
    top: 14px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(0,0,0,0.72);
    color: #fff;
    backdrop-filter: blur(8px);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.product-template .canvas-tag::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: heroProductPulse 1.6s ease-in-out infinite;
}
.product-template .canvas-3d {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
}
.product-template .canvas-3d-letters {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(4rem, 10vw, 9rem);
    letter-spacing: -0.04em;
    background: linear-gradient(180deg, #1a1a20 0%, #4a4a55 50%, #aaaab3 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 14px 20px rgba(0,0,0,0.15));
    line-height: 1;
}
.product-template .canvas-dim {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    background: rgba(0,0,0,0.78);
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
}
.product-template .canvas-dim.w { bottom: 18%; left: 50%; transform: translateX(-50%); }
.product-template .canvas-dim.h { top: 50%; right: 22%; transform: translateY(-50%); }
.product-template .canvas-controls {
    position: absolute;
    bottom: 14px;
    right: 14px;
    display: flex;
    gap: 6px;
}
.product-template .canvas-ctrl {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sec);
    cursor: pointer;
    transition: all 0.2s ease;
}
.product-template .canvas-ctrl:hover {
    color: var(--purple);
    border-color: var(--purple);
}

/* ═══════════════════════════════════════════════════════════════
   STAGE FULL — Quand React est monté, masquer le stage-head
   et supprimer le padding pour que le canvas prenne tout.
   ═══════════════════════════════════════════════════════════════ */

/* Quand React est actif : masquer le titre, enlever le padding */
.product-template .stage:has(#enseigne-root:not(:empty)) {
    padding: 0;
    gap: 0;
}
.product-template .stage:has(#enseigne-root:not(:empty)) .stage-head {
    display: none !important;
}

/* ─── CONFIGURATEUR REACT (enseigne-root) ──────────────────── */
.product-template .canvas-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 100%;
    flex-direction: column;
    gap: 14px;
}

.product-template #enseigne-root {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: none;
    overflow: hidden;
}

/* Quand React monte du contenu, afficher et masquer le placeholder */
.product-template #enseigne-root:not(:empty) {
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-template .canvas:has(#enseigne-root:not(:empty)) .canvas-placeholder {
    visibility: hidden;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   CONFIGURATEUR INLINE — Contenu dans .canvas par défaut
   Le React build utilise 100vw/100vh + position:fixed.
   On override ici pour forcer le mode inline (contenu dans .canvas).
   Le bouton zoom/agrandir ajoute .config-modal--fullscreen → escape.
   ═══════════════════════════════════════════════════════════════ */

/* 1. app-root : contenu dans le canvas, pas le viewport */
.product-template .canvas .app-root {
    width: 100% !important;
    height: 100% !important;
    overflow: hidden;
}

/* 2. config-modal : inline par défaut (absolute dans .canvas) */
.product-template .canvas .config-modal {
    z-index: 1 !important;
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
}
.product-template .canvas .config-modal .config-modal__backdrop {
    display: none !important;
}
.product-template .canvas .config-modal .config-modal__content {
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    box-shadow: none !important;
    border-radius: 17px !important;
}

/* 3. control-panel : pas fixed, contenu dans le canvas */
.product-template .canvas .control-panel {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    left: auto !important;
    z-index: 10;
    max-height: calc(100% - 24px);
    overflow-y: auto;
}

/* 4. control-panel toggle : pas fixed */
.product-template .canvas .control-panel__toggle {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    z-index: 10;
}

/* 5. Teaser vitrine/dashboard : 100% du canvas, layout vertical */
.product-template .canvas .teaser-vitrine {
    width: 100% !important;
    height: 60% !important;
}
.product-template .canvas .teaser-dashboard {
    width: 100% !important;
    height: 40% !important;
}

/* 6. wall-color-selector : pas fixed, reste dans le canvas */
.product-template .canvas .wall-color-selector {
    position: absolute !important;
}

/* 7. config-launch button : pas fixed */
.product-template .canvas .config-launch {
    position: absolute !important;
}

/* ═══════════════════════════════════════════════════════════════
   FULLSCREEN — Quand l'utilisateur clique "Agrandir" (zoom)
   React ajoute .config-modal--fullscreen → escape du .canvas
   ═══════════════════════════════════════════════════════════════ */

/* Override les règles inline ci-dessus pour repasser en fixed */
.product-template .canvas .config-modal.config-modal--fullscreen {
    z-index: 999999 !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
}
.product-template .canvas .config-modal.config-modal--fullscreen .config-modal__backdrop {
    display: block !important;
}
.product-template .canvas .config-modal.config-modal--fullscreen .config-modal__content {
    width: 75% !important;
    max-width: 1200px !important;
    height: 80dvh !important;
    max-height: 80dvh !important;
    box-shadow: 0 32px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06) !important;
    border-radius: 20px !important;
}

/* Relâcher overflow sur les ancêtres uniquement en fullscreen */
.product-template .stage:has(.config-modal--fullscreen) {
    overflow: visible;
}
.product-template #enseigne-root:has(.config-modal--fullscreen) {
    overflow: visible;
}
.product-template .canvas:has(.config-modal--fullscreen) {
    overflow: visible;
}

/* ─── TOOLBAR (chips) ───────────────────────────────────────── */
.product-template .toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.product-template .chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sec);
    cursor: pointer;
    transition: all 0.25s var(--ease);
}
.product-template .chip:hover {
    border-color: var(--purple);
    color: var(--purple);
    background: #fff;
}
.product-template .chip svg {
    width: 13px;
    height: 13px;
    color: var(--purple);
    flex-shrink: 0;
}
.product-template .chip.active {
    background: #fff;
    border-color: var(--purple);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(91,33,182,0.12);
}

/* ─── SIDEBAR ───────────────────────────────────────────────── */
.product-template .sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    overflow: hidden;
    min-height: 0;
}
.product-template .card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.05);
}

/* ─── CAROUSEL ──────────────────────────────────────────────── */
.product-template .carousel-card {
    padding: 0;
    overflow: hidden;
    flex: 0 0 auto;
    aspect-ratio: 1 / 1;
    position: relative;
    border: none;
    box-shadow: 0 16px 40px rgba(91,33,182,0.18), 0 4px 14px rgba(176,29,44,0.12);
}
.product-template .carousel-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--grad);
    z-index: 5;
    border-radius: 22px 22px 0 0;
}
.product-template .carousel {
    position: relative;
    width: 100%;
    height: 100%;
    background: #0a0a0f;
    border-radius: 22px;
    overflow: hidden;
}
.product-template .carousel img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s var(--ease), transform 6s var(--ease);
    transform: scale(1.05);
}
.product-template .carousel img.active {
    opacity: 1;
    transform: scale(1);
}
.product-template .carousel::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(10,10,15,0.85) 0%, rgba(10,10,15,0.15) 40%, rgba(10,10,15,0) 70%),
        linear-gradient(135deg, rgba(176,29,44,0.15) 0%, rgba(91,33,182,0.1) 50%, rgba(30,64,175,0.08) 100%);
    pointer-events: none;
    z-index: 1;
}
.product-template .carousel-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--purple);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.product-template .carousel-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 10px var(--red);
    animation: heroProductPulse 1.8s ease-in-out infinite;
}
.product-template .caption-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 18px 20px 56px;
    color: #fff;
}
.product-template .caption-kicker {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.75);
    margin-bottom: 4px;
}
.product-template .caption {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    line-height: 1.25;
    text-shadow: 0 2px 14px rgba(0,0,0,0.6);
}
.product-template .caption .grad-light {
    background: linear-gradient(135deg, #ff6b7f 0%, #b895ff 55%, #7ea1ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.product-template .dots {
    position: absolute;
    bottom: 18px;
    left: 20px;
    right: 60px;
    display: flex;
    gap: 4px;
    z-index: 3;
}
.product-template .dots button {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    border: none;
    padding: 0;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: background 0.4s ease, transform 0.3s ease;
    position: relative;
    overflow: hidden;
}
.product-template .dots button.active {
    background: linear-gradient(90deg, var(--red) 0%, var(--purple) 55%, var(--blue) 100%);
}
.product-template .c-nav {
    position: absolute;
    bottom: 12px;
    z-index: 3;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
.product-template .c-nav:hover {
    background: #fff;
    color: var(--purple);
    transform: scale(1.08);
}
.product-template .c-nav.prev { display: none; }
.product-template .c-nav.next { right: 14px; }

/* ─── BENEFITS CARD ─────────────────────────────────────────── */
.product-template .benefits-card {
    padding: 14px 16px;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
    overflow: visible;
}
.product-template .section-title {
    font-family: var(--font-display);
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.product-template .section-title::before {
    content: "";
    width: 18px;
    height: 1.5px;
    background: var(--grad);
}
.product-template .benefits {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
}
.product-template .benefit {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 4px;
    border-bottom: 1px solid var(--border);
    transition: all 0.3s var(--ease);
}
.product-template .benefit:last-child { border-bottom: none; }
.product-template .benefit:hover { padding-left: 8px; }
.product-template .benefit-icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--grad);
    color: #fff;
    box-shadow: 0 3px 8px rgba(91,33,182,0.2);
}
.product-template .benefit-icon svg { width: 15px; height: 15px; }
.product-template .benefit-text { min-width: 0; }
.product-template .benefit-text strong {
    display: block;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1px;
    line-height: 1.2;
}
.product-template .benefit-text span {
    display: block;
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.35;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤ 1024px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .product-template .hero {
        height: auto;
        min-height: 100vh;
        padding: 96px 0 24px;
    }
    .product-template .hero-inner {
        grid-template-columns: 1fr;
        height: auto;
        gap: 20px;
    }
    .product-template .stage  { height: auto; }
    .product-template .sidebar { height: auto; }
    .product-template .canvas {
        min-height: 380px;
    }
    .product-template .carousel-card {
        min-height: 280px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 640px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .product-template .hero { padding: 72px 0 16px; }
    .product-template .hero-inner {
        padding: 0 12px;
        gap: 14px;
        max-width: 100%;
        overflow-x: hidden;
        overflow-y: visible;
    }
    .product-template .stage {
        border-radius: 20px;
        padding: 0;
        gap: 0;
        max-width: 100%;
    }
    .product-template .canvas {
        min-height: 260px;
        border-radius: 14px;
    }
    .product-template .canvas-3d-letters {
        font-size: clamp(3rem, 16vw, 5rem);
    }
    .product-template .canvas-tag {
        top: 10px;
        left: 10px;
        font-size: 9px;
        padding: 4px 8px;
    }
    .product-template .canvas-dim { font-size: 10px; padding: 4px 8px; }
    .product-template .canvas-controls { bottom: 10px; right: 10px; }
    .product-template .canvas-ctrl { width: 30px; height: 30px; border-radius: 6px; }
    .product-template .stage-head { flex-direction: column; gap: 8px; }
    .product-template .stage-badge { font-size: 9.5px; padding: 4px 10px; }
    .product-template .stage-title { font-size: 1.4rem; }
    .product-template .stage-sub { font-size: 0.85rem; }

    /* Sidebar mobile */
    .product-template .sidebar {
        gap: 12px;
        overflow: visible;
        height: auto;
        min-height: auto;
    }
    .product-template .carousel-card { aspect-ratio: 1 / 1; }
    .product-template .caption { font-size: 14px; }
    .product-template .caption-kicker { font-size: 9px; }
    .product-template .carousel-badge { font-size: 9px; padding: 5px 10px; top: 10px; left: 10px; }
    .product-template .dots { bottom: 14px; left: 14px; right: 50px; }
    .product-template .c-nav.next { right: 10px; bottom: 8px; width: 32px; height: 32px; }

    /* Benefits card — pleine hauteur, grille 3 colonnes */
    .product-template .benefits-card {
        padding: 16px 14px 20px;
        flex: 0 0 auto;
        overflow: visible;
        min-height: auto;
        border-radius: 16px;
        background: #fff;
        border: 1px solid var(--border);
        box-shadow: 0 4px 14px rgba(0,0,0,0.05);
    }
    .product-template .section-title { font-size: 9px; }
    .product-template .benefit {
        flex: 1;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 10px 6px 4px;
        gap: 8px;
        border-bottom: none;
        border-right: 1px solid var(--border);
        overflow: visible;
    }
    .product-template .benefit:last-child { border-right: none; }
    .product-template .benefit:hover { padding-left: 6px; }
    .product-template .benefits {
        flex-direction: row;
        gap: 0;
        overflow: visible;
        min-height: auto;
        flex: 0 0 auto;
    }
    .product-template .benefit-icon { width: 36px; height: 36px; border-radius: 10px; }
    .product-template .benefit-icon svg { width: 16px; height: 16px; }
    .product-template .benefit-text strong { font-size: 11.5px; text-align: center; line-height: 1.3; }
    .product-template .benefit-text span { display: none; }
    .product-template .chip { font-size: 11px; padding: 6px 10px; }
}

@media (max-height: 700px) and (min-width: 1025px) {
    .product-template .sidebar { overflow-y: auto; scrollbar-width: thin; }
}
