/**
 * CartRescue Frontend Styles
 * 
 * @package CartRescue
 */

/* WhatsApp Field Styling */
.woocommerce-billing-fields .form-row.woocommerce-billing-fields__field-wrapper p#billing_whatsapp_field {
    position: relative;
}

.woocommerce-billing-fields #billing_whatsapp {
    padding-left: 3rem !important;
}

.woocommerce-billing-fields #billing_whatsapp_field::before {
    content: '📱';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    z-index: 10;
}

/* WhatsApp Opt-in Popup */
.crt-whatsapp-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 350px;
    z-index: 9999;
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.crt-whatsapp-popup-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.crt-whatsapp-popup-icon {
    font-size: 2rem;
    margin-right: 0.75rem;
}

.crt-whatsapp-popup-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.crt-whatsapp-popup-text {
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    opacity: 0.95;
}

.crt-whatsapp-popup-form {
    display: flex;
    gap: 0.5rem;
}

.crt-whatsapp-popup-input {
    flex: 1;
    padding: 0.625rem 0.875rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    outline: none;
    transition: all 0.3s ease;
}

.crt-whatsapp-popup-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.crt-whatsapp-popup-input:focus {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.crt-whatsapp-popup-submit {
    padding: 0.625rem 1.25rem;
    background: white;
    color: #25D366;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.crt-whatsapp-popup-submit:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.crt-whatsapp-popup-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    line-height: 1;
    padding: 0.25rem;
}

.crt-whatsapp-popup-close:hover {
    opacity: 1;
}

/* Recovery Notice Banner */
.crt-recovery-notice {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    text-align: center;
    margin-bottom: 2rem;
    border-radius: 8px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.crt-recovery-notice h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.crt-recovery-notice p {
    margin: 0 0 1rem 0;
    opacity: 0.9;
}

.crt-recovery-notice-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: white;
    color: #667eea;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.crt-recovery-notice-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #667eea;
}

/* WhatsApp Floating Button */
.crt-whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    cursor: pointer;
    z-index: 9998;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.6);
    }
    100% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
}

.crt-whatsapp-float:hover {
    transform: scale(1.1);
}

.crt-whatsapp-float svg {
    width: 32px;
    height: 32px;
    fill: white;
}

/* Loading Spinner */
.crt-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success Message */
.crt-success-message {
    padding: 1rem;
    background: #d1fae5;
    border-left: 4px solid #10b981;
    border-radius: 4px;
    color: #065f46;
    margin: 1rem 0;
    animation: fadeIn 0.5s ease-out;
}

/* Error Message */
.crt-error-message {
    padding: 1rem;
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    border-radius: 4px;
    color: #991b1b;
    margin: 1rem 0;
    animation: fadeIn 0.5s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .crt-whatsapp-popup {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .crt-whatsapp-popup-form {
        flex-direction: column;
    }
    
    .crt-whatsapp-float {
        width: 50px;
        height: 50px;
    }
    
    .crt-whatsapp-float svg {
        width: 28px;
        height: 28px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .crt-recovery-notice {
        background: linear-gradient(135deg, #4c1d95 0%, #5b21b6 100%);
    }
}

/* Print Styles */
@media print {
    .crt-whatsapp-popup,
    .crt-whatsapp-float {
        display: none !important;
    }
}

/* Accessibility */
.crt-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Styles */
.crt-whatsapp-popup-input:focus,
.crt-whatsapp-popup-submit:focus,
.crt-whatsapp-popup-close:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

