/**
 * WebDreams Custom Wishlist Styles v1.6.0
 */

:root {
    --wd-wishlist-color-active: #e74c3c;
    --wd-wishlist-color-inactive: inherit;
    --wd-wishlist-border-color: #f4f4f4;
}

/* ==========================================================================
   1. Integración con Elementor (Iconos de Redes Sociales / Listas de Iconos)
   ========================================================================== */

/* Estado Activo en Iconos de Elementor */
.elementor-social-icon.is-in-wishlist,
.elementor-icon-list-item.is-in-wishlist,
a.elementor-icon.is-in-wishlist,
.elementor-grid-item.is-in-wishlist .elementor-social-icon {
    color: var(--wd-wishlist-color-active) !important;
}

.elementor-social-icon.is-in-wishlist svg,
.elementor-icon-list-item.is-in-wishlist svg,
a.elementor-icon.is-in-wishlist svg,
.elementor-grid-item.is-in-wishlist .elementor-social-icon svg {
    fill: var(--wd-wishlist-color-active) !important;
    stroke: var(--wd-wishlist-color-active) !important;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), fill 0.2s ease, stroke 0.2s ease;
}

/* Estado de Carga (Feedback visual) */
.wd-loading,
.elementor-grid-item.wd-loading,
a.wd-wishlist-toggle-btn.wd-loading {
    opacity: 0.6;
    pointer-events: none;
    animation: wdPulse 0.5s infinite alternate ease-in-out;
}

@keyframes wdPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

/* Botón toggle independiente [wd_wishlist_btn] */
.wd-wishlist-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.wd-wishlist-toggle-btn .wd-wishlist-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wd-wishlist-toggle-btn svg.wd-heart-svg {
    transition: all 0.2s ease;
}

.wd-wishlist-toggle-btn.is-in-wishlist svg.wd-heart-svg {
    fill: var(--wd-wishlist-color-active);
    stroke: var(--wd-wishlist-color-active);
}

/* Contador para menús / cabeceras [wd_wishlist_count] */
.wd-wishlist-count {
    display: inline-block;
    min-width: 18px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    border-radius: 12px;
    background-color: var(--wd-wishlist-color-active);
    color: #fff;
    vertical-align: middle;
}

/* ==========================================================================
   2. Ventana Emergente / Notificación (Toast)
   ========================================================================== */

.wd-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #ffffff;
    padding: 18px;
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.05);
    border-left: 5px solid var(--wd-wishlist-color-active);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    max-width: 440px;
    font-family: inherit;
    box-sizing: border-box;
}

.wd-toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wd-toast.toast-added {
    border-left-color: #27ae60;
}

.wd-toast.toast-added .wd-toast-icon {
    background-color: #eafaf1;
    color: #27ae60;
}

.wd-toast.toast-removed {
    border-left-color: #e74c3c;
}

.wd-toast.toast-removed .wd-toast-icon {
    background-color: #fdedec;
    color: #e74c3c;
}

/* Fila Superior: Símbolo de ok y texto */
.wd-toast-top-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.wd-toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
}

.wd-toast-body {
    flex: 1;
    min-width: 0;
}

.wd-toast-title {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #222;
    margin-bottom: 3px;
}

.wd-toast-text {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Fila Inferior: Cerrar y Ver lista (100% IDÉNTICOS en dimensiones y forma) */
.wd-toast-bottom-row {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    width: 100% !important;
    padding-top: 12px !important;
    border-top: 1px solid #f2f2f2 !important;
    box-sizing: border-box !important;
}

.wd-toast-btn-close,
.wd-toast-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    line-height: 38px !important;
    padding: 0 18px !important;
    border-radius: 25px !important; /* Totalmente redondeados */
    font-size: 13px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    text-align: center !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    cursor: pointer !important;
    color: #ffffff !important; /* Texto en blanco */
    transition: background-color 0.2s ease, transform 0.15s ease !important;
    box-sizing: border-box !important;
}

/* Botón Cerrar: Fondo antracita con texto en blanco */
.wd-toast-btn-close {
    background-color: #57606f !important;
}

.wd-toast-btn-close:hover {
    background-color: #2f3542 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

/* Botón Ver lista: Color principal del tema con texto en blanco */
.wd-toast-link {
    background-color: var(--e-global-color-primary, #1F2A44) !important;
}

.wd-toast-link:hover {
    background-color: var(--e-global-color-accent, #2A715E) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

/* ==========================================================================
   3. Tabla de Lista de Deseos [wd_wishlist_table]
   ========================================================================== */

.wd-wishlist-container {
    width: 100%;
    margin: 25px 0;
    background: #ffffff !important;
}

.wd-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #ffffff !important;
}

/* Tabla en fondo blanco, sin bordes verticales */
.wd-wishlist-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff !important;
    border: none !important;
    border-top: 1px solid var(--wd-wishlist-border-color) !important;
    border-bottom: 1px solid var(--wd-wishlist-border-color) !important;
}

.wd-wishlist-table th {
    background: #ffffff !important;
    padding: 1.1em 1.2em;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #444;
    border: none !important;
    border-bottom: 2px solid var(--wd-wishlist-border-color) !important;
}

.wd-wishlist-table td {
    background: #ffffff !important;
    padding: 1.1em 1.2em;
    vertical-align: middle;
    border: none !important;
    border-bottom: 1px solid var(--wd-wishlist-border-color) !important;
}

.wd-wishlist-table tr:last-child td {
    border-bottom: none !important;
}

/* Botón eliminar: Papelera en rojo con fondo blanco sólido opaco */
.wd-wishlist-table .product-remove {
    width: 46px;
    text-align: center;
}

.wd-remove-from-wishlist {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background-color: #ffffff !important; /* Fondo sólido blanco */
    border: 1px solid #eeeeee !important;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    color: #e74c3c !important;
    padding: 0;
    cursor: pointer;
    text-decoration: none !important;
    transition: color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    z-index: 5;
}

.wd-remove-from-wishlist:hover {
    color: #c0392b !important;
    border-color: #e74c3c !important;
    transform: scale(1.12);
}

.wd-remove-from-wishlist svg.wd-trash-svg {
    stroke: currentColor;
    display: block;
}

/* Miniatura: TOTALMENTE CENTRADA */
.wd-wishlist-table th.product-thumbnail,
.wd-wishlist-table td.product-thumbnail {
    width: 105px;
    text-align: center !important;
    vertical-align: middle;
    background: #ffffff !important;
}

.wd-wishlist-table td.product-thumbnail a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto !important;
    text-decoration: none;
}

.wd-wishlist-table .product-thumbnail img {
    max-width: 80px;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto !important;
}

/* Título / Descripción del producto: ALINEADA AL CENTRO */
.wd-wishlist-table th.product-name,
.wd-wishlist-table td.product-name {
    text-align: center !important;
}

.wd-wishlist-table .product-name a.wd-product-title {
    font-weight: 600;
    font-size: 15px;
    color: #2f3542;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: color 0.2s ease;
}

.wd-wishlist-table .product-name a.wd-product-title:hover {
    color: var(--wd-wishlist-color-active);
}

/* Precios: ALINEADOS A LA DERECHA (Sin justificar) */
.wd-wishlist-table th.product-price,
.wd-wishlist-table td.product-price {
    text-align: right !important;
    font-weight: 700;
    font-size: 15px;
    color: #111;
}

.wd-wishlist-table .product-price del {
    color: #a4b0be;
    font-weight: normal;
    margin-right: 6px;
}

.wd-wishlist-table .product-price ins {
    text-decoration: none;
    color: var(--wd-wishlist-color-active);
}

/* Estado de stock centrado */
.wd-wishlist-table th.product-stock-status,
.wd-wishlist-table td.product-stock-status {
    text-align: center !important;
}

.wd-stock {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.wd-stock.in-stock {
    background-color: #eafaf1;
    color: #27ae60;
}

.wd-stock.out-of-stock {
    background-color: #fdedec;
    color: #e74c3c;
}

/* Botones de acción en la tabla: Color principal del tema */
.wd-wishlist-table .product-action {
    text-align: right;
}

.wd-wishlist-table .button.alt,
.wd-wishlist-table .wd-btn-action {
    display: inline-block;
    padding: 11px 22px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
    background-color: var(--e-global-color-primary, #1F2A44) !important;
    color: #ffffff !important;
    border: 1px solid var(--e-global-color-primary, #1F2A44) !important;
}

.wd-wishlist-table .button.alt:hover,
.wd-wishlist-table .wd-btn-action:hover {
    background-color: var(--e-global-color-accent, #2A715E) !important;
    border-color: var(--e-global-color-accent, #2A715E) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(31, 42, 68, 0.15);
}

/* Mensaje lista vacía */
.wd-wishlist-empty-msg {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff !important;
    border: 1px dashed var(--wd-wishlist-border-color);
    border-radius: 12px;
}

.wd-wishlist-empty-msg .wd-empty-text {
    font-size: 18px;
    color: #747d8c;
    margin-bottom: 22px;
}

.wd-wishlist-empty-msg .wd-return-shop-btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
}

/* ==========================================================================
   4. Versión Móvil
   ========================================================================== */
@media screen and (max-width: 768px) {
    /* Toast en móvil: 2 filas limpias */
    .wd-toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
        padding: 14px 16px;
    }

    .wd-toast-top-row {
        gap: 12px;
    }

    .wd-toast-bottom-row {
        display: flex !important;
        justify-content: space-between !important;
        gap: 10px !important;
        padding-top: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .wd-toast-btn-close,
    .wd-toast-link {
        flex: 1 1 50% !important;
        width: 50% !important;
        height: 38px !important;
        min-height: 38px !important;
        max-height: 38px !important;
        line-height: 38px !important;
        padding: 0 12px !important;
        border-radius: 25px !important;
        font-size: 13px !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }

    /* Tabla en móvil: estilo Card sin líneas verticales */
    .wd-wishlist-table thead {
        display: none;
    }

    .wd-wishlist-table tr.wd-wishlist-row {
        display: block;
        margin-bottom: 24px;
        border: none !important;
        border-bottom: 2px solid var(--wd-wishlist-border-color) !important;
        position: relative;
        padding: 1.2em 0.5em;
        background: #ffffff !important;
    }

    .wd-wishlist-table td {
        display: block;
        width: 100%;
        padding: 0.9em 0;
        border: none !important;
        border-bottom: 1px solid var(--wd-wishlist-border-color) !important;
        background: #ffffff !important;
        box-sizing: border-box;
    }

    .wd-wishlist-table td:last-child {
        border-bottom: none !important;
        padding-top: 1.2em;
        padding-bottom: 0.2em;
    }

    /* Botón papelera: fondo sólido blanco opaco para que no se traspase lo de abajo */
    .wd-wishlist-table td.product-remove {
        position: absolute;
        top: 0.8em;
        right: 0.8em;
        width: auto;
        padding: 0;
        border-bottom: none !important;
        z-index: 10;
        background: transparent !important;
    }

    .wd-wishlist-table td.product-remove .wd-remove-from-wishlist {
        background-color: #ffffff !important; /* OPACO SÓLIDO */
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    /* Fila de la miniatura totalmente centrada (sin interferencia de ::before) */
    .wd-wishlist-table td.product-thumbnail,
    .woocommerce table.wd-wishlist-table td.product-thumbnail {
        text-align: center !important;
        padding: 1.2em 0 !important;
        background: #ffffff !important;
        display: block !important;
        width: 100% !important;
        margin: 0 auto !important;
        float: none !important;
    }

    .wd-wishlist-table td.product-thumbnail::before {
        display: none !important;
        content: none !important;
    }

    .wd-wishlist-table td.product-thumbnail a {
        display: block !important;
        text-align: center !important;
        margin: 0 auto !important;
        width: 100% !important;
        float: none !important;
    }

    .wd-wishlist-table td.product-thumbnail img {
        max-width: 130px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        display: block !important;
        float: none !important;
    }

    /* Nombre del producto centrado */
    .wd-wishlist-table td.product-name {
        text-align: center !important;
    }

    .wd-wishlist-table td.product-name .wd-product-title {
        font-size: 16px;
        text-align: center;
    }

    /* PRECIO A LA DERECHA (Sin etiqueta "Precio" a la izquierda ni justificado forzado) */
    .wd-wishlist-table td.product-price {
        text-align: right !important;
        padding: 0.9em 0;
    }

    .wd-wishlist-table td.product-price::before {
        display: none !important; /* Desactivar completamente la etiqueta "Precio" izquierda */
    }

    .wd-wishlist-table td.product-price .woocommerce-Price-amount,
    .wd-wishlist-table td.product-price ins,
    .wd-wishlist-table td.product-price del {
        display: inline-block;
        text-align: right;
    }

    /* Estado de stock centrado */
    .wd-wishlist-table td.product-stock-status {
        text-align: center !important;
    }

    .wd-wishlist-table td.product-stock-status .wd-stock {
        margin: 0 auto;
    }

    /* Botón a ancho completo con el color del tema */
    .wd-wishlist-table td.product-action {
        text-align: center;
    }

    .wd-wishlist-table td.product-action .button.alt,
    .wd-wishlist-table td.product-action .wd-btn-action {
        width: 100%;
        display: block;
        text-align: center;
        padding: 13px 16px;
        font-size: 15px;
    }
}
