/* ═══════════════════════════════════════════════════════════
   configurateur.css — L'Art de la Pierre (Version Finale)
   ═══════════════════════════════════════════════════════════ */

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

:root {
    --stone:        #D6CCBC;
    --stone-border: #B0A494;
    --stone-dark:   #C8BEAE;
    --accent:       #6B5744;
    --accent-light: #9A7E67;
    --text:         #1E1A17;
    --text-muted:   #8A7A6A;
    --text-faint:   #B0A49A;
    --bg:           #F5F1EB;
    --surface:      #FDFAF6;
    --surface-raised: #FFFFFF;
    --border:       #E4DDD4;
    --border-light: #EDE8DF;
    --btn-bg:       #1E1A17;
    --btn-text:     #F5F1EB;
    --tag-bg:       #EDE8DF;
    --tag-on:       #6B5744;
    --notif-bg:     #1E1A17;
    --radius-sm:    6px;
    --radius-md:    10px;
    --radius-lg:    14px;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── Fix Global : Gestion de la Navbar fixe ──────────────── */
main:has(.page) {
    margin-top: 0 !important;
    padding-top: 110px; /* Décale proprement la page sous la navbar */
}

/* ── Page wrapper ────────────────────────────────────────── */
.page {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 28px 100px;
}

/* ── 1. Header ───────────────────────────────────────────── */
.header {
    margin-top: 100px;
    margin-bottom: 44px;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--border-light);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent-light);
    margin-bottom: 14px;
}

.eyebrow::before {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: var(--accent-light);
}

h1 {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(34px, 5vw, 52px);
    line-height: 1.08;
    color: var(--text);
    letter-spacing: -0.01em;
}

h1 em {
    font-style: italic;
    color: var(--accent);
}

/* ── 2. Contact card ─────────────────────────────────────── */
.contact-card {
    margin-top: 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 44px;
    padding: 20px 28px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
}

.contact-card__intro {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted);
    flex-shrink: 0;
}

.contact-card__items {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.contact-card__item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px 9px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 100px;
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    max-width: 100%;
    overflow: hidden;
    transition: background .16s, border-color .16s, transform .12s;
}

.contact-card__item:hover {
    background: #EDE8DF;
    border-color: var(--stone-border);
    transform: translateY(-1px);
}

.contact-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--surface-raised);
    border-radius: 50%;
    flex-shrink: 0;
}

.contact-card__icon svg {
    width: 14px;
    height: 14px;
    color: var(--accent);
}

.contact-card__label {
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: 100%;
}

/* ── 3. Configurateur — barre d'actions ──────────────────── */
.add-btn-container {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.add-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 22px;
    background: var(--btn-bg);
    color: var(--btn-text);
    border: none;
    border-radius: 100px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: opacity .15s, transform .15s;
}

.add-btn:hover   { opacity: .82; transform: translateY(-1px); }
.add-btn:active  { transform: translateY(0); }

.add-btn .plus-icon {
    width: 20px;
    height: 20px;
    background: rgba(255,255,255,.14);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    line-height: 1;
    flex-shrink: 0;
}

.stone-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-faint);
    letter-spacing: 0.04em;
}

/* ── 4. Liste de pierres ─────────────────────────────────── */
#liste-pierres {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.stone-instance {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: slideIn .28s cubic-bezier(.22,.8,.36,1) both;
}

.stone-instance.removing {
    animation: slideOut .22s ease forwards;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px) scale(.99); }
    to   { opacity: 1; transform: none; }
}

@keyframes slideOut {
    to { opacity: 0; transform: translateY(-6px) scale(.98); max-height: 0; padding: 0; margin: 0; }
}

.layout {
    display: grid;
    grid-template-columns: 1fr 280px;
}

/* Canvas Wrap */
.canvas-wrap {
    padding: 24px;
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #FAF7F3;
}

.canvas-stage svg {
    width: 100%;
    height: auto;
    display: block;
}

.dim-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 8px;
    fill: #A8A09A;
}

/* Tags */
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    padding: 4px 11px;
    background: var(--tag-bg);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.tag.on {
    background: var(--accent);
    color: #F5EFE8;
}

/* Panel droite */
.panel {
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sec-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-faint);
}

/* Dimensions Inputs */
.dim-inputs {
    display: flex;
    gap: 8px;
}

.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-group label {
    font-size: 11px;
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color .15s, background .15s;
}

.input-group input:focus {
    border-color: var(--accent);
    background: #fff;
}

/* Finitions */
.fin-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fin-btn {
    display: grid;
    grid-template-columns: 16px 1fr;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: background .12s, border-color .12s;
    text-align: left;
}

.fin-btn:hover {
    background: #F2EDE6;
    border-color: var(--border);
}

.fin-btn.on {
    background: #EDE4D8;
    border-color: var(--accent-light);
}

.fin-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border);
    transition: background .15s;
    flex-shrink: 0;
}

.fin-btn.on .fin-indicator {
    background: var(--accent);
}

.fin-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

/* Description dynamique */
.desc-text {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.55;
    min-height: 36px;
    font-style: italic;
}

/* Supprimer */
.delete-btn {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: transparent;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-faint);
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background .13s, color .13s, border-color .13s;
}

.delete-btn:hover {
    background: #FBF0EC;
    border-color: #E8B8A8;
    color: #B84A30;
}

/* ── 5. Formulaire client ────────────────────────────────── */
.client-form {
    margin-top: 44px;
    padding: 32px 36px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.client-form::before {
    content: 'Vos coordonnées';
    display: block;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 22px;
}

.client-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.client-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.client-field label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.client-field input,
.client-field textarea {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color .15s, background .15s;
}

.client-field input:focus,
.client-field textarea:focus {
    border-color: var(--accent);
    background: #fff;
}

.client-field input::placeholder,
.client-field textarea::placeholder {
    color: var(--text-faint);
}

.client-field textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

.client-form > div:last-child {
    padding-top: 20px;
    margin-top: 8px;
    border-top: 1px solid var(--border-light);
}

/* ── 6. Notifications toast ──────────────────────────────── */
#notif-container {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    z-index: 100;
}

.notif {
    padding: 10px 22px;
    background: var(--notif-bg);
    color: #F5F1EB;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    letter-spacing: 0.01em;
    animation: notifIn .2s ease both, notifOut .3s ease 2.6s both;
}

@keyframes notifIn  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes notifOut { to   { opacity: 0; transform: translateY(6px); } }


/* ==========================================================================
   CONFIGURATEUR — OPTIMISATIONS RESPONSIVE
   ========================================================================== */

/* ── Écrans Intermédiaires (Max 880px) ──────────────────────────────────── */
@media (max-width: 880px) {
    .page {
        padding: 0 20px 60px;
    }
}

/* ── Tablettes et Menu Mobile Fix (Max 768px) ───────────────────────────── */
@media (max-width: 768px) {
    /* Évite le télescopage des liens dans votre en-tête global */
    .navbar {
        padding: 16px 20px !important;
        flex-direction: column;
        gap: 12px;
        background: rgba(253, 252, 250, 0.98) !important;
        border-bottom: 1px solid var(--border-light);
    }

    .navbar .logo {
        color: var(--text) !important;
    }

    .nav-links {
        gap: 16px !important;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links a {
        color: var(--text-muted) !important;
        font-size: 0.75rem !important;
    }

    /* Décale plus fort la page pour compenser le menu sur deux lignes */
    main:has(.page) {
        padding-top: 130px;
    }

    .header {
        margin-bottom: 32px;
        padding-bottom: 24px;
    }

    /* Le layout passe sur une seule colonne */
    .layout {
        grid-template-columns: 1fr;
    }

    .canvas-wrap {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding: 20px;
    }

    .panel {
        padding: 20px;
        gap: 24px;
    }

    .fin-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}

/* ── Smartphones Standard (Max 560px) ───────────────────────────────────── */
@media (max-width: 560px) {
    h1 {
        font-size: 32px;
    }

    /* Carte Contact en colonne propre */
    .contact-card {
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        gap: 16px;
    }

    .contact-card__intro {
        text-align: center;
    }

    .contact-card__items {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .contact-card__item {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }

    .contact-card__label {
        font-size: 11px !important; /* Force la réduction de l'e-mail */
    }

    /* Bouton Ajouter */
    .add-btn-container {
        width: 100%;
    }

    .add-btn {
        width: 100%;
        justify-content: center;
        padding: 14px;
    }

    /* Inputs en colonne tactile */
    .dim-inputs {
        flex-direction: column;
        gap: 12px;
    }

    .input-group input {
        padding: 11px 12px;
    }

    /* Finitions sur 1 colonne */
    .fin-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .fin-btn {
        padding: 12px;
    }

    /* Formulaire Client */
    .client-form {
        padding: 24px 20px;
        margin-top: 32px;
    }

    .client-form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

/* ── Ajustements pour Écrans Minuscules (Max 380px) ──────────────────────── */
@media (max-width: 380px) {
    .page {
        padding: 0 16px 40px;
    }

    .canvas-wrap {
        padding: 12px;
    }

    .notif {
        font-size: 12px;
        padding: 10px 16px;
        white-space: normal;
        text-align: center;
        max-width: 90vw;
    }

    .contact-card__label {
        font-size: 10px !important;
    }
}
