/**
 * Estilos para integración con WooCommerce
 * Botones de "Agregar a mi Lista de Boda" en páginas de productos
 */

/* === Wrapper del botón === */
.swr-add-to-wishlist-wrapper {
    margin-top: 15px;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    clear: both;
    position: relative;
    z-index: 10;
}

.swr-add-to-wishlist-wrapper::after {
    content: "";
    display: table;
    clear: both;
}

/* Eliminar espacios extra en páginas de productos */
.woocommerce .swr-add-to-wishlist-wrapper {
    margin-bottom: 0 !important;
}

.woocommerce-page .swr-add-to-wishlist-wrapper {
    margin-bottom: 0 !important;
}

/* Eliminar espacios del contenedor de productos */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    margin-bottom: 20px !important;
}

.woocommerce ul.products,
.woocommerce-page ul.products {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Ajustar el contenedor principal de WooCommerce */
.woocommerce,
.woocommerce-page {
    margin-bottom: 0 !important;
}

/* Eliminar padding/margin extra del contenedor de productos */
.woocommerce .products,
.woocommerce-page .products {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Ajustar sección completa */
.woocommerce-products-header,
.woocommerce-result-count,
.woocommerce-ordering {
    margin-bottom: 20px !important;
}

/* === Botón principal (página de producto individual) === */
.swr-add-to-wishlist-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    color: #003b71;
    border: 2px solid #003b71;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.swr-add-to-wishlist-btn:hover:not(:disabled) {
    background: #003b71;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 59, 113, 0.2);
}

.swr-add-to-wishlist-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Estado "ya está en la lista" */
.swr-add-to-wishlist-btn.in-wishlist {
    background: #28a745;
    color: white;
    border-color: #28a745;
    cursor: default;
}

.swr-add-to-wishlist-btn.in-wishlist:hover {
    background: #28a745;
    color: white;
    transform: none;
}

/* === Botón para loop de productos === */
.swr-add-to-wishlist-btn-loop {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: white;
    color: #003b71;
    border: 2px solid #003b71;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
}

.swr-add-to-wishlist-btn-loop:hover:not(:disabled) {
    background: #003b71;
    color: white;
}

.swr-add-to-wishlist-btn-loop:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.swr-add-to-wishlist-btn-loop.in-wishlist {
    background: #28a745;
    color: white;
    border-color: #28a745;
    cursor: default;
}

.swr-add-to-wishlist-btn-loop.in-wishlist:hover {
    background: #28a745;
    color: white;
}

/* === Icono de corazón === */
.swr-wishlist-icon {
    font-size: 1.2em;
    line-height: 1;
}

/* === CTA para crear lista de boda === */
.swr-create-wedding-cta {
    margin-top: 20px;
    margin-bottom: 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 2px dashed #003b71;
    text-align: center;
    clear: both;
}

.swr-cta-text {
    margin: 0 0 15px 0;
    color: #003b71;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.swr-create-wedding-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #003b71;
    color: white;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.swr-create-wedding-btn:hover {
    background: #00509e;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 59, 113, 0.3);
    color: white;
    text-decoration: none;
}

/* === Notificaciones === */
.swr-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    min-width: 300px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    cursor: pointer;
}

.swr-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.swr-notification.success {
    border-left: 4px solid #28a745;
    color: #155724;
}

.swr-notification.error {
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.swr-notification-link {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: #003b71;
    color: white;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.swr-notification-link:hover {
    background: #00509e;
    color: white;
    text-decoration: none;
}

/* === Responsive === */
@media (max-width: 768px) {
    .swr-notification {
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }

    .swr-add-to-wishlist-btn {
        width: 100%;
        justify-content: center;
    }

    .swr-create-wedding-cta {
        margin-top: 15px;
        padding: 15px;
    }

    .swr-cta-text {
        font-size: 0.9rem;
    }
}

/* === Animación de pulso para el icono === */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.swr-add-to-wishlist-btn:not(.in-wishlist):hover .swr-wishlist-icon {
    animation: pulse 0.6s ease-in-out;
}

/* === Ocultar botón YITH Wishlist cuando el usuario está logueado y tiene evento === */
body.swr-user-logged-in .yith-wcwl-add-to-wishlist {
    display: none !important;
}

/* === Modal de selección de eventos === */
.swr-event-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.swr-event-selector-content {
    background: white;
    border-radius: 8px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.swr-event-selector-content h3 {
    margin: 0 0 20px 0;
    color: #003b71;
    font-size: 1.2rem;
    text-align: center;
}

.swr-event-list {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.swr-event-option {
    padding: 12px 16px;
    background: #f5f7fa;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    color: #003b71;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.swr-event-option:hover {
    background: #e3f2fd;
    border-color: #003b71;
}

.swr-cancel-btn {
    width: 100%;
    padding: 10px 16px;
    background: #f0f0f0;
    border: none;
    border-radius: 6px;
    color: #333;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.swr-cancel-btn:hover {
    background: #e0e0e0;
}
