/* WooCommerce Email Coupons - Estilos CSS */

.wc-email-coupons-wrapper {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.wc-email-coupons-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.wc-email-coupons-description {
    margin-bottom: 20px;
}

.wc-email-coupons-description p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
}

/* Formulario de email */
.wc-email-coupons-form {
    margin-bottom: 20px;
}

.wc-email-input-wrapper {
    margin-bottom: 15px;
}

.wc-email-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.wc-email-input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.wc-email-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.wc-email-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.wc-search-coupons-button {
    padding: 12px 24px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 140px;
}

.wc-search-coupons-button:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.wc-search-coupons-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Spinner de carga */
.wc-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: wc-spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes wc-spin {
    to { transform: rotate(360deg); }
}

/* Mensajes */
.wc-coupons-messages {
    margin: 15px 0;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.wc-coupons-messages.wc-message-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.wc-coupons-messages.wc-message-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.wc-coupons-messages.wc-message-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Resultados de cupones */
.wc-coupons-results {
    margin-top: 20px;
}

.wc-coupons-results-title {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.wc-coupons-list {
    display: grid;
    gap: 15px;
}

/* Cupón individual */
.wc-coupon-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.wc-coupon-item:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
    transform: translateY(-2px);
}

.wc-coupon-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #3498db;
}

.wc-coupon-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.wc-coupon-code {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    background: #ecf0f1;
    padding: 4px 8px;
    border-radius: 4px;
}

.wc-coupon-discount {
    background: #27ae60;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.wc-coupon-description {
    margin: 0 0 10px 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.4;
}

.wc-coupon-conditions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.wc-coupon-minimum,
.wc-coupon-expires {
    font-size: 12px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.wc-coupon-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wc-apply-coupon-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.wc-apply-coupon-btn:hover:not(:disabled) {
    background: #229954;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

.wc-apply-coupon-btn.wc-btn-disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.wc-not-applicable-reason {
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
}

/* Cupones aplicados */
.wc-applied-coupons {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.wc-applied-coupons-title {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.wc-applied-coupons-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wc-applied-coupon-item {
    background: #27ae60;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.wc-applied-coupon-code {
    font-family: 'Courier New', monospace;
}

.wc-remove-coupon-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.3s ease;
}

.wc-remove-coupon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .wc-email-input-group {
        flex-direction: column;
    }
    
    .wc-search-coupons-button {
        width: 100%;
    }
    
    .wc-coupon-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .wc-coupon-conditions {
        flex-direction: column;
        gap: 5px;
    }
    
    .wc-applied-coupons-list {
        flex-direction: column;
    }
}

/* Estados de carga */
.wc-loading .wc-btn-text {
    display: none;
}

.wc-loading .wc-btn-loading {
    display: inline-flex !important;
    align-items: center;
}

/* Animaciones */
.wc-coupon-item {
    animation: wc-fadeInUp 0.5s ease-out;
}

@keyframes wc-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wc-applied-coupon-item {
    animation: wc-slideIn 0.3s ease-out;
}

@keyframes wc-slideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* Estilos adicionales para validaciones y UX mejorada */

/* Tooltips */
.wc-tooltip {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    animation: wc-fadeIn 0.3s ease-out forwards;
}

.wc-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
}

.wc-tooltip-error {
    background: #e74c3c;
}

.wc-tooltip-success {
    background: #27ae60;
}

.wc-tooltip-warning {
    background: #f39c12;
}

/* Animaciones */
.wc-animate-bounce {
    animation: wc-bounce 0.6s ease-in-out;
}

.wc-animate-shake {
    animation: wc-shake 0.6s ease-in-out;
}

.wc-animate-pulse {
    animation: wc-pulse 1s ease-in-out infinite;
}

@keyframes wc-bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -10px, 0);
    }
    70% {
        transform: translate3d(0, -5px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

@keyframes wc-shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@keyframes wc-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Modal de confirmación */
.wc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: wc-fadeIn 0.3s ease-out;
}

.wc-modal {
    background: white;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: wc-slideInUp 0.3s ease-out;
}

.wc-modal-header {
    padding: 20px 20px 0 20px;
    border-bottom: 1px solid #e9ecef;
}

.wc-modal-header h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
}

.wc-modal-body {
    padding: 20px;
}

.wc-modal-body p {
    margin: 0;
    color: #6c757d;
    line-height: 1.5;
}

.wc-modal-footer {
    padding: 0 20px 20px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.wc-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wc-btn-primary {
    background: #3498db;
    color: white;
}

.wc-btn-primary:hover {
    background: #2980b9;
}

.wc-btn-secondary {
    background: #95a5a6;
    color: white;
}

.wc-btn-secondary:hover {
    background: #7f8c8d;
}

@keyframes wc-slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estados de validación para inputs */
.wc-email-input.wc-input-valid {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.wc-email-input.wc-input-invalid {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Indicador de carga mejorado */
.wc-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;
}

.wc-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: wc-spin 1s linear infinite;
}

/* Mejoras para accesibilidad */
.wc-email-coupons-wrapper:focus-within {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.wc-apply-coupon-btn:focus,
.wc-search-coupons-button:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Estados hover mejorados */
.wc-coupon-item:hover .wc-coupon-code {
    background: #3498db;
    color: white;
    transform: scale(1.05);
}

.wc-coupon-item:hover .wc-coupon-discount {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

/* Indicadores de estado */
.wc-coupon-status {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #27ae60;
}

.wc-coupon-status.wc-status-expired {
    background: #e74c3c;
}

.wc-coupon-status.wc-status-limited {
    background: #f39c12;
}

/* Transiciones suaves para todos los elementos */
* {
    transition: all 0.3s ease;
}

/* Mejoras para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
    .wc-apply-coupon-btn,
    .wc-search-coupons-button {
        min-height: 44px;
        font-size: 16px;
    }
    
    .wc-email-input {
        min-height: 44px;
        font-size: 16px;
    }
}


/* Estilos adicionales para botones aplicados y removidos */

.wc-btn-applied {
    background: #27ae60 !important;
    color: white !important;
    cursor: default !important;
}

.wc-btn-applied:hover {
    background: #27ae60 !important;
    transform: none !important;
    box-shadow: none !important;
}

.wc-remove-coupon-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.wc-remove-coupon-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

/* Mejoras para la visualización automática */
.wc-email-coupons-wrapper {
    animation: wc-slideInDown 0.5s ease-out;
}

@keyframes wc-slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Indicador visual para cupones aplicados */
.wc-coupon-item[data-applied="true"] {
    border-left-color: #27ae60;
    background: #f8fff8;
}

.wc-coupon-item[data-applied="true"]::before {
    background: #27ae60;
}

/* Estilos para cuando no hay cupones */
.wc-no-coupons-message {
    text-align: center;
    padding: 30px 20px;
    color: #6c757d;
    font-style: italic;
}

.wc-no-coupons-message::before {
    content: "🎫";
    display: block;
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}


/* Estilos adicionales para formularios sin AJAX */

.wc-apply-coupon-form,
.wc-remove-coupon-form {
    display: inline-block;
    margin: 0 5px;
}

.wc-apply-coupon-btn,
.wc-remove-coupon-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.wc-apply-coupon-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.wc-remove-coupon-btn {
    background: #e74c3c;
    font-size: 12px;
    padding: 8px 16px;
}

.wc-remove-coupon-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.wc-btn-disabled {
    background: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.wc-coupon-applied-badge {
    background: #27ae60;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    margin-right: 10px;
}

.wc-not-applicable-reason {
    display: block;
    color: #666;
    font-style: italic;
    margin-top: 5px;
    font-size: 12px;
}

/* Mejoras para la experiencia sin JavaScript */
.wc-coupon-item {
    border-left: 4px solid #ddd;
    transition: border-color 0.3s ease;
}

.wc-coupon-item:hover {
    border-left-color: #0073aa;
}

/* Indicadores visuales para cupones aplicados */
.wc-coupon-item[data-applied="true"] {
    border-left-color: #27ae60;
    background: #f8fff8;
}

/* Animaciones suaves para transiciones */
.wc-email-coupons-wrapper {
    animation: wc-fadeIn 0.5s ease-out;
}

@keyframes wc-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos para mensajes de WooCommerce */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
    margin: 15px 0;
    padding: 15px;
    border-radius: 4px;
}

.woocommerce-message {
    background: #f0f8ff;
    border-left: 4px solid #0073aa;
    color: #0073aa;
}

.woocommerce-error {
    background: #fff5f5;
    border-left: 4px solid #e74c3c;
    color: #e74c3c;
}

.woocommerce-info {
    background: #fffbf0;
    border-left: 4px solid #f39c12;
    color: #f39c12;
}

