/**
 * AC Stock Alerts Frontend Styles
 * Usa estilos nativos del tema y WooCommerce
 */

/* Stock Alert Form - Limpia y compatible con el tema */
.ac-waitlist-form {
    background: var(--wp--preset--color--background, #ffffff);
    border: 1px solid var(--wp--preset--color--border, #e0e0e0);
    border-radius: var(--wp--custom--border-radius, 8px);
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ac-waitlist-form.ac-minimal-style {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 15px 0;
}

.ac-waitlist-message {
    margin: 0 0 20px 0;
    padding: 12px 16px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    color: #856404;
    font-weight: 500;
}

.ac-waitlist-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

/* Campos usando clases nativas de WooCommerce */
.ac-name-input.input-text,
.ac-email-input.input-text,
.ac-whatsapp-input.input-text {
    /* WooCommerce se encarga de los estilos base */
    width: 100% !important;
    box-sizing: border-box;
}

/* Botón usando clases nativas de WooCommerce (igual al botón añadir al carrito) */
.ac-notify-button.single_add_to_cart_button {
    /* WooCommerce y el tema se encargan de los estilos */
    width: 100% !important;
    margin: 0 !important;
    text-align: center;
    display: block;
}

/* Mensajes de éxito/error */
.ac-success {
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 12px 16px;
    margin: 15px 0;
    font-weight: 500;
}

.ac-error {
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 12px 16px;
    margin: 15px 0;
    font-weight: 500;
}

/* Privacy Notice */
.ac-privacy-notice {
    font-size: 0.875rem;
    color: var(--wp--preset--color--foreground-alt, #666);
    line-height: 1.4;
    margin-top: 15px;
    display: block;
}

.ac-privacy-notice a {
    color: var(--wp--preset--color--primary, #0073aa);
    text-decoration: none;
}

.ac-privacy-notice a:hover {
    text-decoration: underline;
}

/* Variation Form Specific */
.ac-variation-form {
    margin-top: 20px;
    border-color: var(--wp--preset--color--accent, #ff9800);
    background: var(--wp--preset--color--background-alt, #fff8e1);
}

.ac-variation-form .ac-waitlist-message {
    background: #fff8e1;
    border-color: #ffc107;
    color: #856404;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ac-waitlist-form {
        padding: 15px;
        margin: 15px 0;
    }
    
    .ac-waitlist-inputs {
        gap: 12px;
    }
    
    .ac-waitlist-message {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

/* Asegurar que se vea bien en temas oscuros */
@media (prefers-color-scheme: dark) {
    .ac-waitlist-form {
        background: var(--wp--preset--color--background, #1a1a1a);
        border-color: var(--wp--preset--color--border, #333);
        color: var(--wp--preset--color--foreground, #fff);
    }
    
    .ac-waitlist-message {
        background: rgba(255, 243, 205, 0.1);
        border-color: rgba(255, 234, 167, 0.3);
        color: var(--wp--preset--color--foreground, #fff);
    }
}

/* Animation for messages */
.ac-success, .ac-error {
    animation: acFadeIn 0.3s ease-in-out;
}

@keyframes acFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading state */
.ac-waitlist-form.ac-loading .input-text {
    opacity: 0.6;
    pointer-events: none;
}

.ac-waitlist-form.ac-loading .ac-notify-button {
    opacity: 0.7;
    cursor: wait;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .ac-success,
    .ac-error {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ac-waitlist-form {
        border: 2px solid;
    }
    
    .ac-waitlist-message,
    .ac-success,
    .ac-error {
        border-width: 2px;
    }
/* Removed invalid selector and block */
    
        .ac-waitlist-form {
            padding: 15px;
            margin: 10px 0;
        }
    }


@media (max-width: 480px) {
    .ac-waitlist-form {
        border-radius: 6px;
        padding: 12px;
    }
    
    .ac-waitlist-message {
        font-size: 14px;
    }
    
    .ac-privacy-notice {
        font-size: 11px;
    }
}

/* Loading State */
.ac-waitlist-form.ac-loading .ac-email-input {
    opacity: 0.6;
}

.ac-waitlist-form.ac-loading .ac-notify-button {
    background: #666;
    cursor: wait;
}

/* Animation for messages */
.ac-success, .ac-error {
    animation: acFadeIn 0.3s ease-in-out;
}

@keyframes acFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RTL Support */
[dir="rtl"] .ac-waitlist-inputs {
    direction: rtl;
}

[dir="rtl"] .ac-email-input {
    text-align: right;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .ac-waitlist-form {
        border: 2px solid #000;
        background: #fff;
    }
    
    .ac-notify-button {
        border: 2px solid #000;
    }
    
    .ac-email-input {
        border: 2px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .ac-notify-button,
    .ac-email-input,
    .ac-success,
    .ac-error {
        transition: none;
        animation: none;
    }
}