/* ========================================
   CALCULATEUR DE VALEUR D'OR — v2
   Design: Premium minimal, two-column layout
   ======================================== */

/* ── Container ── */

.max-gold-calculator {
    margin: 2rem 0;
    padding: 32px;
    font-family: var(--max-font-primary);
    border-radius: 16px;
    background: linear-gradient(180deg, var(--max-bg-medium) 0%, var(--max-bg-dark) 100%);
    border: 1px solid rgba(191, 149, 63, 0.2);
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 0 28px;
}

.max-gold-calculator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--max-gold-gradient);
    z-index: 1;
}

.max-gold-calculator::after {
    display: none;
}

.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;
}

/* ── Header (spans both columns) ── */

.max-calculator-header {
    grid-column: 1 / -1;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.max-gold-calculator h2.max-calculator-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
    text-transform: none;
    text-shadow: none;
    letter-spacing: 0;
    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;
}

/* ── Controls (left column) ── */

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

/* Carat buttons */

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

.max-carat-btn {
    width: auto;
    padding: 14px 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(191, 149, 63, 0.12);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-family: inherit;
    transition: border-color 0.2s ease, background 0.2s 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(255, 255, 255, 0.06);
    transform: none;
    box-shadow: none;
}

.max-carat-btn.active {
    border-color: rgba(191, 149, 63, 0.5);
    background: rgba(191, 149, 63, 0.08);
    box-shadow: none;
    transform: none;
}

.max-carat-gold {
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.25);
    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.4rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    text-shadow: none;
    position: static;
}

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

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

.max-carat-price {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
    margin-top: 2px;
    position: static;
}

.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: 12px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.55);
}

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

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

.max-weight-input {
    width: 70px;
    padding: 6px 8px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    color: var(--max-gold-light);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(191, 149, 63, 0.2);
    border-radius: 6px;
    text-align: center;
    outline: none;
    transition: border-color 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);
}

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

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

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

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

.max-weight-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--max-gold-light);
    cursor: pointer;
    box-shadow: 0 1px 6px rgba(212, 175, 55, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.25);
    transition: box-shadow 0.2s ease;
}

.max-weight-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.6);
}

.max-weight-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--max-gold-light);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 1px 6px rgba(212, 175, 55, 0.4);
}

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

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

/* ── Result (right column) ── */

.max-calculator-result {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
    background: rgba(191, 149, 63, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(191, 149, 63, 0.12);
    position: relative;
    z-index: 1;
    overflow: hidden;
    min-height: 180px;
}

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

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

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

.max-price-value {
    font-size: 2.4rem;
    font-weight: 700;
    color: #d4af37;
    text-shadow: none;
    line-height: 1;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.max-price-currency {
    font-size: 1.4rem;
    color: #d4af37;
    font-weight: 600;
}

.max-result-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 0;
}

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

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

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

/* ── CTA Button ── */

.max-calculator-cta {
    display: none;
    text-align: center;
    margin-top: 12px;
}

.max-calculator-cta.visible {
    display: block;
}

.max-calculator-cta a,
.max-calculator-cta .epo-telephone-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(191, 149, 63, 0.35);
    border-radius: 8px;
    text-decoration: none;
    color: #d4af37;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.max-calculator-cta a:hover,
.max-calculator-cta .epo-telephone-link:hover {
    background: rgba(191, 149, 63, 0.1);
    border-color: var(--max-gold-light);
    color: #d4af37;
}

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

/* ── Animations (subtle) ── */

.max-price-value.updating {
    opacity: 0.4;
}

.max-price-value.updated {
    animation: calcPulse 0.4s ease-out;
}

@keyframes calcPulse {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* ── Themes ── */

.max-calculator-theme-dark {
    background: rgba(13, 26, 38, 0.5);
}

.max-calculator-theme-light {
    background: rgba(245, 247, 249, 0.95);
    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-carat-label {
    color: rgba(0, 0, 0, 0.6);
}

.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.05);
    border-color: rgba(191, 149, 63, 0.15);
}

/* ── Responsive ── */

@media (max-width: 768px) {
    .max-gold-calculator {
        grid-template-columns: 1fr;
        padding: 24px 20px;
        gap: 0;
    }

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

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

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

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

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

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

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

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

    .max-calculator-result {
        min-height: auto;
        padding: 20px 16px;
    }

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

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

@media (max-width: 480px) {
    .max-gold-calculator {
        padding: 20px 14px;
        margin: 1rem 0;
    }

    .max-calculator-title {
        font-size: 1.15rem;
    }

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

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

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

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

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

@media (prefers-reduced-motion: reduce) {
    .max-carat-btn,
    .max-weight-input,
    .max-weight-slider::-webkit-slider-thumb {
        transition: none;
    }

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