/* ==========================================================================
   Email Capture Popup Styles (Modern Redesign V2)
   ========================================================================== */

/* --- The Modal Backdrop --- */
.csp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 24, 39, 0.6); /* Darker, modern backdrop */
    z-index: 100000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.csp-popup-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

/* --- The Modal Container --- */
.csp-popup-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: #ffffff;
    padding: 32px 40px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 450px;
    text-align: center;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.csp-popup-overlay.is-visible .csp-popup-container {
    transform: translateY(0) scale(1);
}

/* --- Icon --- */
.csp-popup-icon {
    margin: 0 auto 16px;
    height: 64px;
    width: 64px;
    border-radius: 50%;
    background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}
.csp-popup-icon-svg {
    width: 32px;
    height: 32px;
}

/* --- Close Button --- */
.csp-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s, transform 0.2s;
}
.csp-popup-close:hover {
    color: #1f2937;
    transform: rotate(90deg);
}

/* --- Content Styling --- */
.csp-popup-content {
    margin-bottom: 24px;
}
.csp-popup-heading {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px;
}

.csp-popup-text {
    font-size: 16px;
    color: #4b5563;
    margin: 0;
    line-height: 1.6;
}

/* --- Form Elements --- */
.csp-popup-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.csp-input-wrapper {
    width: 100%;
}
.csp-popup-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.csp-popup-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
/* Validation Error Style */
.csp-popup-input.has-error {
    border-color: #ef4444;
}
.csp-popup-input.has-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}
.csp-popup-error-msg {
    display: none;
    font-size: 14px;
    color: #ef4444;
    text-align: left;
    margin-top: 6px;
}

/* --- Main CTA Button --- */
.csp-popup-submit {
    position: relative;
    display: inline-block;
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    background-color: #6366f1; /* Primary brand color */
    color: #ffffff;
    border: none;
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.csp-popup-submit:hover:not(:disabled) {
    background-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.1);
}
.csp-popup-submit:disabled {
    background-color: #a5b4fc;
    cursor: wait;
}

/* --- Skip/No Thanks Link --- */
.csp-popup-skip {
    margin-top: 16px;
    background: none;
    border: none;
    color: #6b7280;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}
.csp-popup-skip:hover {
    color: #111827;
}


/* ==========================================================================
   Modern Button Loading State
   ========================================================================== */
.csp-popup-submit.is-loading .csp-button-text {
    visibility: hidden;
}
.csp-button-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    animation: csp-spin 0.8s linear infinite;
    display: none;
}
.is-loading .csp-button-spinner {
    display: block;
}
@keyframes csp-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   In-Cart Notice Styles (Unchanged)
   ========================================================================== */
.csp-cart-capture-box { padding: 20px; background-color: #f7fafc; border: 1px solid #e2e8f0; border-radius: 5px; margin-top: 20px; }
.csp-cart-capture-box h3 { margin-top: 0; }
#csp-cart-capture-form { display: flex; gap: 10px; }
#csp-cart-capture-form .csp-cart-input { flex-grow: 1; }
.csp-capture-success { color: #2f855a; background-color: #f0fff4; border-left: 4px solid #48bb78; padding: 1em; font-weight: 500; }

.error {
    border-color: #ff4444 !important;
}

.error-message {
    color: #ff4444;
    font-size: 0.85em;
    margin-top: 5px;
    display: none;
}


/* ==========================================================================
   NEW: Member "Add to Cart" Notice Styles
   ========================================================================== */
.csp-member-notice {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100001;
    background-color: #111827; /* Dark background */
    color: #f9fafb; /* Light text */
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    width: 90%;
    max-width: 380px;
    transform: translateX(calc(100% + 20px));
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.csp-member-notice.is-visible {
    transform: translateX(0);
}

.csp-notice-icon {
    flex-shrink: 0;
    color: #34d399; /* Green checkmark */
    width: 24px;
    height: 24px;
}

.csp-notice-content {
    flex-grow: 1;
}

.csp-notice-content p {
    margin: 0 0 4px;
    padding: 0;
    font-size: 15px;
    line-height: 1.4;
}

.csp-notice-content strong {
    color: #ffffff;
    font-weight: 600;
}

.csp-notice-link {
    color: #93c5fd; /* Light blue link */
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}
.csp-notice-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.csp-notice-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s;
}
.csp-notice-close:hover {
    color: #ffffff;
}