/**
 * MA BOX PRÉCIEUSE - Création sur mesure
 * CSS spécifique à la page pages/creation-sur-mesure.php
 * Complète style.css sans le remplacer.
 */

/* ============================================================
   HERO - centré, hauteur réduite (override du hero 2-colonnes)
============================================================ */
.page-creation-sur-mesure .hero {
    min-height: 56vh;
    justify-content: center;
    text-align: center;
}

.hero-inner {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
    animation: fadeSlideUp 1s ease-out;
}

.page-creation-sur-mesure .hero h1 {
    font-size: 3.4rem;
}

/* ============================================================
   SECTION PRODUITS
============================================================ */
.csm-products-section {
    padding: 100px 48px;
    max-width: 1300px;
    margin: 0 auto;
}

.csm-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    align-items: start;
}

.csm-product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(184, 137, 154, 0.06);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.csm-product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.csm-product-visual {
    width: 100%;
    aspect-ratio: 4/3;
    position: relative;
    overflow: hidden;
    background: var(--cream);
}

/* Carousel multi-photos */
.csm-slide {
    position: absolute;
    inset: 0;
    display: none;
}
.csm-slide.active { display: block; }

/* Fond flouté = même photo zoomée/floutée pour combler l'espace sans recadrer la photo nette */
.csm-slide-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(18px) brightness(0.92);
    transform: scale(1.15);
}

.csm-slide img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}
.csm-slide img:hover { transform: scale(1.03); }

/* Icône zoom au survol */
.csm-zoom-hint {
    position: absolute;
    bottom: 10px; left: 10px;
    z-index: 5;
    background: rgba(0,0,0,0.45);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.csm-product-visual:hover .csm-zoom-hint { opacity: 1; }

.csm-slide-gradient {
    width: 100%;
    height: 100%;
}

/* ---- Lightbox ---- */
.csm-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.92);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.csm-lightbox.open { display: flex; }

.csm-lightbox img {
    max-width: 92vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 60px rgba(0,0,0,0.6);
    display: block;
}

.csm-lb-close {
    position: absolute;
    top: 18px; right: 24px;
    background: rgba(255,255,255,0.12);
    border: none; color: #fff;
    width: 40px; height: 40px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.csm-lb-close:hover { background: rgba(255,255,255,0.25); }

.csm-lb-arrow {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.12);
    border: none; color: #fff;
    width: 48px; height: 48px;
    border-radius: 50%;
    font-size: 1.6rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.csm-lb-arrow:hover { background: rgba(255,255,255,0.25); }
.csm-lb-prev { left: 20px; }
.csm-lb-next { right: 20px; }

.csm-lb-counter {
    position: absolute;
    bottom: 18px; left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.6);
    font-size: 0.82rem;
    font-weight: 500;
}

/* Flèches */
.csm-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.88);
    border: none;
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    color: var(--rose-dark);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: background 0.2s, transform 0.2s;
    padding: 0;
}
.csm-arrow:hover { background: var(--white); transform: translateY(-50%) scale(1.1); }
.csm-arrow-prev { left: 8px; }
.csm-arrow-next { right: 8px; }

/* Dots */
.csm-dots {
    position: absolute;
    bottom: 8px; left: 50%;
    transform: translateX(-50%);
    display: flex; gap: 5px;
    z-index: 10;
}
.csm-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.55);
    border: none; cursor: pointer; padding: 0;
    transition: background 0.2s, transform 0.2s;
}
.csm-dot.active { background: var(--rose-dark); transform: scale(1.3); }

.csm-badge-devis {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--soft-black);
    color: var(--white);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    z-index: 3;
}

.csm-product-body {
    padding: 24px 24px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.csm-product-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--soft-black);
    margin-bottom: 8px;
    line-height: 1.25;
}

.csm-product-desc {
    font-size: 0.88rem;
    color: var(--text-medium);
    line-height: 1.6;
    font-weight: 300;
    flex: 1;
    margin-bottom: 20px;
}

.csm-product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid rgba(184, 137, 154, 0.1);
}

.csm-price-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--rose-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.csm-btn-devis {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--rose-dark);
    color: var(--white);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: var(--font-body);
    letter-spacing: 0.2px;
}

.csm-btn-devis:hover {
    background: var(--mauve);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 94, 107, 0.25);
}

/* ============================================================
   SECTION COMMENT ÇA MARCHE
============================================================ */
.csm-how-section {
    background: var(--soft-black);
    padding: 100px 48px;
    position: relative;
    overflow: hidden;
}

.csm-how-section::before {
    content: '';
    position: absolute;
    top: -150px;
    right: -150px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(184, 137, 154, 0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.csm-how-section .section-title .label { color: var(--peach); }
.csm-how-section .section-title h2    { color: var(--white); }
.csm-how-section .section-title p     { color: rgba(255, 255, 255, 0.5); }

.csm-steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.csm-steps-grid::before {
    content: '';
    position: absolute;
    top: 32px;
    left: calc(16.66% + 16px);
    right: calc(16.66% + 16px);
    height: 2px;
    background: linear-gradient(90deg, var(--rose-dark), var(--mauve), var(--rose-dark));
    opacity: 0.25;
}

.csm-step-card {
    text-align: center;
    position: relative;
}

.csm-step-number {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rose-dark), var(--mauve));
    color: var(--white);
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px;
    box-shadow: 0 8px 24px rgba(139, 94, 107, 0.4);
}

.csm-step-icon {
    font-size: 2rem;
    margin-bottom: 20px;
    display: block;
}

.csm-step-card h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 14px;
    line-height: 1.25;
}

.csm-step-card p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.7;
    font-weight: 300;
}

/* ============================================================
   MODALE
============================================================ */
.csm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 26, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.csm-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.csm-modal {
    background: var(--warm-white);
    border-radius: var(--radius-lg);
    padding: 48px;
    max-width: 580px;
    width: 100%;
    position: relative;
    transform: translateY(30px) scale(0.97);
    transition: transform 0.35s var(--ease-smooth);
    max-height: 90vh;
    overflow-y: auto;
}

.csm-modal-overlay.open .csm-modal {
    transform: translateY(0) scale(1);
}

.csm-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(139, 94, 107, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1.1rem;
    color: var(--charcoal);
    font-family: inherit;
}

.csm-modal-close:hover {
    background: var(--blush);
    color: var(--rose-dark);
    transform: scale(1.1);
}

.csm-modal-header { margin-bottom: 28px; }

.csm-modal-header .label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--rose-dark);
    font-weight: 600;
    display: block;
    margin-bottom: 10px;
}

.csm-modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--soft-black);
    line-height: 1.2;
}

.csm-modal-header p {
    font-size: 0.88rem;
    color: var(--text-medium);
    margin-top: 8px;
    line-height: 1.6;
    font-weight: 300;
}

.csm-form-submit {
    width: 100%;
    padding: 16px;
    background: var(--rose-dark);
    color: var(--white);
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.csm-form-submit:hover {
    background: var(--mauve);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(139, 94, 107, 0.3);
}

.csm-form-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.csm-form-error {
    background: #FEE8E8;
    color: #C0392B;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-bottom: 16px;
    display: none;
}

.csm-form-error.visible { display: block; }

/* Confirmation */
.csm-form-confirmation {
    display: none;
    text-align: center;
    padding: 24px 0 8px;
}

.csm-form-confirmation.visible { display: block; }

.csm-confirmation-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blush), var(--blush-light));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 2.2rem;
}

.csm-form-confirmation h3 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--soft-black);
    margin-bottom: 14px;
}

.csm-form-confirmation p {
    font-size: 0.9rem;
    color: var(--text-medium);
    line-height: 1.7;
    max-width: 400px;
    margin: 0 auto 28px;
}

/* ============================================================
   RESPONSIVE - Tablette (1024px)
============================================================ */
@media (max-width: 1024px) {
    .csm-products-section { padding: 80px 32px; }
    .csm-products-grid    { grid-template-columns: repeat(2, 1fr); }

    .csm-how-section  { padding: 80px 32px; }
    .csm-steps-grid   { gap: 28px; }
}

/* ============================================================
   RESPONSIVE - Mobile (768px)
============================================================ */
@media (max-width: 768px) {
    .page-creation-sur-mesure .hero { padding: 120px 24px 60px; min-height: 50vh; }
    .page-creation-sur-mesure .hero h1 { font-size: 2.2rem; }

    .csm-products-section { padding: 60px 20px; }
    .csm-products-grid    { grid-template-columns: 1fr; }

    .csm-how-section  { padding: 60px 20px; }
    .csm-steps-grid   { grid-template-columns: 1fr; gap: 40px; }
    .csm-steps-grid::before { display: none; }

    .csm-modal { padding: 32px 24px; border-radius: var(--radius-md); }
    .csm-modal-header h2 { font-size: 1.5rem; }
}

/* ============================================================
   RESPONSIVE - Petit mobile (480px)
============================================================ */
@media (max-width: 480px) {
    .page-creation-sur-mesure .hero h1 { font-size: 1.9rem; }
    .page-creation-sur-mesure .hero    { padding: 115px 20px 50px; }
}
