/*
 * Acciones de producto: botón comparar, barra de comparación, favoritos y
 * menú de listas. v9.45.0: antes se imprimían en línea en el pie de cada
 * página (hikvision-parking-starter.php); ahora es un archivo que el
 * navegador guarda en caché. Se encola al final de la cabecera para
 * conservar el orden de la cascada (iba después de todas las hojas).
 */

/* === Compare Button (VS) on product cards === */
/* Button inside .hik-product-image, positioned bottom-right */
.hik-compare-btn {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    background: #c6590c;
    color: #fff;
    border: 2px solid transparent;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(198, 89, 12, 0.4);
}
.hik-compare-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 14px rgba(198, 89, 12, 0.6);
}
.hik-compare-btn.active {
    background: #E31937;
    box-shadow: 0 2px 8px rgba(227, 25, 55, 0.4);
    border-color: #fff;
}

/* === Compare button on PDP === */
.pdp-btn-compare {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1.5rem;
    margin-top: 0.5rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    color: #c6590c;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
.pdp-btn-compare:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: #c6590c;
}
.pdp-btn-compare.active {
    background: rgba(227, 25, 55, 0.1);
    border-color: rgba(227, 25, 55, 0.3);
    color: #E31937;
}
.pdp-compare-vs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #c6590c;
    color: #fff;
    border-radius: 50%;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}
.pdp-btn-compare.active .pdp-compare-vs {
    background: #E31937;
}

/* === Floating Compare Bar === */
.hik-compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(12px);
    border-top: 2px solid #c6590c;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 1rem 0;
}
.hik-compare-bar.visible {
    transform: translateY(0);
}
.hik-compare-bar-inner {
    max-width: 95%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.hik-compare-bar-products {
    display: flex;
    gap: 0.75rem;
    flex: 1;
    overflow-x: auto;
}
.hik-compare-bar-product {
    position: relative;
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(245, 158, 11, 0.3);
}
.hik-compare-bar-product img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}
.hik-compare-bar-product-remove {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #E31937;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.hik-compare-bar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}
.hik-compare-bar-count {
    font-size: 0.9rem;
    font-weight: 700;
    color: #c6590c;
}
.hik-compare-bar-btn {
    padding: 0.75rem 1.5rem;
    background: #c6590c;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.hik-compare-bar-btn:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}
.hik-compare-bar-clear {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.hik-compare-bar-clear:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* Light mode */
.hikvision-parking-page[data-color-mode="light"] .hik-compare-bar {
    background: rgba(255, 255, 255, 0.95);
}
.hikvision-parking-page[data-color-mode="light"] .hik-compare-bar-clear {
    border-color: #d1d5db;
    color: #6b7280;
}
/* Auto mode */
@media (prefers-color-scheme: light) {
    .hikvision-parking-page[data-color-mode="auto"] .hik-compare-bar { background: rgba(255,255,255,.95); }
    .hikvision-parking-page[data-color-mode="auto"] .hik-compare-bar-clear { border-color: #d1d5db; color: #6b7280; }
}

/* Mobile compare bar */
@media (max-width: 768px) {
    .hik-compare-bar-inner {
        flex-direction: column;
        gap: 0.75rem;
    }
    .hik-compare-bar-product {
        width: 48px;
        height: 48px;
    }
    .hik-compare-bar-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* --- Favoritos --- */
/* Heart button on product cards */
.hik-favorite-btn{position:absolute;bottom:.75rem;right:3.25rem;width:36px;height:36px;background:rgba(0,0,0,.5);color:#fff;border:2px solid transparent;border-radius:50%;cursor:pointer;z-index:5;display:flex;align-items:center;justify-content:center;transition:all .3s ease;box-shadow:0 2px 8px rgba(0,0,0,.3);padding:0}
.hik-favorite-btn:hover{transform:scale(1.15);background:rgba(227,25,55,.8)}
.hik-favorite-btn.active{background:#E31937;box-shadow:0 2px 8px rgba(227,25,55,.4);border-color:#fff}
.hik-favorite-btn svg{width:18px;height:18px;transition:all .3s ease}
.hik-favorite-btn.active svg{fill:#fff}
/* Heart button on PDP buy box */
.pdp-btn-favorite{display:flex;align-items:center;justify-content:center;gap:.5rem;width:100%;padding:.75rem 1.5rem;margin-top:.5rem;background:rgba(227,25,55,.08);border:1px solid rgba(227,25,55,.2);border-radius:8px;color:#E31937;font-size:.9rem;font-weight:600;cursor:pointer;transition:all .3s ease}
.pdp-btn-favorite:hover{background:rgba(227,25,55,.15);border-color:rgba(227,25,55,.4)}
.pdp-btn-favorite.active{background:rgba(227,25,55,.15);border-color:#E31937}
.pdp-btn-favorite svg{transition:all .3s ease}
.pdp-btn-favorite.active svg{fill:#E31937}
/* Light mode */
.hikvision-parking-page[data-color-mode="light"] .hik-favorite-btn{background:rgba(255,255,255,.8);color:#6b7280;box-shadow:0 2px 8px rgba(0,0,0,.15)}
.hikvision-parking-page[data-color-mode="light"] .hik-favorite-btn:hover{background:rgba(227,25,55,.8);color:#fff}
.hikvision-parking-page[data-color-mode="light"] .hik-favorite-btn.active{background:#E31937;color:#fff}

/* --- Menú de listas de deseos --- */
.fenix-wishlist-popup{position:absolute;z-index:1000;min-width:220px;background:var(--bg-card,#1a1a2e);border:1px solid rgba(255,255,255,.15);border-radius:10px;box-shadow:0 8px 32px rgba(0,0,0,.5);padding:.5rem 0;font-size:.85rem;color:var(--text-primary,#fff)}
.fenix-wishlist-popup-header{padding:.5rem 1rem;font-weight:700;font-size:.8rem;text-transform:uppercase;letter-spacing:.05em;opacity:.6;border-bottom:1px solid rgba(255,255,255,.08)}
.fenix-wishlist-popup-item{display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;cursor:pointer;transition:background .15s}
.fenix-wishlist-popup-item:hover{background:rgba(255,255,255,.08)}
.fenix-wishlist-popup-item input[type="checkbox"]{accent-color:#E31937;width:16px;height:16px;cursor:pointer}
.fenix-wishlist-popup-item span{flex:1}
.fenix-wishlist-popup-item .fenix-wl-count{opacity:.5;font-size:.75rem}
.fenix-wishlist-popup-new{display:block;width:100%;padding:.5rem 1rem;background:none;border:none;border-top:1px solid rgba(255,255,255,.08);color:#E31937;font-size:.85rem;font-weight:600;cursor:pointer;text-align:left;transition:background .15s}
.fenix-wishlist-popup-new:hover{background:rgba(227,25,55,.1)}
.fenix-wishlist-popup-newform{display:flex;gap:.25rem;padding:.5rem .75rem}
.fenix-wishlist-popup-newform input{flex:1;padding:.35rem .5rem;border:1px solid rgba(255,255,255,.2);border-radius:6px;background:rgba(255,255,255,.05);color:var(--text-primary,#fff);font-size:.8rem;outline:none}
.fenix-wishlist-popup-newform button{padding:.35rem .6rem;border:none;border-radius:6px;background:#E31937;color:#fff;font-size:.8rem;cursor:pointer}
[data-color-mode="light"] .fenix-wishlist-popup{background:#fff;border-color:rgba(0,0,0,.12);box-shadow:0 8px 32px rgba(0,0,0,.15);color:#1a1a2e}
[data-color-mode="light"] .fenix-wishlist-popup-header{border-color:rgba(0,0,0,.08)}
[data-color-mode="light"] .fenix-wishlist-popup-item:hover{background:rgba(0,0,0,.04)}
[data-color-mode="light"] .fenix-wishlist-popup-new{border-color:rgba(0,0,0,.08)}
[data-color-mode="light"] .fenix-wishlist-popup-newform input{background:#f9f9f9;border-color:rgba(0,0,0,.15);color:#1a1a2e}
@media(prefers-color-scheme:light){
    [data-color-mode="auto"] .fenix-wishlist-popup{background:#fff;border-color:rgba(0,0,0,.12);box-shadow:0 8px 32px rgba(0,0,0,.15);color:#1a1a2e}
    [data-color-mode="auto"] .fenix-wishlist-popup-header{border-color:rgba(0,0,0,.08)}
    [data-color-mode="auto"] .fenix-wishlist-popup-item:hover{background:rgba(0,0,0,.04)}
    [data-color-mode="auto"] .fenix-wishlist-popup-new{border-color:rgba(0,0,0,.08)}
    [data-color-mode="auto"] .fenix-wishlist-popup-newform input{background:#f9f9f9;border-color:rgba(0,0,0,.15);color:#1a1a2e}
}
