/* ==========================================================================
   BrahimGSM v5 — Variantes Hero & Cartes Produit
   Active via body.hero-v-* et body.card-v-*
   ========================================================================== */

/* ================================================================== */
/* HERO — Classique (defaut, ajustements legers)                       */
/* ================================================================== */

.hero-v-classic .mg-hero__title {
    letter-spacing: var(--tracking-tight);
}

/* ================================================================== */
/* HERO — Cinematique (immersif, grand titre, glow)                    */
/* ================================================================== */

.hero-v-cinematic .mg-hero,
.hero-v-cinematic .mg-hero-section .mg-hero {
    min-height: clamp(440px, 58vh, 620px);
}
.hero-v-cinematic .mg-hero::before {
    background:
        linear-gradient(100deg, rgba(18, 18, 18, 0.97) 0%, rgba(18, 18, 18, 0.72) 42%, rgba(0, 122, 255, 0.22) 100%);
}
.hero-v-cinematic .mg-hero--gradient::before {
    background:
        radial-gradient(ellipse 70% 55% at 85% 25%, rgba(0, 122, 255, 0.35), transparent 55%),
        radial-gradient(ellipse 50% 40% at 10% 80%, rgba(90, 200, 250, 0.12), transparent 50%),
        linear-gradient(155deg, #050505 0%, #121212 45%, rgba(0, 122, 255, 0.18) 100%);
}
.hero-v-cinematic .mg-hero__glow {
    position: absolute;
    width: min(420px, 55vw);
    height: min(420px, 55vw);
    right: 8%;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 122, 255, 0.35) 0%, transparent 68%);
    filter: blur(40px);
    z-index: 0;
    pointer-events: none;
    animation: mg-hero-glow-pulse 6s ease-in-out infinite;
}
@keyframes mg-hero-glow-pulse {
    0%, 100% { opacity: 0.65; transform: translateY(-50%) scale(1); }
    50% { opacity: 1; transform: translateY(-50%) scale(1.08); }
}
.hero-v-cinematic .mg-hero__inner {
    max-width: 680px;
    padding: var(--space-16) 0;
}
.hero-v-cinematic .mg-hero__title {
    font-size: clamp(2rem, 4.8vw, 3.75rem);
    text-shadow: 0 4px 32px rgba(0, 0, 0, 0.45);
}
.hero-v-cinematic .mg-hero__subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    max-width: 540px;
}
.hero-v-cinematic .mg-hero__device-frame {
    position: relative;
    display: inline-block;
    padding: var(--space-3);
    border-radius: var(--radius-xl);
    background: linear-gradient(145deg, rgba(255,255,255,0.12), rgba(255,255,255,0.02));
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        0 32px 64px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(0, 122, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.hero-v-cinematic .mg-hero__device-frame::before {
    content: '';
    position: absolute;
    inset: -20%;
    background: radial-gradient(circle, rgba(0, 122, 255, 0.25), transparent 60%);
    z-index: -1;
    filter: blur(24px);
}
.hero-v-cinematic .mg-hero__device-frame img {
    display: block;
    border-radius: calc(var(--radius-xl) - 8px);
    max-width: 100%;
}

/* ================================================================== */
/* HERO — Minimal (centre, compact, grille subtile)                    */
/* ================================================================== */

.hero-v-minimal .mg-hero,
.hero-v-minimal .mg-hero-section .mg-hero {
    min-height: clamp(320px, 42vh, 420px);
    align-items: center;
    justify-content: center;
    text-align: center;
}
.hero-v-minimal .mg-hero--gradient {
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    background-color: var(--charcoal);
}
.hero-v-minimal .mg-hero--gradient::before {
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 122, 255, 0.14), transparent 60%);
}
.hero-v-minimal .mg-hero::before {
    background: linear-gradient(180deg, rgba(18,18,18,0.4) 0%, rgba(18,18,18,0.88) 100%);
}
.hero-v-minimal .mg-hero .container {
    display: flex;
    justify-content: center;
}
.hero-v-minimal .mg-hero__inner {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
    padding: var(--space-10) 0;
}
.hero-v-minimal .mg-hero__actions {
    justify-content: center;
}
.hero-v-minimal .mg-hero__title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: var(--font-bold);
}
.hero-v-minimal .mg-hero__subtitle {
    margin-left: auto;
    margin-right: auto;
    max-width: 520px;
    font-size: var(--text-base);
}
.hero-v-minimal .mg-hero__eyebrow {
    margin-left: auto;
    margin-right: auto;
}
.hero-v-minimal .mg-hero-section .carousel-control-prev,
.hero-v-minimal .mg-hero-section .carousel-control-next {
    opacity: 0.5;
}

@media (prefers-reduced-motion: reduce) {
    .hero-v-cinematic .mg-hero__glow { animation: none; }
}

/* --- Hero minimal pages catalogue --- */
.mg-page-hero.mg-hero--minimal {
    min-height: auto;
    border-bottom: 1px solid var(--charcoal-border);
}
.mg-page-hero .mg-hero__inner {
    padding: var(--space-8) 0 var(--space-6);
}
.mg-page-hero .mg-hero__title {
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
}
.mg-page-hero .mg-hero__subtitle {
    margin-bottom: 0;
    font-size: var(--text-base);
}

/* ================================================================== */
/* CARTES — Standard (defaut)                                          */
/* ================================================================== */
/* Styles de base dans components-v2.css */

/* ================================================================== */
/* CARTES — Glass (glassmorphism premium)                              */
/* ================================================================== */

.card-v-glass .mg-product-card {
    background: rgba(30, 30, 30, 0.55);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.card-v-glass .mg-product-card:hover {
    border-color: rgba(0, 122, 255, 0.35);
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(0, 122, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.card-v-glass .mg-product-card__media {
    background: linear-gradient(180deg, rgba(0, 122, 255, 0.06) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.card-v-glass .mg-product-card__wish {
    background: rgba(18, 18, 18, 0.55);
    backdrop-filter: blur(8px);
    border-color: rgba(255, 255, 255, 0.12);
}
.card-v-glass .mg-product-card__body {
    background: transparent;
}
.card-v-glass .mg-product-card__price {
    color: #5AC8FA;
}

/* ================================================================== */
/* CARTES — Spotlight (image dominante, overlay prix)                  */
/* ================================================================== */

.card-v-spotlight .mg-product-card {
    position: relative;
    border: none;
    background: var(--charcoal-card);
}
.card-v-spotlight .mg-product-card__media {
    aspect-ratio: 4 / 5;
    padding: var(--space-6);
    background: radial-gradient(ellipse at 50% 30%, rgba(0, 122, 255, 0.1), var(--charcoal-raised));
}
.card-v-spotlight .mg-product-card__body {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    padding: var(--space-5);
    padding-top: 3.5rem;
    background: linear-gradient(0deg, rgba(18, 18, 18, 0.98) 0%, rgba(18, 18, 18, 0.75) 55%, transparent 100%);
    gap: var(--space-1);
}
.card-v-spotlight .mg-product-card__cat {
    color: rgba(90, 200, 250, 0.9);
}
.card-v-spotlight .mg-product-card__title {
    font-size: var(--text-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-v-spotlight .mg-product-card__stock {
    font-size: var(--text-xs);
}
.card-v-spotlight .mg-product-card__footer {
    align-items: center;
    padding-top: var(--space-1);
}
.card-v-spotlight .mg-product-card__price {
    font-size: var(--text-xl);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.card-v-spotlight .mg-btn-cart {
    width: 40px;
    opacity: 0;
    transform: translateY(6px) scale(0.92);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.card-v-spotlight .mg-product-card:hover .mg-btn-cart,
.card-v-spotlight .mg-product-card:focus-within .mg-btn-cart {
    opacity: 1;
    transform: none;
}
.card-v-spotlight .mg-product-card__badge {
    z-index: 3;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

/* ================================================================== */
/* CARTES — Compact (dense, CTA elargi au survol)                      */
/* ================================================================== */

.card-v-compact .product-grid > [class*="col-"] {
    flex: 0 0 auto;
    width: 50% !important;
}
@media (min-width: 768px) {
    .card-v-compact .product-grid > [class*="col-md-"] {
        width: 25% !important;
    }
}
@media (min-width: 992px) {
    .card-v-compact .product-grid > [class*="col-lg-"] {
        width: 20% !important;
    }
}
.card-v-compact .mg-product-card {
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-xs);
}
.card-v-compact .mg-product-card:hover {
    transform: translateY(-2px);
}
.card-v-compact .mg-product-card__media {
    aspect-ratio: 1;
    padding: var(--space-3);
}
.card-v-compact .mg-product-card__body {
    padding: var(--space-3);
    gap: var(--space-1);
}
.card-v-compact .mg-product-card__title {
    font-size: var(--text-sm);
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-v-compact .mg-product-card__stock {
    display: none;
}
.card-v-compact .mg-product-card__price {
    font-size: var(--text-base);
}
.card-v-compact .mg-product-card__price-old {
    display: block;
    margin-left: 0;
    font-size: var(--text-xs);
}
.card-v-compact .mg-btn-cart {
    width: 36px;
    height: 36px;
    transition: width 0.25s ease, padding 0.25s ease;
}
.card-v-compact .mg-product-card__cart-label {
    display: none;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
}
.mg-product-card__cart-label {
    display: none;
}
.card-v-compact .mg-product-card:hover .mg-btn-cart,
.card-v-compact .mg-product-card:focus-within .mg-btn-cart {
    width: auto;
    padding: 0 var(--space-3);
    gap: var(--space-1);
}
.card-v-compact .mg-product-card:hover .mg-product-card__cart-label,
.card-v-compact .mg-product-card:focus-within .mg-product-card__cart-label {
    display: inline;
}

/* ================================================================== */
/* Panneau preview UI (?ui_preview=1)                                  */
/* ================================================================== */

.mg-ui-preview {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 1090;
    width: min(280px, calc(100vw - 24px));
    max-height: min(90vh, 520px);
    overflow-y: auto;
    background: rgba(18, 18, 18, 0.96);
    border: 1px solid var(--charcoal-border-strong);
    border-right: none;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    padding: var(--space-4);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
}
.mg-ui-preview__title {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--text-heading);
    margin: 0 0 var(--space-3);
}
.mg-ui-preview__group {
    margin-bottom: var(--space-4);
}
.mg-ui-preview__presets {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.mg-ui-preview__preset {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--charcoal-border);
    background: var(--charcoal-card);
    color: var(--text-body);
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}
.mg-ui-preview__preset strong {
    font-size: var(--text-sm);
    color: var(--text-heading);
}
.mg-ui-preview__preset span {
    font-size: var(--text-xs);
    color: var(--text-muted);
}
.mg-ui-preview__preset:hover {
    border-color: var(--blue-electric-soft);
}
.mg-ui-preview__preset.is-active {
    border-color: var(--blue-electric);
    background: var(--blue-electric-soft);
}
.mg-ui-preview__label {
    display: block;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}
.mg-ui-preview__opts {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}
.mg-ui-preview__opt {
    display: block;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--charcoal-border);
    background: var(--charcoal-card);
    color: var(--text-body);
    font-size: var(--text-sm);
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}
.mg-ui-preview__opt:hover {
    border-color: var(--blue-electric-soft);
    color: var(--text-heading);
}
.mg-ui-preview__opt.is-active {
    border-color: var(--blue-electric);
    background: var(--blue-electric-soft);
    color: var(--text-heading);
    font-weight: var(--font-semibold);
}
.mg-ui-preview__hint {
    font-size: 0.65rem;
    color: var(--text-subtle);
    line-height: 1.4;
    margin: 0;
}
@media (max-width: 575.98px) {
    .mg-ui-preview {
        top: auto;
        bottom: calc(var(--bottom-nav-height) + 8px);
        transform: none;
        right: 8px;
        left: 8px;
        width: auto;
        border-radius: var(--radius-lg);
        border: 1px solid var(--charcoal-border-strong);
        max-height: 40vh;
    }
}
