/* ================================================================
   WEW Wishlist Header Button - CSS
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

.wew-header-wishlist-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* ---- Button ---- */

.wew-header-wishlist-btn {
    background-color: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    position: relative;
    transition: all 0.3s ease;
    box-sizing: border-box;
    text-decoration: none;
}

.wew-header-heart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    transition: background 0.22s ease, box-shadow 0.22s ease, transform 0.18s ease;
}

/* Hover effect simplified, now handled by button controls if desired */
.wew-header-wishlist-btn:hover,
.wew-header-wishlist-btn:hover .wew-header-heart {
    background-color: transparent;
    transform: scale(1.04);
}

/* Normal: dark outlined heart, no fill */
.wew-header-heart svg {
    width: 24px;
    height: 24px;
    stroke: #1a1a1a;
    fill: none;
    transition: stroke 0.22s ease, fill 0.22s ease;
    display: block;
}

/* Hover: heart fill is still nice, but stroke color should be dynamic */
.wew-header-wishlist-btn:hover .wew-header-heart svg {
    fill: currentColor;
}

/* Counter badge */
.wew-header-heart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--wew-header-btn-bg, var(--e-global-color-primary, #e05a5a));
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    min-width: 17px;
    height: 17px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .22);
    border: 2px solid #fff;
}

/* ---- Dropdown ---- */

.wew-header-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 9999;
    width: 340px;
    /* El padding-top crea el espacio visual sin gap de hover */
    padding-top: 14px;
    background: transparent;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    font-family: 'Inter', sans-serif;
}

/* Arrow */
.wew-header-dropdown::before {
    content: '';
    position: absolute;
    /* The arrow is within the dropdown's padding-top */
    top: 6px;
    right: 14px;
    width: 16px;
    height: 16px;
    background: #fff;
    transform: rotate(45deg);
    border-radius: 2px;
    box-shadow: -2px -2px 6px rgba(0, 0, 0, .04);
    z-index: 1;
}

.wew-header-wishlist-wrapper.wew-dropdown-open .wew-header-dropdown,
.wew-header-wishlist-wrapper:hover .wew-header-dropdown[data-trigger-hover] {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.wew-header-dropdown-inner {
    padding: 22px 20px 18px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, .15);
    position: relative;
    z-index: 2;
}

/* Loading spinner */
.wew-header-dropdown-loading {
    text-align: center;
    padding: 30px 0;
}

.wew-spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid #f0f0f0;
    border-top-color: var(--wew-header-btn-bg, var(--e-global-color-primary, #e05a5a));
    border-radius: 50%;
    animation: wew-spin 0.7s linear infinite;
}

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

/* Dropdown title */
.wew-header-dropdown-title {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Products list */
.wew-header-products-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #eee #fff;
}

.wew-header-products-list::-webkit-scrollbar {
    width: 4px;
}

.wew-header-products-list::-webkit-scrollbar-thumb {
    background: #eee;
    border-radius: 4px;
}

.wew-header-product-item {
    display: grid;
    grid-template-columns: 54px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.wew-header-product-item:last-child {
    border-bottom: none;
}

.wew-header-product-img {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 8px;
    background: #f5f5f5;
}




.wew-header-product-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 3px;
    transition: color 0.2s;
}

.wew-header-product-name:hover {
    color: #e05a5a;
}

.wew-header-product-meta {
    font-size: 12px;
    color: #888;
}

.wew-header-product-meta strong {
    color: #555;
}

.wew-header-product-price {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
}

.wew-header-product-price del {
    color: #bbb;
    font-weight: 400;
    text-decoration: line-through;
    font-size: 11px;
    display: block;
    text-align: right;
}

.wew-header-product-price ins {
    text-decoration: none;
}

/* Remove from dropdown */
.wew-header-remove-item {
    background: none;
    border: none;
    color: #ccc;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    transition: color 0.2s;
    display: block;
    margin-top: 4px;
    line-height: 1;
}

.wew-header-remove-item:hover {
    color: #e05a5a;
}

/* Empty state */
.wew-header-dropdown-empty {
    text-align: center;
    padding: 24px 10px;
    color: #bbb;
    font-size: 13px;
}

/* Footer */
.wew-header-dropdown-footer {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 14px;
    border-top: 1.5px solid #f0f0f0;
}

.wew-header-view-link {
    font-size: 13px;
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: color 0.2s;
}

.wew-header-view-link:hover {
    color: var(--wew-header-btn-bg, var(--e-global-color-primary, #e05a5a));
}

.wew-add-all-btn {
    display: block;
    width: 100%;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.wew-add-all-btn:hover {
    background: #333;
    transform: translateY(-1px);
}

.wew-add-all-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}