/* =====================================================
   IMPORTS
   ===================================================== */
@import "vars.css";
@import "components.css";
@import "forms.css";
@import "pages.css";
@import "index.css";

/* =====================================================
   GLOBAL RESET & BASE STYLES
   ===================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color-light);
    background: var(--color-background-1);
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    color: var(--text-color-light);
    margin-bottom: 1.5rem;
    font-weight: bold;
    text-align: center;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    animation: fadeInUp 1s ease-out;
}

h2 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: bold;
    margin-bottom: 3rem;
    position: relative;

    &::after {
        content: '';
        position: absolute;
        bottom: -10px;
        left: 50%;
        transform: translateX(-50%);
        width: 60px;
        height: 4px;
        background: var(--gradient-text);
        border-radius: 2px;
    }
}

h3 {
    font-size: clamp(1.3rem, 5vw, 1.5rem);
}

p {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

a {
    color: var(--color-decoration-light);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;

    &:not(.button, .cart-float, .download-float) {
        &:hover {
            color: var(--color-decoration-dark);

            &::after {
                width: 100%;
            }
        }

        &::after {
            content: '';
            position: absolute;
            bottom: -5px;
            left: 0;
            width: 0;
            height: 2px;
            background: var(--gradient-text);
            transition: width 0.3s ease;
        }
    }
}

button {
    cursor: pointer;
}

.button {
    display: inline-block;
    padding: 1rem 1.5rem;
    background: var(--white-alpha-05);
    color: var(--text-color-light);
    text-decoration: none;
    border-radius: 50px;
    border: var(--border-dark);
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;

    &:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 30px var(--box-shadow-color);
    }

    &.cta {
        box-shadow: 0 10px 15px var(--box-shadow-color);
        background: var(--gradient-text);
    }

    &.disabled {
        opacity: 0.5;
        cursor: not-allowed;
        pointer-events: none;
    }
}
.button-danger {
    background: var(--error-alpha-20);
    border-color: var(--error-alpha-30);

    &:hover {
        background: var(--error-alpha-30);
        border-color: var(--error-alpha-50);
    }
}

.button-sm {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

strong {
    color: var(--text-color-light);
}

.animated {
    animation: pulse 3s infinite;
}

.center {
    text-align: center;
}

.hidden {
    display: none !important;
}

.error {
    color: var(--color-error);
}

.success {
    color: var(--color-success);
}

.highlight {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.divider {
    border-top: 1px solid var(--color-decoration);
    margin: 1rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.highlight-box {
    background: var(--white-alpha-05);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 12px;
    border: var(--border-dark);
    border-left: 4px solid var(--border-color);
    margin: 25px 0;

    p {
        margin-bottom: 0;
    }
}

.status-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-decoration-light), var(--color-decoration-dark));
    color: var(--text-color-light);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 10px 0;

    &.coming-soon {
        background: linear-gradient(135deg, var(--color-decoration), var(--color-decoration-dark));
        color: var(--text-color-darker);
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   LAYOUT
   ===================================================== */

/* Header */
header {
    background: rgb(from var(--color-background-1) r g b / 0.85);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: var(--border);

    nav {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 2rem;

        .nav-container {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            flex-wrap: wrap;

            @media (max-width: 768px) {
                flex-wrap: nowrap;
                align-items: center;
            }
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 0.2rem;
            flex: 0 0 auto;

            a {
                display: contents;
                text-decoration: none;
            }

            img {
                height: 2.2rem;
                width: auto;
                display: inline-block;
            }

            span {
                font-size: 2rem;
                font-weight: bold;
                background: var(--gradient-text);
                -webkit-background-clip: text;
                -webkit-text-fill-color: transparent;
                background-clip: text;
            }

            @media (max-width: 768px) {
                order: 1;
            }
        }

        .nav-content {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            flex: 1;
            justify-content: flex-end;
        }

        .nav-links {
            display: flex;
            list-style: none;
            gap: 2rem;
            align-items: center;

            &.nav-level-1 {
                justify-content: flex-end;

                .nav-item {
                    cursor: pointer;

                    a {
                        display: flex;
                        align-items: center;
                        gap: 0.5rem;

                        .nav-icon {
                            display: none;
                        }
                    }
                }

            }

            &.nav-level-2 {
                display: none;
                justify-content: flex-end;
                font-size: 0.9rem;
                gap: 1.5rem;

                &.active {
                    display: flex;
                }
            }

            .logout-form {
                display: inline;

                button {
                    background: none;
                    border: none;
                    color: var(--color-decoration-light);
                    font-size: inherit;
                    font-family: inherit;
                    cursor: pointer;
                    padding: 0;
                    transition: color 0.3s ease;

                    &:hover {
                        color: var(--color-decoration-dark);
                    }
                }
            }
        }

        @media (max-width: 768px) {
            .nav-content {
                width: 100%;
                position: absolute;
                top: 70px;
                left: 0;
                right: 0;
                padding: 0.25rem 0;
                z-index: 99;
                order: 3;
                display: flex;
                flex-direction: column;
                background: rgb(from var(--color-background-1) r g b / 0.98);
                backdrop-filter: blur(20px);
                border-bottom: 1px solid var(--color-decoration-light-alpha-30);
                box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
                max-height: calc(100dvh - 70px);
                overflow-y: auto;

                &:not(.active) {
                    display: none;
                }

                &.active {
                    animation: slideDown 0.3s ease-out;
                }

                /* Make nav-content the flex container that orders all children */
                > * {
                    width: 100%;
                }
            }

            .nav-links {
                flex-direction: column;
                width: 100%;
                gap: 0;
                align-items: stretch;

                &.nav-level-1 {
                    display: contents;

                    .nav-item {
                        border-bottom: 1px solid rgba(255, 255, 255, 0.05);

                        a {
                            display: flex;
                            align-items: center;
                            padding: 0.6rem 1.25rem;
                            transition: all 0.2s ease;
                            font-weight: 400;
                            font-size: 0.95rem;
                            gap: 0.75rem;

                            .nav-icon {
                                display: block;
                                font-size: 1.4rem;
                                width: 1.5rem;
                                text-align: center;
                                flex-shrink: 0;
                            }

                            .nav-text {
                                flex: 1;
                            }

                            &:hover {
                                background: var(--white-alpha-05);
                            }
                        }

                        &.active[data-section] a {
                            background: var(--white-alpha-05);
                        }

                        /* Position items based on data-order attribute */
                        &[data-order="1"] { order: 1; }
                        &[data-order="3"] { order: 3; }
                        &[data-order="4"] { order: 4; }
                        &[data-order="5"] { order: 5; }

                    }
                }

                &.nav-level-2 {
                    background: rgba(0, 0, 0, 0.2);
                    padding: 0;
                    margin: 0;
                    gap: 0;
                    max-height: 0;
                    overflow: hidden;
                    opacity: 0;
                    transition: all 0.3s ease;

                    &[data-parent="accueil"] {
                        order: 2;
                    }

                    &[data-parent="account"] {
                        order: 6;
                    }

                    &.active {
                        max-height: 500px;
                        opacity: 1;
                        display: flex;
                        padding: 0.5rem 0;
                    }

                    li {
                        border-bottom: 1px solid rgba(255, 255, 255, 0.03);

                        &:last-child {
                            border-bottom: none;
                        }

                        a {
                            display: block;
                            padding: 0.5rem 1.25rem 0.5rem 3.5rem;
                            transition: all 0.2s ease;
                            font-size: 0.875rem;
                            color: var(--text-color-light);

                            &:hover {
                                background: var(--white-alpha-05);
                                color: var(--color-decoration-light);
                                padding-left: 3.875rem;
                            }
                        }
                    }
                }
            }
        }

        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
    }
}

main {
    padding-top : 5rem;
}

/* Floating indicators stack - all indicators are children of this container */
.indicators-stack {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    z-index: 200;
}

/* Common styles for all indicator buttons/links in the stack */
.indicators-stack > *:not(.onboarding-floating-card) {
    width: 52px;
    height: 52px;
    background: rgb(from var(--color-background-1) r g b / 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-decoration-light-alpha-30);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;

    &:hover {
        border-color: var(--color-decoration-light);
        transform: scale(1.08);
    }
}

.cart-float {
    position: relative;
    font-size: 1.4rem;

    .cart-float__count {
        position: absolute;
        top: -4px;
        right: -4px;
        background: var(--color-decoration-light);
        color: var(--color-background-1);
        border-radius: 50%;
        font-size: 0.6rem;
        font-weight: 700;
        min-width: 18px;
        height: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 3px;
        line-height: 1;
    }
}

.download-float {
    color: var(--color-decoration-light);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;

    span {
        width: 25px;
        height: 3px;
        background: var(--text-color-light);
        border-radius: 3px;
        transition: all 0.3s ease;
    }

    @media (max-width: 768px) {
        display: flex;
        order: 2;
    }
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--gradient-background);
    position: relative;
    overflow: hidden;

    &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><radialGradient id="grad" cx="50%" cy="50%" r="50%"><stop offset="0%" style="stop-color:rgba(102,126,234,0.1);stop-opacity:1" /><stop offset="100%" style="stop-color:rgba(102,126,234,0);stop-opacity:0" /></radialGradient></defs><circle cx="20" cy="20" r="2" fill="url(%23grad)"><animate attributeName="cy" values="20;80;20" dur="4s" repeatCount="indefinite"/></circle><circle cx="80" cy="60" r="1.5" fill="url(%23grad)"><animate attributeName="cy" values="60;10;60" dur="6s" repeatCount="indefinite"/></circle><circle cx="40" cy="80" r="1" fill="url(%23grad)"><animate attributeName="cy" values="80;20;80" dur="5s" repeatCount="indefinite"/></circle></svg>') repeat;
        opacity: 0.3;
        animation: float 6s ease-in-out infinite;
    }

    div {
        max-width: 800px;
        padding: 0 2rem;
        z-index: 2;
        position: relative;
    }

    p {
        font-size: 1.3rem;
        animation: fadeInUp 1s ease-out 0.2s both;
    }
}


/* Sections */
section {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;

    & > div {
        margin-top: 2rem;
        color: var(--text-color);
        font-size: 1.1rem;
        line-height: 1.8;
    }

    @media (max-width: 768px) {
        padding: 1.5rem 1rem;
    }
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    align-items: stretch;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
    flex-shrink: 0;

    .form-input {
        flex: 1;
        min-width: 300px;
        max-width: 400px;
    }

    .button {
        flex-shrink: 0;
    }

    @media (max-width: 768px) {
        input[type="email"] {
            min-width: 100%;
            margin-bottom: 1rem;
        }
    }
}

.vertical-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.form-error {
    display: none;
    padding: 10px 20px;
    max-width: 400px;

    /* Couleurs (tonalités rouges/alertes) */
    color: var(--color-error);
    background-color: var(--error-light-bg);
    border: 1px solid var(--error-light-border);
    border-radius: 0.25rem;

    /* Typographie */
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: center;

    /* Animation douce à l'apparition */
    animation: fadeIn 0.3s ease-in;
}


/* Product Section */
.product-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 4rem;
    align-items: center;
    margin-top: 3rem;

    .product-description {
        font-size: 1.1rem;
        line-height: 1.8;

        ul {
            margin: 1.5rem 0;
            padding-left: 1.5rem;

            li {
                margin-bottom: 0.8rem;
                position: relative;

                &::marker {
                    color: var(--color-decoration-light);
                }
            }
        }
    }

    @media (max-width: 768px) {
        grid-template-columns: 1fr;
    }
}



@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer */
footer {
    background: var(--color-background-2);
    padding: 2rem;
    margin-top: 4rem;
    text-align: center;
    border-top: var(--border);

    p {
        margin: 0.5rem 0;
        color: var(--text-color-dark);
    }

    a {
        color: var(--text-color-dark);
        text-decoration: none;
        transition: color 0.3s ease;

        &:hover {
            color: var(--color-decoration-light);
        }
    }

    .footer-links {
        display: flex;
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        margin: 1rem 0;
    }

    .footer-divider {
        color: var(--text-color-dark);
    }
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .footer-divider {
        display: none;
    }
}

/* =====================================================
   TOAST NOTIFICATIONS
   ===================================================== */

.toast-container {
    position: fixed;
    bottom: 5.5rem; /* above floating cart button */
    right: 2rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 320px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: rgb(from var(--color-background-2) r g b / 0.96);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid var(--white-alpha-10);
    border-left-width: 3px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    transform: translateX(calc(100% + 2rem));
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;

    &.toast-visible {
        transform: translateX(0);
        opacity: 1;
    }

    &.toast-hiding {
        transform: translateX(calc(100% + 2rem));
        opacity: 0;
        transition: transform 0.25s ease-in, opacity 0.25s ease-in;
    }

    &.toast-success {
        border-left-color: var(--color-success);

        .toast-icon {
            color: var(--color-success);
            background: var(--success-alpha-10);
        }
    }

    &.toast-error {
        border-left-color: var(--color-error);

        .toast-icon {
            color: var(--color-error);
            background: var(--error-alpha-10);
        }
    }

    &.toast-warning {
        border-left-color: var(--color-warning);

        .toast-icon {
            color: var(--color-warning);
            background: var(--warning-alpha-10);
        }
    }

    &.toast-info {
        border-left-color: var(--color-decoration-light);

        .toast-icon {
            color: var(--color-decoration-light);
            background: var(--color-decoration-light-alpha-15);
        }
    }
}

.toast-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 1px;
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-color-light);
    line-height: 1.4;
    padding-top: 2px;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-color-dark);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
    line-height: 1;
    margin-top: 3px;
    opacity: 0.6;
    transition: opacity 0.15s ease;

    &:hover {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .toast-container {
        right: 1rem;
        left: 1rem;
        max-width: none;
        bottom: 5rem;
    }
}
