/* ========================================
   CALCULATEUR DE VALEUR D'OR — v3 "Vitrine Or"
   Design: Prix hero central, layout vertical, premium impact
   ======================================== */

/* ── Container ── */

.max-gold-calculator {
    margin: 0;
    padding: 40px 32px 36px;
    font-family: var(--max-font-primary);
    border-radius: 20px;
    background: linear-gradient(170deg, #0f2133 0%, #0a1a2a 40%, #0d1520 100%);
    border: 1px solid rgba(191, 149, 63, 0.18);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* Bordure dorée animée (shimmer) */
.max-gold-calculator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--max-gold-gradient);
    background-size: 200% 100%;
    animation: calcShimmer 4s ease-in-out infinite;
    z-index: 2;
}

/* Halo radial doré subtil en arrière-plan */
.max-gold-calculator::after {
    content: '';
    position: absolute;
    top: -60%;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(ellipse, rgba(191, 149, 63, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

@keyframes calcShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.max-gold-calculator-error {
    padding: 2rem;
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.2);
    border-radius: 12px;
    color: #ff6b6b;
    text-align: center;
    margin: 2rem auto;
    max-width: 600px;
}

/* ── Badge "Cours en direct" ── */

.max-calculator-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(74, 155, 168, 0.1);
    border: 1px solid rgba(74, 155, 168, 0.25);
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #4a9ba8;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.max-live-dot {
    width: 7px;
    height: 7px;
    background: #4ecb71;
    border-radius: 50%;
    animation: calcLivePulse 2s ease-in-out infinite;
}

@keyframes calcLivePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(78, 203, 113, 0.4); }
    50% { opacity: 0.6; box-shadow: 0 0 0 4px rgba(78, 203, 113, 0); }
}

/* ── Header (centré) ── */

.max-calculator-header {
    text-align: center;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    width: 100%;
}

.max-gold-calculator h2.max-calculator-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
    text-transform: none;
    text-shadow: none;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.max-gold-calculator .max-calculator-subtitle {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    margin: 0;
    font-weight: 400;
    opacity: 1;
}

/* ── Result (HERO — en haut, centré, géant) ── */

.max-calculator-result {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 28px 24px 24px;
    background: rgba(191, 149, 63, 0.04);
    border-radius: 16px;
    border: 1px solid rgba(191, 149, 63, 0.1);
    position: relative;
    z-index: 1;
    overflow: hidden;
    width: 100%;
    margin-bottom: 28px;
    order: -1;
}

.max-calculator-result::before {
    display: none;
}

.max-result-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-weight: 600;
}

.max-result-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    margin-bottom: 10px;
    min-height: auto;
    padding: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
}

.max-price-value {
    font-size: 3.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #d4af37 0%, #f5e6a3 40%, #d4af37 60%, #BF953F 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.2));
}

.max-price-currency {
    font-size: 2rem;
    background: linear-gradient(135deg, #d4af37, #BF953F);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.max-result-details {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    margin-top: 2px;
}

.max-detail-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.max-detail-label {
    opacity: 1;
}

.max-detail-value {
    color: var(--max-gold-light);
    font-weight: 600;
}

/* Séparateur doré entre résultat et contrôles */
.max-result-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.max-result-separator::before,
.max-result-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(191, 149, 63, 0.2), transparent);
}

/* ── Controls (centré, pleine largeur) ── */

.max-calculator-controls {
    position: relative;
    z-index: 1;
    width: 100%;
}

/* ── Carat buttons ── */

.max-calculator-carats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.max-carat-btn {
    width: auto;
    padding: 16px 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(191, 149, 63, 0.1);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-family: inherit;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    box-shadow: none;
    color: inherit;
}

.max-carat-btn::before,
.max-carat-btn::after {
    display: none;
}

.max-carat-btn:hover {
    border-color: rgba(191, 149, 63, 0.35);
    background: rgba(191, 149, 63, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.max-carat-btn.active {
    border-color: rgba(191, 149, 63, 0.5);
    background: rgba(191, 149, 63, 0.1);
    box-shadow: 0 0 20px rgba(191, 149, 63, 0.1), inset 0 0 20px rgba(191, 149, 63, 0.03);
    transform: translateY(-2px);
}

.max-carat-gold {
    font-size: 0.55rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: static;
}

.max-carat-btn.active .max-carat-gold {
    color: var(--max-primary-gold);
}

.max-carat-label {
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-shadow: none;
    position: static;
    transition: color 0.25s ease;
}

.max-carat-btn.active .max-carat-label {
    color: #d4af37;
}

.max-carat-purity {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.25);
    opacity: 1;
    position: static;
}

.max-carat-btn.active .max-carat-purity {
    color: rgba(255, 255, 255, 0.45);
}

.max-carat-price {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 600;
    margin-top: 3px;
    position: static;
    transition: color 0.25s ease;
}

.max-carat-btn.active .max-carat-price {
    color: var(--max-gold-light);
}

/* ── Weight / Slider ── */

.max-calculator-weight {
    position: relative;
    z-index: 1;
    margin-bottom: 0;
}

.max-weight-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 14px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

.max-weight-icon {
    display: none;
}

.max-weight-input-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
}

.max-weight-input {
    width: 75px;
    padding: 8px 10px;
    font-size: 1.15rem;
    font-weight: 700;
    font-family: inherit;
    color: var(--max-gold-light);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(191, 149, 63, 0.2);
    border-radius: 8px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -moz-appearance: textfield;
}

.max-weight-input::-webkit-outer-spin-button,
.max-weight-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.max-weight-input:focus {
    border-color: var(--max-gold-light);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.max-weight-unit {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
}

.max-slider-wrapper {
    position: relative;
    padding: 0;
}

.max-weight-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.max-weight-slider:hover {
    background: rgba(255, 255, 255, 0.1);
}

.max-weight-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37, #BF953F);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.4), 0 0 0 3px rgba(212, 175, 55, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.max-weight-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 2px 14px rgba(212, 175, 55, 0.6), 0 0 0 5px rgba(212, 175, 55, 0.1);
    transform: scale(1.1);
}

.max-weight-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37, #BF953F);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.4), 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.max-weight-slider::-moz-range-thumb:hover {
    box-shadow: 0 2px 14px rgba(212, 175, 55, 0.6), 0 0 0 5px rgba(212, 175, 55, 0.1);
}

/* Track fill (gold gradient) - via JS inline style */
.max-weight-slider::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
}

.max-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.18);
}

/* ── CTA Button ── */

.max-calculator-cta {
    display: none;
    text-align: center;
    margin-top: 24px;
    width: 100%;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.max-calculator-cta.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.max-calculator-cta a,
.max-calculator-cta .epo-telephone-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, rgba(191, 149, 63, 0.15) 0%, rgba(191, 149, 63, 0.05) 100%);
    border: 1px solid rgba(191, 149, 63, 0.35);
    border-radius: 12px;
    text-decoration: none;
    color: #d4af37;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.25s ease;
}

.max-calculator-cta a:hover,
.max-calculator-cta .epo-telephone-link:hover {
    background: linear-gradient(135deg, rgba(191, 149, 63, 0.25) 0%, rgba(191, 149, 63, 0.1) 100%);
    border-color: var(--max-gold-light);
    color: #d4af37;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(191, 149, 63, 0.15);
}

.max-cta-icon {
    font-size: 1.1rem;
}

/* ── Animations ── */

.max-price-value.updating {
    opacity: 0.3;
    transform: scale(0.98);
}

.max-price-value.updated {
    animation: calcCountPulse 0.5s ease-out;
}

@keyframes calcCountPulse {
    0% { opacity: 0.6; transform: scale(0.97); }
    50% { transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

/* Counting animation class */
.max-price-value.counting {
    transition: none;
}

/* ── Themes ── */

.max-calculator-theme-dark {
    background: linear-gradient(170deg, #0a1520 0%, #060e16 100%);
}

.max-calculator-theme-light {
    background: linear-gradient(170deg, #F5F7F9 0%, #eef1f4 100%);
    border-color: rgba(191, 149, 63, 0.2);
}

.max-calculator-theme-light .max-calculator-title {
    color: #1a2332;
}

.max-calculator-theme-light .max-calculator-subtitle {
    color: rgba(0, 0, 0, 0.5);
}

.max-calculator-theme-light .max-calculator-live-badge {
    background: rgba(74, 155, 168, 0.08);
}

.max-calculator-theme-light .max-carat-label {
    color: rgba(0, 0, 0, 0.5);
}

.max-calculator-theme-light .max-carat-btn {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(191, 149, 63, 0.12);
}

.max-calculator-theme-light .max-carat-btn.active {
    background: rgba(191, 149, 63, 0.08);
}

.max-calculator-theme-light .max-carat-btn.active .max-carat-label {
    color: var(--max-primary-gold);
}

.max-calculator-theme-light .max-weight-label {
    color: rgba(0, 0, 0, 0.6);
}

.max-calculator-theme-light .max-weight-input {
    color: var(--max-primary-gold);
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(191, 149, 63, 0.2);
}

.max-calculator-theme-light .max-result-label,
.max-calculator-theme-light .max-detail-item {
    color: rgba(0, 0, 0, 0.5);
}

.max-calculator-theme-light .max-calculator-result {
    background: rgba(191, 149, 63, 0.04);
    border-color: rgba(191, 149, 63, 0.12);
}

.max-calculator-theme-light .max-price-value {
    filter: drop-shadow(0 2px 8px rgba(191, 149, 63, 0.15));
}

/* ── Responsive ── */

@media (max-width: 768px) {
    .max-gold-calculator {
        padding: 28px 20px 24px;
        border-radius: 16px;
    }

    .max-calculator-header {
        text-align: center;
    }

    .max-gold-calculator h2.max-calculator-title {
        font-size: 1.25rem;
    }

    .max-price-value {
        font-size: 2.8rem;
    }

    .max-price-currency {
        font-size: 1.5rem;
    }

    .max-calculator-carats {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }

    .max-carat-btn {
        padding: 12px 4px;
    }

    .max-carat-gold {
        font-size: 0.5rem;
        letter-spacing: 1px;
    }

    .max-carat-label {
        font-size: 1.15rem;
    }

    .max-carat-purity {
        font-size: 0.6rem;
    }

    .max-carat-price {
        font-size: 0.65rem;
    }

    .max-calculator-weight {
        margin-bottom: 20px;
    }

    .max-calculator-result {
        padding: 20px 16px;
        margin-bottom: 20px;
    }

    .max-result-details {
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .max-gold-calculator {
        padding: 22px 14px 20px;
        border-radius: 14px;
    }

    .max-gold-calculator h2.max-calculator-title {
        font-size: 1.1rem;
    }

    .max-calculator-live-badge {
        font-size: 0.6rem;
        padding: 5px 12px;
    }

    .max-calculator-carats {
        grid-template-columns: repeat(5, 1fr);
        gap: 5px;
    }

    .max-carat-btn {
        padding: 10px 2px;
    }

    .max-carat-label {
        font-size: 1rem;
    }

    .max-carat-purity {
        display: none;
    }

    .max-weight-input {
        width: 65px;
        font-size: 1rem;
    }

    .max-price-value {
        font-size: 2.2rem;
    }

    .max-price-currency {
        font-size: 1.2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .max-gold-calculator::before {
        animation: none;
    }

    .max-live-dot {
        animation: none;
    }

    .max-carat-btn,
    .max-weight-input,
    .max-weight-slider::-webkit-slider-thumb {
        transition: none;
    }

    .max-price-value.updated {
        animation: none;
    }

    .max-calculator-cta {
        transition: none;
    }

    .max-carat-btn:hover {
        transform: none;
    }
}
