:root {
    --sweetch-terracotta: #A7452E;
    --sweetch-beige: #FAFAFA;
    --sweetch-beige-section: #F2ECE6;
    --sweetch-black: #1C1C1C;
    --sweetch-noir: #1C1C1C;
    --text-dark: #1C1C1C;
    --text-light: #666666;
    --border-light: #E5E5E5;
    --white: #FFFFFF;
    --light-gray: #F5F5F5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: linear-gradient(135deg, var(--sweetch-beige) 0%, var(--sweetch-beige-section) 100%);
    color: var(--sweetch-noir);
    overflow-x: hidden;
    min-height: 100vh;
    touch-action: pan-y;
    padding-bottom: 160px;
}

html {
    touch-action: manipulation;
}

#main-section-content,
.container-fluid,
.main-section {
    overflow: visible !important;
}

.cfg-steps-container {
    background: var(--white);
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.cfg-steps-bar {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 0 auto;
    max-width: 600px;
}

.cfg-steps-bar::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-light);
    z-index: 1;
}

.cfg-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    width: 33.33%;
}

.cfg-step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.cfg-step.active .cfg-step-circle,
.cfg-step.completed .cfg-step-circle {
    background: var(--sweetch-terracotta);
    color: white;
}

.cfg-step-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
}

.cfg-step.active .cfg-step-label,
.cfg-step.completed .cfg-step-label {
    color: var(--text-dark);
    font-weight: 500;
}

.cfg2-progress-container {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: var(--white);
    z-index: 95;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.cfg2-progress-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: 10px;
    overflow: hidden;
}

.cfg2-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sweetch-terracotta), #D85A3E);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

.cfg2-progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    font-size: 12px;
    color: var(--text-light);
    font-family: 'Lexend Deca', sans-serif;
}

.cfg2-progress-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cfg2-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-light);
    transition: all 0.3s ease;
}

.cfg2-step-dot.active {
    background: var(--sweetch-terracotta);
    transform: scale(1.3);
}

.cfg2-step-dot.completed {
    background: var(--sweetch-terracotta);
}

.cfg2-main-container {
    margin-top: 20px;
    padding: 0;
    padding-bottom: 100px;
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}

.cfg2-section-container {
    flex: 1;
    display: none;
    flex-direction: column;
    padding: 2rem 1rem;
    padding-bottom: 120px;
    animation: cfg2FadeIn 0.5s ease;
}

.cfg2-section-container.active {
    display: flex;
}

@keyframes cfg2FadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.cfg2-section-title {
    font-size: 28px;
    font-weight: 500;
    text-align: center;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    letter-spacing: -0.05em;
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.2;
}

.cfg2-section-subtitle {
    font-size: 15px;
    text-align: center;
    color: var(--text-light);
    font-family: 'Lexend Deca', sans-serif;
    margin-bottom: 2rem;
    font-weight: 400;
}

.cfg2-preview-zone {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.cfg2-facade-preview {
    width: 200px;
    height: 200px;
    border: 3px solid var(--border-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-light);
    text-align: center;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: var(--light-gray);
}

.cfg2-design-label {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--sweetch-terracotta);
    font-family: 'Space Grotesk', sans-serif;
}

.cfg2-poignee-on-facade {
    display: none;
    position: absolute;
    width: 12px;
    height: 60px;
    background: var(--sweetch-terracotta);
    border-radius: 6px;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.4s ease;
}

.cfg2-poignee-on-facade.visible {
    opacity: 1;
}

.cfg2-poignee-on-facade.secondaire {
    left: 20px;
    right: auto;
}

.cfg2-carousel-container {
    position: relative;
    width: 100%;
    overflow: visible;
    margin-bottom: 2rem;
}

.cfg2-carousel-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: grab;
    user-select: none;
    overflow: visible;
}

.cfg2-carousel-track.grabbing {
    cursor: grabbing;
}

.cfg2-carousel-item {
    min-width: 100%;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
    overflow: visible;
}

.cfg2-style-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    text-align: center;
    max-width: 320px;
    width: 100%;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.3s ease;
    border: 3px solid transparent;
    min-height: 44px;
}

.cfg2-style-card:active {
    transform: scale(0.98);
}

.cfg2-style-card.selected {
    border-color: var(--sweetch-terracotta);
    box-shadow: 0 12px 40px rgba(167, 69, 46, 0.25);
}

.cfg2-style-preview {
    width: 150px;
    height: 150px;
    margin: 0 auto 1.5rem;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--sweetch-terracotta);
    background: var(--light-gray);
}

.cfg2-style-name {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-family: 'Space Grotesk', sans-serif;
}

.cfg2-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
    margin-bottom: 3rem;
}

.cfg2-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-light);
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 8px;
    min-width: 8px;
}

.cfg2-carousel-dot.active {
    background: var(--sweetch-terracotta);
    width: 24px;
    border-radius: 4px;
}

.cfg2-swipe-hint {
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    font-family: 'Lexend Deca', sans-serif;
    margin-top: 1rem;
    opacity: 0.7;
}

.cfg2-color-categories {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: visible;
    padding: 0 1rem;
    scrollbar-width: none;
}

.cfg2-color-categories::-webkit-scrollbar {
    display: none;
}

.cfg2-color-category {
    padding: 0.75rem 1rem;
    background: var(--white);
    border: 2px solid var(--border-light);
    border-radius: 0;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Space Grotesk', sans-serif;
    min-height: 44px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cfg2-color-category.active {
    background: var(--sweetch-terracotta);
    color: var(--white);
    border-color: var(--sweetch-terracotta);
}

.cfg2-colors-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 0 1rem;
    padding-bottom: 40px;
    max-height: none;
    overflow-y: visible;
}

.cfg2-color-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    min-height: 48px;
    min-width: 48px;
}

.cfg2-color-swatch:active {
    transform: scale(0.95);
}

.cfg2-color-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border-top-right-radius: 0;
    border: 3px solid var(--border-light);
    transition: all 0.3s ease;
    position: relative;
}

.cfg2-color-swatch.active .cfg2-color-circle {
    border-color: var(--sweetch-terracotta);
    box-shadow: 0 0 0 4px rgba(167, 69, 46, 0.2);
    transform: scale(1.1);
}

.cfg2-color-circle::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--white);
    font-size: 20px;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-shadow: 0 0 3px rgba(0,0,0,0.5);
}

.cfg2-color-swatch.active .cfg2-color-circle::after {
    opacity: 1;
}

.cfg2-color-name {
    font-size: 11px;
    color: var(--text-light);
    text-align: center;
    font-family: 'Lexend Deca', sans-serif;
    line-height: 1.2;
}

.cfg2-custom-color-container {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    margin: 0 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.cfg2-custom-color-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-dark);
    font-family: 'Space Grotesk', sans-serif;
}

.cfg2-custom-color-options {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.cfg2-custom-color-option {
    padding: 0.75rem 2rem;
    background: var(--light-gray);
    border: 2px solid transparent;
    border-radius: 0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Space Grotesk', sans-serif;
    min-height: 44px;
}

.cfg2-custom-color-option.active {
    background: rgba(167, 69, 46, 0.1);
    border-color: var(--sweetch-terracotta);
    color: var(--sweetch-terracotta);
}

.cfg2-custom-color-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cfg2-custom-color-input-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
}

.cfg2-custom-color-input-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    font-family: 'Space Grotesk', sans-serif;
}

.cfg2-custom-color-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: 0;
    font-size: 14px;
    font-family: 'Lexend Deca', sans-serif;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.cfg2-custom-color-input:focus {
    outline: none;
    border-color: var(--sweetch-terracotta);
}

.cfg2-text-muted {
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
    font-family: 'Lexend Deca', sans-serif;
}

.cfg2-poignee-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    text-align: center;
    max-width: 320px;
    width: 100%;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.cfg2-poignee-card.selected {
    border-color: var(--sweetch-terracotta);
    box-shadow: 0 12px 40px rgba(167, 69, 46, 0.25);
}

.cfg2-poignee-visual {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--sweetch-terracotta);
    background: #FFFFFF;
}

.cfg2-poignee-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-family: 'Space Grotesk', sans-serif;
}

.cfg2-poignee-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.cfg2-option-group {
    text-align: left;
}

.cfg2-option-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-family: 'Lexend Deca', sans-serif;
}

.cfg2-option-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cfg2-option-pill {
    padding: 0.5rem 1rem;
    background: var(--light-gray);
    border: 2px solid transparent;
    border-radius: 0;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Lexend Deca', sans-serif;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cfg2-option-pill.active {
    background: rgba(167, 69, 46, 0.1);
    border-color: var(--sweetch-terracotta);
    color: var(--sweetch-terracotta);
    font-weight: 600;
}

.cfg2-color-pill {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border-top-right-radius: 0;
    border: 2px solid var(--border-light);
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 32px;
    min-width: 32px;
}

.cfg2-color-pill.active {
    border-color: var(--sweetch-terracotta);
    box-shadow: 0 0 0 3px rgba(167, 69, 46, 0.2);
    transform: scale(1.15);
}

.cfg2-navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    display: flex;
    gap: 1rem;
    z-index: 99;
}

.cfg2-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
}

.cfg2-btn-secondary {
    background: var(--light-gray);
    color: var(--text-dark);
}

.cfg2-btn-primary {
    background: var(--sweetch-terracotta);
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.cfg2-btn:active {
    transform: scale(0.98);
}

.cfg2-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cfg2-section-separator {
    display: none;
}

.cfg2-desktop-grid {
    display: none;
}

@media (max-width: 480px) {
    .cfg2-colors-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .cfg2-color-circle {
        width: 50px;
        height: 50px;
    }

    .cfg2-section-title {
        font-size: 24px;
    }
}

@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }

    .cfg2-main-container {
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
        display: block;
        padding: 2rem;
    }

    .cfg2-progress-container {
        max-width: 500px;
        margin: 0 auto 2rem;
        border-radius: 0 0 16px 16px;
    }

    .cfg2-desktop-layout {
        display: flex;
        gap: 3rem;
        width: 100%;
        max-width: 1400px;
        margin: 20px auto 0;
        justify-content: center;
        align-items: flex-start;
    }

    .cfg2-desktop-preview-column {
        position: sticky;
        top: 200px;
        width: 400px;
        height: fit-content;
        flex-shrink: 0;
    }

    .cfg2-desktop-content-column {
        flex: 1;
        min-width: 0;
        max-width: 900px;
    }

    .cfg2-preview-zone {
        min-height: 400px;
    }

    .cfg2-facade-preview {
        width: 300px;
        height: 300px;
    }

    .cfg2-section-container {
        display: block !important;
        opacity: 1;
        padding: 0;
        margin-bottom: 3rem;
    }

    .cfg2-carousel-container,
    .cfg2-carousel-dots,
    .cfg2-swipe-hint {
        display: none;
    }

    .cfg2-desktop-grid {
        display: grid !important;
        gap: 1.5rem;
    }

    .cfg2-design-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .cfg2-colors-grid {
        grid-template-columns: repeat(8, 1fr) !important;
        max-height: none;
        padding: 0;
    }

    .cfg2-poignee-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .cfg2-navigation {
        display: none;
    }

    .cfg2-section-title {
        font-size: 32px;
        text-align: left;
        margin-bottom: 1rem;
    }

    .cfg2-section-subtitle {
        text-align: left;
        margin-bottom: 2rem;
    }

    .cfg2-color-categories {
        padding: 0;
        margin-bottom: 2rem;
    }

    .cfg2-custom-color-container {
        margin: 0;
    }

    .cfg2-section-separator {
        display: block;
        height: 2px;
        background: var(--border-light);
        margin: 3rem 0;
    }

    .cfg2-preview-info {
        background: var(--white);
        border-radius: 16px;
        padding: 1.5rem;
        margin-top: 1rem;
    }

    .cfg2-preview-info-title {
        font-size: 14px;
        font-weight: 600;
        color: var(--text-dark);
        margin-bottom: 1rem;
        font-family: 'Space Grotesk', sans-serif;
    }

    .cfg2-preview-info-item {
        display: flex;
        justify-content: space-between;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border-light);
        font-family: 'Lexend Deca', sans-serif;
        font-size: 14px;
    }

    .cfg2-preview-info-item:last-child {
        border-bottom: none;
    }

    .cfg2-preview-info-label {
        color: var(--text-light);
    }

    .cfg2-preview-info-value {
        color: var(--text-dark);
        font-weight: 600;
    }

    .cfg2-desktop-validate-btn {
        width: 100%;
        margin-top: 1.5rem;
    }

    html {
        scroll-behavior: smooth;
    }
    /* Fix sticky pour layout Sylius */
    #content, 
    main, 
    .main-content,
    [class*="container"] {
        overflow: visible !important;
    }

    .cfg2-progress-container {
        position: sticky !important;
        position: -webkit-sticky !important;
        top: 0 !important;
        z-index: 100 !important;
    }

    .cfg2-desktop-preview-column {
        position: sticky !important;
        position: -webkit-sticky !important;
        top: 120px !important;
        z-index: 50 !important;
        align-self: flex-start;
    }
    /* Popup veinage */
.cfg2-veinage-popup {
     position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

.cfg2-veinage-popup-content {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    text-align: center;
}

.cfg2-veinage-popup-content h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    color: var(--sweetch-terracotta);
    margin-bottom: 1rem;
}

.cfg2-veinage-popup-content p {
    font-family: 'Lexend Deca', sans-serif;
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.cfg2-veinage-popup-content button {
    margin-top: 1rem;
    width: 100%;
}

* Amélioration touch zone poignées */
.cfg2-poignee-card {
    touch-action: pan-y;
}

.cfg2-poignee-options {
    touch-action: manipulation;
}

.cfg2-option-pill,
.cfg2-color-pill {
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.cfg2-carousel-item {
    touch-action: pan-x;
}
