/* 
 * Tradisol Configurator Styles
 * Signature Edition v8.0 - Studio Focus
 */

:root {
    --primary: #0a0a0a;
    --accent: #c99947;
    --accent-light: #e6c88e;
    --light: #f8f8fa;
    --grey: #86868b;
    --border: rgba(0, 0, 0, 0.08);
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.75);
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-main);
    color: var(--primary);
    background-color: #fdfdfd;
    line-height: 1.6;
}

/* Desktop uniquement : pas de scroll sur la page entière */
@media (min-width: 769px) {
    html, body {
        overflow: hidden;
        height: 100%;
    }
}

/* Header Integration */
.config-header {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background: transparent;
    position: absolute;
    width: 100%;
    top: 0;
    z-index: 100;
}

.logo-img { height: 90px; }

.btn-back {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    transition: color 0.3s;
}

/* Layout Hierarchy */
.layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Viewer Showroom */
.viewer-container {
    flex: 1;
    position: relative;
    background: #ffffff; /* Ton sur ton avec l'image */
    display: flex;
    align-items: center;
    justify-content: center;
}

#main-config-image {
    max-width: 85%;
    max-height: 80%;
    object-fit: contain;
    mix-blend-mode: multiply; /* Fait disparaître le carré blanc s'il n'est pas 100% pur */
    /* Suppression du drop-shadow pour ne plus voir le carré blanc */
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.version-tag {
    position: absolute;
    bottom: 30px;
    left: 40px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--grey);
}

/* Sidebar Signature (Glassmorphism) */
.config-panel {
    width: 480px;
    background: rgba(210, 210, 215, 0.96);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: -15px 0 50px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    z-index: 50;
}

.config-content {
    padding: 60px 45px;
    flex: 1;
    overflow-y: auto;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.25;
    margin-bottom: 8px;
    color: #000;
    letter-spacing: 0.5px;
}

.section-subtitle {
    color: var(--grey);
    font-size: 0.85rem;
    margin-bottom: 40px;
}

.label {
    display: block;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 18px;
    color: var(--primary);
}

/* Selection Grid (Plateaux Circular) */
.grid-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 35px;
}

.option-card {
    width: 100%;
    padding-bottom: 100%; /* Robust 1:1 Aspect Ratio Fallback */
    height: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid #ffffff;
    position: relative;
    overflow: hidden;
}

.option-card img, .option-card .swatch {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

.option-card:hover { transform: scale(1.1); }

.option-card.active {
    border-color: var(--accent);
}

/* Usage Toggle Group */
.usage-toggle-group {
    display: flex;
    background: rgba(0,0,0,0.05);
    padding: 4px;
    border-radius: 40px;
    margin-bottom: 35px;
}

.usage-option {
    flex: 1;
    padding: 10px 15px;
    text-align: center;
    border-radius: 35px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    color: var(--grey);
}

.usage-option.active {
    background: #fff;
    color: #000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Options désactivées */
.option-disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
    position: relative;
}

.badge-soon {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--accent);
    color: #fff;
    padding: 2px 6px;
    border-radius: 20px;
    margin-left: 4px;
    vertical-align: middle;
    font-style: normal;
}

/* Dimension Select Styling */
.select-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 35px;
}

.select-wrapper::after {
    content: '\25BC';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 0.7rem;
    color: var(--grey);
}

#select-dimension {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.08);
    padding: 16px 20px;
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

#select-dimension:hover {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.15);
}

#select-dimension:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(201, 153, 71, 0.15);
}

/* Dynamic Price Segment */
.price-box {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.total-price {
    font-size: 2.4rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: #000;
    letter-spacing: -1px;
}

/* CTA Sticky Group */
.cta-group {
    padding: 40px 45px;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn {
    padding: 20px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background: #000;
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(201, 153, 71, 0.2);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(0,0,0,0.15);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.3);
}

/* Loading State */
.btn.loading {
    pointer-events: none;
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* =============================================
   RESPONSIVE — Tablette & Mobile
   ============================================= */

/* Tablette (≤ 1024px) */
@media (max-width: 1024px) {
    body { overflow: auto; }

    .layout {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .config-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.3);
        height: auto;
    }

    .viewer-container { height: 55vh; }

    .config-content { padding: 40px 30px 20px; }

    .cta-group { padding: 20px 30px 40px; }
}

/* Mobile (≤ 768px) */
@media (max-width: 768px) {
    .config-header {
        padding: 0 20px;
        height: 80px;
        background: rgba(255,255,255,0.9);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        position: fixed;
        border-bottom: 1px solid rgba(0,0,0,0.06);
    }

    .logo-img { height: 60px; }

    .btn-back {
        font-size: 0.78rem;
    }

    .layout {
        flex-direction: column;
        height: auto;
        padding-top: 56px; /* compense le header fixed */
    }

    .viewer-container {
        height: 45vw;
        min-height: 220px;
        max-height: 320px;
    }

    #main-config-image {
        max-width: 90%;
        max-height: 90%;
    }

    .version-tag { display: none; }

    .config-panel {
        width: 100%;
        border-left: none;
        border-top: none;
        box-shadow: none;
        background: #fdfdfd;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .config-content {
        padding: 28px 20px 16px;
        overflow-y: visible;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 6px;
    }

    .section-subtitle {
        font-size: 0.8rem;
        margin-bottom: 28px;
    }

    .label {
        font-size: 0.65rem;
        margin-bottom: 12px;
    }

    .option-group {
        margin-bottom: 4px;
    }

    .usage-toggle-group {
        margin-bottom: 24px;
    }

    .usage-option {
        padding: 10px 8px;
        font-size: 0.68rem;
        letter-spacing: 0.5px;
    }

    .grid-options {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        margin-bottom: 24px;
    }

    .select-wrapper {
        margin-bottom: 24px;
    }

    #select-dimension {
        padding: 14px 16px;
        font-size: 0.9rem;
    }

    .price-box {
        margin-top: 24px;
        padding-top: 20px;
    }

    .total-price {
        font-size: 1.9rem;
    }

    /* CTA sticky en bas sur mobile */
    .cta-group {
        position: sticky;
        bottom: 0;
        background: rgba(253,253,253,0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 16px 20px 28px;
        border-top: 1px solid rgba(0,0,0,0.06);
        gap: 10px;
        z-index: 80;
    }

    .btn {
        padding: 16px;
        font-size: 0.72rem;
        letter-spacing: 1.5px;
    }
}

/* Petit mobile (≤ 480px) */
@media (max-width: 480px) {
    .viewer-container {
        height: 52vw;
        min-height: 200px;
    }

    .section-title { font-size: 1.3rem; }

    .grid-options {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .usage-option {
        padding: 9px 4px;
        font-size: 0.62rem;
    }

    .total-price { font-size: 1.7rem; }
}

/* =============================================
   MODAL & FORM (Signature Edition)
   ============================================= */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 600px;
    padding: 50px;
    border-radius: 30px;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.2);
    max-height: 95vh;
    overflow-y: auto;
}

.btnClose {
    position: absolute;
    top: 25px;
    right: 25px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.btnClose:hover { color: #000; }

.modal-header { margin-bottom: 30px; }

.modal-subtitle {
    font-size: 0.9rem;
    color: var(--grey);
    margin-bottom: 12px;
}

#config-summary-box {
    background: #f8f8fa;
    padding: 15px 20px;
    border-radius: 12px;
    border-left: 4px solid var(--accent);
}

#config-summary {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.field label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    color: #666;
}

.field input, .field textarea {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: all 0.3s;
    background: #fafafa;
}

.field input:focus, .field textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 5px 15px rgba(201, 153, 71, 0.1);
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.w-100 { width: 100%; }

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Mobile Adjustments for Modal */
@media (max-width: 768px) {
    .modal-content {
        padding: 40px 25px;
        width: 95%;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}
