/**
 * ALJA — Header & Mega-Menu Stylesheet
 * Navigation principale avec mega-menus dropdown.
 *
 * @package ALJA
 * @since   1.0.0
 */

/* ═══════════════════════════════════════
   HEADER WRAPPER
   ═══════════════════════════════════════ */

/*
 * Correctif sticky FSE :
 * WordPress FSE enveloppe chaque template-part dans un élément avec la classe
 * .wp-block-template-part. Cet ancêtre direct empêche position:sticky de
 * fonctionner sur .alja-header. On rend donc le wrapper lui-même sticky et
 * on passe .alja-header en position:relative pour éviter la double couche.
 */
.wp-block-template-part:has(#site-header),
.wp-block-template-part:has(.alja-header) {
    position: sticky;
    top: 0;
    z-index: 100;
}

.alja-header {
    position: relative;   /* sticky géré par le wrapper .wp-block-template-part */
    z-index: 100;
    background: var(--wp--preset--color--white);
    border-bottom: 1px solid var(--wp--preset--color--gray-200);
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.05);
}

.alja-header__inner {
    max-width: var(--alja-site-max);          /* 1744px — source unique --alja-site-max */
    margin-inline: auto;
    padding-inline: var(--alja-gutter);       /* même gutter que le reste du site */
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

/* ═══════════════════════════════════════
   LOGO
   ═══════════════════════════════════════ */

.alja-header__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

/* Responsive image logo — mobile-first */
.alja-header__logo-img {
    height: 44px;
    width: auto;
    max-width: 220px;
    display: block;
}

@media (min-width: 768px) {
    .alja-header__logo-img {
        height: 52px;
        max-width: 280px;
    }
}

@media (min-width: 1024px) {
    .alja-header__logo-img {
        height: 64px;
        max-width: 340px;
    }
}

.alja-header__logo-text {
    font-family: var(--wp--preset--font-family--heading);
    font-size: var(--wp--preset--font-size--md);
    font-weight: 700;
    color: var(--wp--preset--color--charcoal);
    line-height: 1.2;
}

.alja-header__logo-text span {
    display: block;
    font-size: var(--wp--preset--font-size--xs);
    font-weight: 400;
    color: var(--wp--preset--color--gray-600);
    font-family: var(--wp--preset--font-family--body);
}

/* ═══════════════════════════════════════
   DESKTOP NAVIGATION
   ═══════════════════════════════════════ */

.alja-nav {
    display: none;
}

@media (min-width: 1024px) {
    .alja-nav {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        flex: 1;
        justify-content: center;
    }
}

.alja-nav__item {
    position: relative;
}

.alja-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.875rem;
    font-size: var(--wp--preset--font-size--sm);
    font-weight: 500;
    color: var(--wp--preset--color--charcoal);
    text-decoration: none;
    border-radius: var(--wp--custom--border-radius--md);
    transition: all var(--wp--custom--transition--fast);
    white-space: nowrap;
}

.alja-nav__link:hover,
.alja-nav__item:hover > .alja-nav__link {
    background: var(--wp--preset--color--sand-light);
    color: var(--wp--preset--color--primary);
}

.alja-nav__link--active {
    color: var(--wp--preset--color--primary);
    font-weight: 600;
}

/* Dropdown chevron */
.alja-nav__chevron {
    width: 0.875rem;
    height: 0.875rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform var(--wp--custom--transition--fast);
}

.alja-nav__item:hover > .alja-nav__link .alja-nav__chevron {
    transform: rotate(180deg);
}

/* ═══════════════════════════════════════
   MEGA MENU
   ═══════════════════════════════════════ */

.alja-mega-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    inset-inline-start: 50%;
    transform: translateX(-50%);
    background: var(--wp--preset--color--white);
    border: 1px solid var(--wp--preset--color--gray-200);
    border-radius: var(--wp--custom--border-radius--xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    min-width: 520px;
    padding: 1.25rem;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-8px);
    transition: all var(--wp--custom--transition--base);
    z-index: 200;
}

/* Arrow pointer */
.alja-mega-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: var(--wp--preset--color--white);
    border-top: 1px solid var(--wp--preset--color--gray-200);
    border-left: 1px solid var(--wp--preset--color--gray-200);
    transform: translateX(-50%) rotate(45deg);
}

.alja-nav__item:hover .alja-mega-menu,
.alja-nav__item:focus-within .alja-mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.alja-mega-menu__title {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--wp--preset--color--gray-400);
    padding: 0.25rem 0.75rem 0.625rem;
    margin-block-end: 0.5rem;
    border-bottom: 1px solid var(--wp--preset--color--gray-200);
}

.alja-mega-menu__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
}

.alja-mega-menu__grid--3cols {
    grid-template-columns: repeat(3, 1fr);
}

.alja-mega-menu__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--wp--custom--border-radius--md);
    text-decoration: none;
    transition: background-color var(--wp--custom--transition--fast);
    cursor: pointer;
}

.alja-mega-menu__item:hover {
    background: var(--wp--preset--color--sand-light);
}

.alja-mega-menu__item-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--wp--custom--border-radius--md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}



.alja-mega-menu__item-name {
    font-size: var(--wp--preset--font-size--sm);
    font-weight: 600;
    color: var(--wp--preset--color--charcoal);
    line-height: 1.2;
    display: block;
    margin-block-end: 0.125rem;
}

.alja-mega-menu__item-desc {
    font-size: 0.625rem;
    color: var(--wp--preset--color--gray-600);
    line-height: 1.4;
    display: block;
}

/* See all link at bottom */
.alja-mega-menu__footer {
    margin-block-start: 0.875rem;
    padding-block-start: 0.875rem;
    border-top: 1px solid var(--wp--preset--color--gray-200);
    display: flex;
    justify-content: center;
}

.alja-mega-menu__footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--wp--preset--font-size--xs);
    font-weight: 600;
    color: var(--wp--preset--color--primary);
    text-decoration: none;
    transition: gap var(--wp--custom--transition--fast);
}

.alja-mega-menu__footer-link:hover {
    gap: 0.625rem;
}

/* ═══════════════════════════════════════
   CTA BUTTON
   ═══════════════════════════════════════ */

.alja-header__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.alja-header__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5625rem 1.25rem;
    /* --alja-cta-bg : surchargeable via Réglages ALJA → Header */
    background: var(--alja-cta-bg, var(--wp--preset--color--primary));
    color: var(--wp--preset--color--white);
    font-family: var(--wp--preset--font-family--body);
    font-size: var(--wp--preset--font-size--sm);
    font-weight: 700;
    border-radius: var(--wp--custom--border-radius--md);
    text-decoration: none;
    transition: all var(--wp--custom--transition--fast);
    white-space: nowrap;
}

.alja-header__cta:hover {
    background: var(--alja-cta-bg-hover, var(--wp--preset--color--primary-dark));
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════
   HAMBURGER BUTTON (mobile)
   ═══════════════════════════════════════ */

.alja-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 2.5rem;
    height: 2.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--wp--custom--border-radius--md);
    transition: background-color var(--wp--custom--transition--fast);
}

.alja-hamburger:hover {
    background: var(--wp--preset--color--sand-light);
}

@media (min-width: 1024px) {
    .alja-hamburger {
        display: none;
    }
}

.alja-hamburger__bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--wp--preset--color--charcoal);
    border-radius: 2px;
    transition: all var(--wp--custom--transition--base);
    transform-origin: center;
}

/* Active state */
.alja-hamburger.is-active .alja-hamburger__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.alja-hamburger.is-active .alja-hamburger__bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.alja-hamburger.is-active .alja-hamburger__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ═══════════════════════════════════════
   MOBILE MENU DRAWER
   ═══════════════════════════════════════ */

.alja-mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
}

.alja-mobile-menu.is-open {
    pointer-events: all;
}

/* Backdrop */
.alja-mobile-menu__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity var(--wp--custom--transition--base);
    backdrop-filter: blur(2px);
}

.alja-mobile-menu.is-open .alja-mobile-menu__backdrop {
    opacity: 1;
}

/* Drawer panel */
.alja-mobile-menu__panel {
    position: absolute;
    top: 0;
    inset-inline-end: 0;
    width: min(360px, 90vw);
    height: 100vh;
    background: var(--wp--preset--color--white);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform var(--wp--custom--transition--base);
    display: flex;
    flex-direction: column;
}

[dir="rtl"] .alja-mobile-menu__panel {
    inset-inline-end: auto;
    inset-inline-start: 0;
    transform: translateX(-100%);
}

.alja-mobile-menu.is-open .alja-mobile-menu__panel {
    transform: translateX(0);
}

.alja-mobile-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--wp--preset--color--gray-200);
    position: sticky;
    top: 0;
    background: var(--wp--preset--color--white);
    z-index: 1;
}

.alja-mobile-menu__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    background: var(--wp--preset--color--sand-light);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.125rem;
    color: var(--wp--preset--color--charcoal);
    transition: background-color var(--wp--custom--transition--fast);
}

.alja-mobile-menu__close:hover {
    background: var(--wp--preset--color--sand);
}

.alja-mobile-menu__body {
    flex: 1;
    padding: 1rem 0;
}

.alja-mobile-nav__section {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--wp--preset--color--gray-200);
}

.alja-mobile-nav__section:last-child {
    border-bottom: none;
}

.alja-mobile-nav__section-title {
    padding: 0.375rem 1.5rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--wp--preset--color--gray-400);
}

.alja-mobile-nav__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    font-size: var(--wp--preset--font-size--sm);
    color: var(--wp--preset--color--charcoal);
    transition: background-color var(--wp--custom--transition--fast);
}

.alja-mobile-nav__link:hover {
    background: var(--wp--preset--color--sand-light);
}

.alja-mobile-nav__link-icon {
    width: 2rem;
    height: 2rem;
    border-radius: var(--wp--custom--border-radius--md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.alja-mobile-nav__link-text {
    font-weight: 500;
}

.alja-mobile-menu__footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--wp--preset--color--gray-200);
}

.alja-mobile-menu__footer .alja-header__cta {
    width: 100%;
    justify-content: center;
    padding: 0.875rem;
}

/* ═══════════════════════════════════════
   SCROLL STATE
   ═══════════════════════════════════════ */

.alja-header.is-scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

/* ═══════════════════════════════════════
   AUTH BUTTON — HEADER
   ═══════════════════════════════════════ */

/* Logged-out: Se connecter */
.alja-header__login-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--wp--preset--color--charcoal);
    font-family: var(--wp--preset--font-family--body);
    font-size: var(--wp--preset--font-size--sm);
    font-weight: 600;
    border: 1.5px solid var(--wp--preset--color--gray-300);
    border-radius: var(--wp--custom--border-radius--md);
    cursor: pointer;
    transition: all var(--wp--custom--transition--fast);
    white-space: nowrap;
}

.alja-header__login-btn:hover {
    background: var(--wp--preset--color--sand-light);
    border-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--primary);
}

.alja-header__login-btn svg {
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Logged-in: Avatar + name */
.alja-header__user-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem 0.25rem 0.25rem;
    background: var(--wp--preset--color--sand-light);
    border: 1.5px solid var(--wp--preset--color--gray-200);
    border-radius: var(--wp--custom--border-radius--full);
    text-decoration: none;
    transition: all var(--wp--custom--transition--fast);
}

.alja-header__user-btn:hover {
    border-color: var(--wp--preset--color--primary);
    box-shadow: 0 2px 12px rgba(58, 138, 106, 0.15);
}

.alja-header__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.alja-header__user-name {
    font-family: var(--wp--preset--font-family--body);
    font-size: var(--wp--preset--font-size--xs);
    font-weight: 600;
    color: var(--wp--preset--color--charcoal);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Mobile header layout ─────────────────────────────────────
   Target: < 1024px (tablets & phones)
   Logo | [Profile icon] | [Cart] | [Hamburger]
   "Réserver" CTA is already in the mobile drawer → hidden here.
────────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {

    /* Tighten actions gap on small screens */
    .alja-header__actions {
        gap: 0.375rem;
    }

    /* Hide "Réserver" CTA — it's in the mobile drawer */
    .alja-header__cta {
        display: none;
    }

    /* Profile: icon-only pill (hide name + chevron text label) */
    .alja-header__login-btn .alja-header__login-label,
    .alja-header__user-name {
        display: none;
    }

    /* Compact the profile pill so it's just avatar + chevron */
    .alja-header__user-btn {
        padding: 0.25rem 0.5rem 0.25rem 0.25rem;
        gap: 0.25rem;
    }

    /* Compact login button: icon only */
    .alja-header__login-btn {
        padding: 0.5rem;
        gap: 0;
    }

    /* Make hamburger always crisp — larger tap target */
    .alja-hamburger {
        width: 2.75rem;
        height: 2.75rem;
        flex-shrink: 0;
    }

    /* Extra compact on very small phones (iPhone SE, etc.) */
    @media (max-width: 390px) {
        .alja-header__inner {
            padding-inline: 0.875rem;
            gap: 0.5rem;
        }
        .alja-header__actions {
            gap: 0.25rem;
        }
    }
}

/* ─── Medium screens 768–1023px (large tablets) ─────────────── */
@media (min-width: 768px) and (max-width: 1023px) {
    /* On tablets: show the "Réserver" CTA — enough room */
    .alja-header__cta {
        display: inline-flex;
    }
    .alja-header__actions {
        gap: 0.75rem;
    }
}

/* ─── Narrow desktop 1024–1178px — compressor nav ───────────── */
@media (min-width: 1024px) and (max-width: 1178px) {
    .alja-header__inner { gap: 0.75rem; }

    /* Lien nav : texte plus petit + padding réduit */
    .alja-nav__link {
        font-size: 0.78rem;
        padding: 0.4rem 0.5rem;
    }
    /* Espace entre items */
    .alja-nav { gap: 0; }

    /* CTA "Réserver" : padding réduit, texte légèrement plus petit */
    .alja-header__cta {
        font-size: 0.78rem;
        padding: 0.5rem 0.875rem;
        gap: 0.25rem;
    }

    /* Actions gap */
    .alja-header__actions { gap: 0.5rem; }

    /* User/Login button : compact */
    .alja-header__user-btn { padding: 0.2rem 0.5rem 0.2rem 0.2rem; }
    .alja-header__user-name { max-width: 72px; font-size: 0.7rem; }
}

/* ═══════════════════════════════════════
   PROFILE DROPDOWN
   ═══════════════════════════════════════ */

.alja-profile-dropdown {
    position: relative;
}

/* Chevron animé */
.alja-profile-chevron {
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform var(--wp--custom--transition--fast);
    opacity: 0.6;
}

.alja-profile-dropdown.is-open .alja-profile-chevron {
    transform: rotate(180deg);
}

/* Panneau dropdown */
.alja-profile-menu {
    position: absolute;
    top: calc(100% + 0.625rem);
    right: 0;
    width: 220px;
    background: var(--wp--preset--color--white);
    border: 1px solid var(--wp--preset--color--gray-200);
    border-radius: var(--wp--custom--border-radius--xl);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top right;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 500;
}

/* Petite flèche pointant vers le bouton */
.alja-profile-menu::before {
    content: '';
    position: absolute;
    top: -5px;
    right: 1.25rem;
    width: 10px;
    height: 10px;
    background: var(--wp--preset--color--white);
    border-top: 1px solid var(--wp--preset--color--gray-200);
    border-left: 1px solid var(--wp--preset--color--gray-200);
    transform: rotate(45deg);
}

.alja-profile-dropdown.is-open .alja-profile-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Items du menu */
.alja-profile-menu__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6875rem 0.875rem;
    border-radius: var(--wp--custom--border-radius--md);
    text-decoration: none;
    font-family: var(--wp--preset--font-family--body);
    font-size: var(--wp--preset--font-size--sm);
    font-weight: 500;
    color: var(--wp--preset--color--charcoal);
    transition: background-color var(--wp--custom--transition--fast), color var(--wp--custom--transition--fast);
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

.alja-profile-menu__item:hover {
    background: var(--wp--preset--color--sand-light);
    color: var(--wp--preset--color--primary);
}

.alja-profile-menu__item svg {
    width: 1.0625rem;
    height: 1.0625rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
    opacity: 0.75;
    transition: opacity var(--wp--custom--transition--fast);
}

.alja-profile-menu__item:hover svg {
    opacity: 1;
}

/* Séparateur */
.alja-profile-menu__divider {
    height: 1px;
    background: var(--wp--preset--color--gray-200);
    margin: 0.375rem 0.5rem;
}

/* Item danger (Déconnexion) */
.alja-profile-menu__item--danger {
    color: #dc2626;
}

.alja-profile-menu__item--danger:hover {
    background: #fef2f2;
    color: #b91c1c;
}

/* ═══════════════════════════════════════
   LOGIN MODAL
   ═══════════════════════════════════════ */

.alja-login-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.alja-login-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.alja-login-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
}

.alja-login-modal__card {
    position: relative;
    width: min(440px, 92vw);
    max-height: 90vh;
    overflow-y: auto;
    background: var(--wp--preset--color--white);
    border-radius: var(--wp--custom--border-radius--xl);
    padding: 2.5rem 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s ease;
}

.alja-login-modal.is-open .alja-login-modal__card {
    transform: translateY(0) scale(1);
}

/* Close */
.alja-login-modal__close {
    position: absolute;
    top: 1rem;
    inset-inline-end: 1rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wp--preset--color--sand-light);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background var(--wp--custom--transition--fast);
}

.alja-login-modal__close:hover {
    background: var(--wp--preset--color--sand);
}

.alja-login-modal__close svg {
    width: 1rem;
    height: 1rem;
    stroke: var(--wp--preset--color--charcoal);
    stroke-width: 2;
    stroke-linecap: round;
}

/* Header */
.alja-login-modal__header {
    text-align: center;
    margin-block-end: 1.75rem;
}

.alja-login-modal__title {
    font-family: var(--wp--preset--font-family--heading);
    font-size: var(--wp--preset--font-size--xl);
    font-weight: 700;
    color: var(--wp--preset--color--charcoal);
    margin: 0 0 0.5rem;
}

.alja-login-modal__subtitle {
    font-size: var(--wp--preset--font-size--sm);
    color: var(--wp--preset--color--gray-600);
    margin: 0;
    line-height: 1.5;
}

/* Google button */
.alja-login-modal__google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: var(--wp--preset--color--white);
    border: 1.5px solid var(--wp--preset--color--gray-200);
    border-radius: var(--wp--custom--border-radius--md);
    font-family: var(--wp--preset--font-family--body);
    font-size: var(--wp--preset--font-size--sm);
    font-weight: 600;
    color: var(--wp--preset--color--charcoal);
    cursor: pointer;
    transition: all var(--wp--custom--transition--fast);
}

.alja-login-modal__google:hover {
    background: var(--wp--preset--color--sand-light);
    border-color: var(--wp--preset--color--gray-400);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.alja-login-modal__google svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

/* Divider */
.alja-login-modal__divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.alja-login-modal__divider::before,
.alja-login-modal__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--wp--preset--color--gray-200);
}

.alja-login-modal__divider span {
    font-size: var(--wp--preset--font-size--xs);
    color: var(--wp--preset--color--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

/* Form */
.alja-login-modal__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.alja-login-modal__field label {
    display: block;
    font-size: var(--wp--preset--font-size--xs);
    font-weight: 600;
    color: var(--wp--preset--color--charcoal);
    margin-block-end: 0.375rem;
}

.alja-login-modal__field input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--wp--preset--color--gray-200);
    border-radius: var(--wp--custom--border-radius--md);
    font-family: var(--wp--preset--font-family--body);
    font-size: var(--wp--preset--font-size--sm);
    color: var(--wp--preset--color--charcoal);
    background: var(--wp--preset--color--white);
    transition: border-color var(--wp--custom--transition--fast);
    box-sizing: border-box;
}

.alja-login-modal__field input:focus {
    outline: none;
    border-color: var(--wp--preset--color--primary);
    box-shadow: 0 0 0 3px rgba(58, 138, 106, 0.12);
}

.alja-login-modal__field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.alja-login-modal__remember {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--wp--preset--font-size--xs);
    color: var(--wp--preset--color--gray-600);
    cursor: pointer;
}

.alja-login-modal__remember input[type="checkbox"] {
    accent-color: var(--wp--preset--color--primary);
}

.alja-login-modal__forgot {
    font-size: var(--wp--preset--font-size--xs);
    color: var(--wp--preset--color--primary);
    text-decoration: none;
    font-weight: 500;
}

.alja-login-modal__forgot:hover {
    text-decoration: underline;
}

/* Error */
.alja-login-modal__error {
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: var(--wp--custom--border-radius--md);
    color: #b91c1c;
    font-size: var(--wp--preset--font-size--xs);
    font-weight: 500;
}

/* Submit */
.alja-login-modal__submit {
    width: 100%;
    padding: 0.875rem;
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
    font-family: var(--wp--preset--font-family--body);
    font-size: var(--wp--preset--font-size--sm);
    font-weight: 700;
    border: none;
    border-radius: var(--wp--custom--border-radius--md);
    cursor: pointer;
    transition: all var(--wp--custom--transition--base);
}

.alja-login-modal__submit:hover {
    background: var(--wp--preset--color--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(58, 138, 106, 0.3);
}

.alja-login-modal__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Register link */
.alja-login-modal__register {
    text-align: center;
    font-size: var(--wp--preset--font-size--xs);
    color: var(--wp--preset--color--gray-600);
    margin-block-start: 1.25rem;
}

.alja-login-modal__register a {
    color: var(--wp--preset--color--primary);
    font-weight: 600;
    text-decoration: none;
}

.alja-login-modal__register a:hover {
    text-decoration: underline;
}

/* Mobile modal */
@media (max-width: 480px) {
    .alja-login-modal__card {
        padding: 2rem 1.25rem;
        border-radius: var(--wp--custom--border-radius--lg);
    }
}

/* ═══════════════════════════════════════
   HEADER — Cart Icon + Badge
   ═══════════════════════════════════════ */

.alja-header__cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    color: var(--wp--preset--color--charcoal);
    border: 1.5px solid var(--wp--preset--color--gray-200);
    border-radius: var(--wp--custom--border-radius--full);
    text-decoration: none;
    transition: all var(--wp--custom--transition--fast);
    background: var(--wp--preset--color--white);
    flex-shrink: 0;
}

.alja-header__cart:hover {
    border-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--primary);
    box-shadow: 0 2px 8px rgba(58, 138, 106, 0.15);
}

/* Badge count */
.alja-cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--wp--preset--color--error);
    color: var(--wp--preset--color--white);
    font-size: 0.625rem;
    font-weight: 700;
    text-align: center;
    border-radius: 9px;
    border: 2px solid var(--wp--preset--color--white);
    /* Masqué par défaut si vide */
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--wp--custom--transition--fast);
}

.alja-cart-badge.has-items {
    opacity: 1;
    transform: scale(1);
}

/* Pulse animation lors d'un ajout au panier */
@keyframes alja-cart-pulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.4); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.alja-header__cart.alja-cart-pulse svg {
    animation: alja-cart-pulse 0.5s ease-out;
}

/* ═══════════════════════════════════════
   TOAST — Notification "Ajouté au panier"
   ═══════════════════════════════════════ */

.alja-cart-toast {
    position: fixed;
    bottom: 6rem;
    right: 1.5rem;
    z-index: 9999;
    background: var(--wp--preset--color--charcoal);
    color: var(--wp--preset--color--white);
    border-radius: var(--wp--custom--border-radius--lg);
    padding: 0.875rem 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 320px;
    transform: translateY(120%);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.alja-cart-toast.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.alja-cart-toast__icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alja-cart-toast__text {
    font-size: var(--wp--preset--font-size--sm);
    font-weight: 600;
    flex: 1;
}

.alja-cart-toast__link {
    font-size: var(--wp--preset--font-size--xs);
    font-weight: 700;
    color: var(--wp--preset--color--primary-light, #6fcf97);
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--wp--custom--transition--fast);
}

.alja-cart-toast__link:hover {
    color: var(--wp--preset--color--white);
}

/* ═══════════════════════════════════════
   FLOATING BUTTONS — WhatsApp + Go-to-Top
   ═══════════════════════════════════════ */

.alja-float {
    position: fixed;
    z-index: 950;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all var(--wp--custom--transition--base);
    overflow: hidden;
    gap: 0;
}

.alja-float:hover {
    transform: translateY(-3px) scale(1.06);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

/* WhatsApp — vert WA, coin bas-droit, label au survol */
.alja-float--whatsapp {
    right: 1.5rem;
    bottom: 5.5rem;
    background: #25D366;
    color: #fff;
    width: auto;
    border-radius: 2rem;
    padding: 0 1rem;
    gap: 0.5rem;
}

.alja-float--whatsapp .alja-float__label {
    font-size: var(--wp--preset--font-size--xs);
    font-weight: 700;
    white-space: nowrap;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-width 0.3s ease, opacity 0.25s ease;
}

.alja-float--whatsapp:hover .alja-float__label {
    max-width: 6rem;
    opacity: 1;
}

/* Go-to-Top — gris sombre, coin bas-droit (au-dessus de WA) */
.alja-float--top {
    right: 1.5rem;
    bottom: 1.5rem;
    background: var(--wp--preset--color--charcoal);
    color: var(--wp--preset--color--white);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity var(--wp--custom--transition--base),
                transform var(--wp--custom--transition--base),
                box-shadow var(--wp--custom--transition--base);
}

.alja-float--top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.alja-float--top:hover {
    background: var(--wp--preset--color--primary);
    transform: translateY(-3px);
}

/* Mobile : boutons un peu plus petits */
@media (max-width: 640px) {
    .alja-float--whatsapp {
        right: 1rem;
        bottom: 4.5rem;
        padding: 0 0.75rem;
    }

    .alja-float--top {
        right: 1rem;
        bottom: 1rem;
    }
}

/* ═══════════════════════════════════════
   LOGIN PAGE — Standalone (page-templates/login-template.php)
   Same .alja-login-modal card, displayed as full page
   ═══════════════════════════════════════ */

body.alja-login-page {
    background: #f7f7f5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.alja-login-page__main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-block: 2rem 4rem;
}

/* Stepper strip at top of login page */
.alja-login-page__stepper-wrap {
    width: 100%;
    max-width: 720px;
    padding-inline: 1.5rem;
    margin-bottom: 2rem;
}

/* Card centered in page — override modal position styles */
.alja-login-page__card-wrap {
    width: 100%;
    max-width: 480px;
    padding-inline: 1rem;
}

/* When displayed as page (.is-page), override modal overlay behaviour */
.alja-login-modal.is-page {
    position: static !important;
    inset: auto !important;
    background: transparent !important;
    pointer-events: auto !important;
    z-index: auto !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.alja-login-modal.is-page .alja-login-modal__backdrop {
    display: none !important;
}

.alja-login-modal.is-page .alja-login-modal__card {
    position: static !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08) !important;
}

.alja-login-modal.is-page .alja-login-modal__close {
    display: none !important;
}

/* Guest continue link */
.alja-login-page__guest {
    display: block;
    text-align: center;
    font-size: 0.875rem;
    color: var(--wp--preset--color--primary);
    font-weight: 600;
    text-decoration: none;
    margin-top: 0.75rem;
    transition: opacity 150ms;
}

.alja-login-page__guest:hover { opacity: 0.75; }

/* ═══════════════════════════════════════
   GOOGLE SIGN-IN BUTTON (GIS renderButton)
   ═══════════════════════════════════════ */

.alja-gsi-btn-container {
    display: flex;
    justify-content: center;
    width: 100%;
    min-height: 44px;
}

/* Make the GIS iframe/div stretch to fill our container */
.alja-gsi-btn-container > div {
    width: 100% !important;
}

.alja-gsi-btn-container iframe {
    width: 100% !important;
    border-radius: var(--wp--custom--border-radius--md) !important;
}
