/* ==========================================================================
   Contact Store / Reserve Store Modal
   Two screens: form (default) + success
   ========================================================================== */

#contactStoreModal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 16px;
}

#contactStoreModal.is-open {
    display: flex;
}

/* Card */
#contactStoreModal .csm-card {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 32px);
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    animation: csmIn 0.22s ease-out;
}

@keyframes csmIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close button – absolute top-right */
#contactStoreModal .csm-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    color: #526572;
    transition: background 0.15s, color 0.15s;
}

#contactStoreModal .csm-close:hover {
    background: #F4F4F4;
    color: #1C1C1C;
}

#contactStoreModal .csm-body {
    padding: 42px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
    #contactStoreModal .csm-body {
        padding: 26px;
    }
}

#contactStoreModal .csm-screen {
    display: none;
}

#contactStoreModal .csm-screen.is-active {
    display: block;
}

#contactStoreModal .csm-title {
    font-size: 26px;
    line-height: 1.25;
    font-weight: 700;
    color: #263238;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    #contactStoreModal .csm-title {
        font-size: 24px;
    }
}

#contactStoreModal .csm-subtitle {
    font-size: 16px;
    line-height: 1.55;
    color: #5A6873;
    margin-bottom: 28px;
}

/* Store summary (in form screen) – optional hint / dealer info */
#contactStoreModal .csm-store-summary {
    margin-bottom: 24px;
    padding: 14px 16px;
    border: 1px solid #CDD2D9;
    border-radius: 8px;
    background: #ffffff;
    font-size: 13px;
    color: #1C1C1C;
    line-height: 1.5;
}

#contactStoreModal .csm-store-summary.is-hint {
    border-color: #BE930B;
    background: #FFF9E6;
    color: #1C1C1C;
}

#contactStoreModal .csm-store-summary .csm-store-name {
    font-weight: 600;
    color: #1C1C1C;
    margin-bottom: 2px;
}

#contactStoreModal .csm-store-summary .csm-store-addr,
#contactStoreModal .csm-store-summary .csm-store-phone {
    color: #526572;
}

#contactStoreModal .csm-store-summary .csm-store-distance {
    color: #BE930B;
    margin-top: 2px;
}

#contactStoreModal .csm-field {
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    #contactStoreModal .csm-field {
        margin-bottom: 18px;
    }
}

#contactStoreModal .csm-field-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #46545E;
    line-height: 1.5;
    margin-bottom: 10px;
}

#contactStoreModal .csm-input {
    width: 100%;
    box-sizing: border-box;
    height: 49px;
    padding: 0 12px;
    font-size: 14px;
    color: #46545E;
    background: #ffffff;
    border: 1px solid #BCC8D0;
    border-radius: 4px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

#contactStoreModal .csm-input::placeholder {
    color: #8A94A6;
}

#contactStoreModal .csm-input:focus {
    outline: none;
    border-color: #BE930B;
}

#contactStoreModal .csm-input.has-error {
    border-color: #E5484D;
}

#contactStoreModal .csm-field-error {
    display: none;
    font-size: 12px;
    color: #E5484D;
    margin-top: 4px;
}

#contactStoreModal .csm-field-error.is-show {
    display: block;
}

/* 2-column row (first / last name) */
#contactStoreModal .csm-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 480px) {
    #contactStoreModal .csm-row-2 {
        grid-template-columns: 1fr;
    }
}

/* Verification code row */
#contactStoreModal .csm-code-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

#contactStoreModal .csm-code-row .csm-input {
    flex: 1;
}

#contactStoreModal .csm-send-code-btn {
    flex: 0 0 auto;
    padding: 0 14px;
    height: 49px;
    border: 1px solid #AEBBC3;
    border-radius: 4px;
    background: #ffffff;
    color: #1C1C1C;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

#contactStoreModal .csm-send-code-btn:hover:not(:disabled) {
    background: #F4F4F4;
    border-color: #BE930B;
}

#contactStoreModal .csm-send-code-btn:disabled {
    color: #8A94A6;
    cursor: not-allowed;
}

/* Toast area */
#contactStoreModal .csm-toast {
    display: none;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
}

#contactStoreModal .csm-toast.is-show {
    display: block;
}

#contactStoreModal .csm-toast.toast-error {
    background: #FDECEC;
    color: #B42318;
}

#contactStoreModal .csm-toast.toast-success {
    background: #EBF5EC;
    color: #1E7D32;
}

#contactStoreModal .csm-toast.toast-info {
    background: #F2F4F7;
    color: #38495A;
}

/* Submit button */
#contactStoreModal .csm-submit {
    width: 100%;
    height: 49px;
    border: none;
    border-radius: 4px;
    background: #C3A317;
    color: #102A3E;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

#contactStoreModal .csm-submit:hover:not(:disabled) {
    background: #97740B;
}

#contactStoreModal .csm-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* -------------------- Success screen -------------------- */
#contactStoreModal .csm-success {
    text-align: center;
}

#contactStoreModal .csm-success-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 26px;
    border-radius: 50%;
    background: #FAF4DF;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #957308;
}

#contactStoreModal .csm-success-title {
    font-size: 26px;
    font-weight: 700;
    color: #263238;
    line-height: 1.25;
    margin-bottom: 20px;
    text-align: left;
}

#contactStoreModal .csm-success-sub {
    font-size: 16px;
    color: #5A6873;
    line-height: 1.55;
    margin-bottom: 28px;
    text-align: left;
}

#contactStoreModal .csm-success-store {
    text-align: left;
    padding: 24px;
    border: 1px solid #D6DFE4;
    border-radius: 4px;
    background: #F8FAFB;
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.6;
    color: #526572;
}

#contactStoreModal .csm-success-store strong {
    font-weight: 700;
}

#contactStoreModal .csm-close-cta {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 4px;
    background: #1C1C1C;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

#contactStoreModal .csm-close-cta:hover {
    background: #333333;
}