/**
 * EComplex Theme — css/abandoned-carts.css
 *
 * Styles for the Exit Intent Abandoned Cart modal popup.
 * Integrates with EComplex design tokens.
 */

:root {
    --ec-modal-zindex: 999999;
}

/* Modal Overlay */
.ec-abandoned-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(43, 44, 42, 0.6); /* --color-dark with transparency */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: var(--ec-modal-zindex);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ec-abandoned-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* Modal Box */
.ec-abandoned-modal {
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 480px;
    padding: 35px 30px;
    position: relative;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    border: 1px solid rgba(161, 162, 162, 0.2);
}

.ec-abandoned-modal-overlay.is-open .ec-abandoned-modal {
    transform: translateY(0);
}

/* Close Button */
.ec-abandoned-modal__close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #A1A2A2;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s ease;
}

.ec-abandoned-modal__close:hover {
    color: #BF3D32;
}

/* Modal Content styling */
.ec-abandoned-modal__title {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #2B2C2A;
    margin-top: 0;
    margin-bottom: 12px;
    line-height: 1.3;
}

.ec-abandoned-modal__desc {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 25px;
}

/* Form inputs */
.ec-abandoned-modal__form-group {
    margin-bottom: 15px;
}

.ec-abandoned-modal__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #2B2C2A;
    margin-bottom: 6px;
}

.ec-abandoned-modal__input {
    width: 100%;
    padding: 12px 15px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    border: 1px solid #A1A2A2;
    border-radius: 4px;
    box-sizing: border-box;
    color: #2B2C2A;
    background-color: #FFFFFF;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ec-abandoned-modal__input:focus {
    outline: none;
    border-color: #BF3D32;
    box-shadow: 0 0 0 3px rgba(191, 61, 50, 0.1);
}

.ec-abandoned-modal__error {
    color: #BF3D32;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

/* Submit CTA */
.ec-abandoned-modal__submit {
    width: 100%;
    background-color: #BF3D32; /* --color-red */
    color: #FFFFFF;
    border: none;
    border-radius: 4px;
    padding: 14px;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    margin-top: 10px;
}

.ec-abandoned-modal__submit:hover {
    background-color: #A33127;
}

.ec-abandoned-modal__submit:active {
    transform: scale(0.98);
}

.ec-abandoned-modal__submit:disabled {
    background-color: #A1A2A2;
    cursor: not-allowed;
}

/* Success View */
.ec-abandoned-modal__success {
    display: none;
    text-align: center;
    padding: 10px 0;
}

.ec-abandoned-modal__coupon-box {
    margin: 20px 0;
    padding: 15px;
    border: 2px dashed #BF3D32;
    background-color: #F6F6F6;
    border-radius: 6px;
}

.ec-abandoned-modal__coupon-title {
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.ec-abandoned-modal__coupon-code {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #BF3D32;
    letter-spacing: 1px;
}

.ec-abandoned-modal__footer-note {
    font-size: 11px;
    color: #A1A2A2;
    margin-top: 15px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .ec-abandoned-modal {
        padding: 25px 20px;
        width: 95%;
    }
    
    .ec-abandoned-modal__title {
        font-size: 19px;
    }
}

/* CRM Profile styles */
.crm-profile-wrap {
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,sans-serif;
    margin-top: 20px;
    padding-right: 20px;
}

.crm-header {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    border-left: 4px solid #BF3D32;
}

.crm-header h1 {
    margin: 0 0 5px 0;
    font-size: 26px;
    font-weight: 700;
    color: #2c3e50;
}

.crm-meta {
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 10px;
}

.crm-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.crm-badge-registered {
    background: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.crm-badge-guest {
    background: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

.crm-badge-info {
    background: #d9edf7;
    color: #31708f;
    border: 1px solid #bce8f1;
}

.crm-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.crm-kpi-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
}

.crm-kpi-title {
    font-size: 12px;
    text-transform: uppercase;
    color: #7f8c8d;
    font-weight: 600;
    margin-bottom: 8px;
}

.crm-kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 6px;
}

.crm-kpi-desc {
    font-size: 12px;
    color: #95a5a6;
}

.crm-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

@media (max-width: 900px) {
    .crm-main-grid {
        grid-template-columns: 1fr;
    }
}

.crm-panel {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    border: 1px solid rgba(0,0,0,0.05);
}

.crm-panel-title {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.crm-details-list > div {
    margin-bottom: 12px;
    font-size: 14px;
    color: #333;
}

.crm-details-list strong {
    color: #2c3e50;
}

.crm-pref-row {
    font-size: 14px;
}

.crm-pref-tag {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    color: #495057;
    font-weight: 600;
}

/* Responsive Table Wrapper */
.crm-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 15px;
    border-radius: 4px;
    border: 1px solid #ccd0d4;
    background: #fff;
}
.crm-table-wrapper table {
    margin: 0 !important;
    min-width: 850px;
    border: none !important;
}
