/**
 * Hiruk Woo Grid Styles
 */

.hwg-container {
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: inherit;
}

/* --- TOP CONTROLS (SEARCH & CATEGORIES) --- */
.hwg-top-controls {
    margin-bottom: 30px;
}

/* Barra Búsqueda */
.hwg-search-container {
    margin-bottom: 15px;
}

.hwg-search-wrapper {
    position: relative;
    width: 100%;
}

.hwg-search-wrapper input {
    width: 100%;
    height: 48px;
    padding: 0 20px 0 45px;
    box-sizing: border-box;
    border: 1px solid #e1e1e1;
    border-radius: 24px;
    /* Completamente redondeado */
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    background: #fff;
    color: #333;
}

.hwg-search-wrapper input:focus {
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.hwg-search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    pointer-events: none;
}

/* Pill Categories */
.hwg-category-pills {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 10px;
    /* space for scroll if visible */
    /* Hide scrollbar for clean horizontal look */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.hwg-category-pills::-webkit-scrollbar {
    display: none;
}

.hwg-pill {
    white-space: nowrap;
    padding: 8px 18px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #ddd;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.hwg-pill:hover {
    border-color: #999;
}

.hwg-pill.active {
    background: #333;
    color: #fff;
    border-color: #333;
}


/* --- GRID --- */
.hwg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
    position: relative;
    min-height: 200px;
}

/* Loader anidado y en línea para infinitescroll */
.hwg-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    width: 100%;
}

.hwg-loader-append {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 20px;
    grid-column: 1 / -1;
    /* Centrarlo abajo ocupando todo el ancho del grid */
}

.hwg-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #ff4a68;
    border-radius: 50%;
    animation: hwg-spin 1s linear infinite;
}

@keyframes hwg-spin {
    100% {
        transform: rotate(360deg);
    }
}


/* --- CARDS --- */
.hwg-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.hwg-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.7);
}

.hwg-card-image-wrap {
    position: relative;
    width: 100%;
    padding-top: 100%;
    /* 1:1 Aspect Ratio */
    overflow: hidden;
    background: #f8f8f8;
}

.hwg-card-image-wrap a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hwg-card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hwg-card:hover .hwg-card-image-wrap img {
    transform: scale(1.05);
}


/* Meta Badges (Likes) */
.hwg-card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}

.hwg-like-btn {
    background: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    padding: 0;
}

.hwg-likes-count {
    display: none;
    /* Hide the number on grid view as requested by mockup */
}

.hwg-like-btn {
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.hwg-like-btn:hover {
    background: #fff;
    transform: scale(1.05);
}

.hwg-heart-icon {
    color: #999;
    width: 14px;
    height: 14px;
    transition: color 0.3s, transform 0.2s;
}

/* Liked State */
.hwg-like-btn.hwg-liked .hwg-heart-icon {
    color: #ff4a68;
}

/* Heart Pulse Animation */
.hwg-pulse .hwg-heart-icon {
    animation: hwg-heart-pulse 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes hwg-heart-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.4);
    }

    100% {
        transform: scale(1);
    }
}


/* Content Text */
.hwg-card-content {
    padding: 20px;
    text-align: center;
}

.hwg-card-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.hwg-card-title a {
    color: #222;
    text-decoration: none;
    transition: color 0.2s;
}

.hwg-card-title a:hover {
    color: #ff4a68;
}

.hwg-card-price-row {
    margin-bottom: 15px;
}

.hwg-card-price {
    font-size: 16px;
    font-weight: 700;
    color: #ff4a68;
}

.hwg-card-price del {
    color: #999;
    font-weight: 400;
    font-size: 14px;
    margin-right: 6px;
}

.hwg-card-buttons {
    display: flex;
    gap: 8px;
    justify-content: stretch;
}

.hwg-btn-outline {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    background: transparent;
    transition: all 0.2s ease;
}

.hwg-btn-outline:hover {
    border-color: #333;
}

.hwg-btn-solid {
    width: 60%;
    margin: 0 auto;
    text-align: center;
    padding: 14px 24px;
    background: #333;
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    letter-spacing: 0.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.hwg-btn-solid:hover {
    background: #222;
    color: #fff;
}


/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .hwg-container {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .hwg-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 Columnas Estrictas Aseguradas */
        gap: 10px;
        /* Menor gap en móviles */
    }

    .hwg-card-content {
        padding: 10px;
    }

    .hwg-card-title {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .hwg-card-price {
        font-size: 14px;
    }

    .hwg-card-buttons {
        flex-direction: row;
        gap: 4px;
        justify-content: center;
    }

    .hwg-btn-outline,
    .hwg-btn-solid {
        padding: 6px 4px;
        font-size: 11px;
    }
}

/* ========================================================================= */
/* ======================== COTIZADOR MODAL STYLES ========================= */
/* ========================================================================= */

#hwg-cotizador-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#hwg-cotizador-overlay:not(.hwg-cotizador-hidden) {
    opacity: 1;
    visibility: visible;
}

#hwg-cotizador-modal {
    background: #f7f9fc;
    width: 100%;
    max-width: 480px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

#hwg-cotizador-overlay:not(.hwg-cotizador-hidden) #hwg-cotizador-modal {
    transform: translateY(0);
}

/* Header */
.hwg-cotizador-header {
    background: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eaeaea;
}

.hwg-cotizador-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #111;
}

.hwg-cotizador-subtitle {
    font-size: 13px;
    color: #777;
    font-weight: 500;
}

#hwg-cotizador-close {
    background: #f0f0f0;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
}

#hwg-cotizador-close:hover {
    background: #e0e0e0;
}

/* Body */
.hwg-cotizador-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.hwg-cotizador-product-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 24px;
}

.hwg-cotizador-product-preview img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#hwg-cotizador-product-name {
    font-weight: 700;
    font-size: 16px;
    color: #333;
}

.hwg-cotizador-form-group {
    margin-bottom: 20px;
}

.hwg-cotizador-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.hwg-cotizador-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 15px;
    background: #fff;
    color: #333;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 48px;
    /* Centrado vertical forzado */
}

select.hwg-cotizador-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
    line-height: normal;
    /* El select prefiere normal en lugar de forzado a height en algunos OS, o usamos height de 48. */
}

.hwg-cotizador-input:focus {
    outline: none;
    border-color: #222;
}

.hwg-cotizador-input:focus {
    outline: none;
    border-color: #222;
}

/* iOS Toggle Cards */
.hwg-cotizador-card {
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.switch-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.switch-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    background: #f0f4ff;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.switch-title {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

.switch-subtitle {
    display: block;
    font-size: 13px;
    color: #888;
    margin-top: 2px;
}

/* The Switch - iOS Style */
.switch {
    display: inline-block;
    width: 50px;
    height: 28px;
    position: relative;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: #101828;
    /* Oscuro moderno */
}

input:checked+.slider:before {
    transform: translateX(22px);
}

.hwg-cotizador-divider {
    border: 0;
    height: 1px;
    background: #eaeaea;
    margin: 24px 0;
}

/* Footer Total */
.hwg-cotizador-footer {
    background: #0b152d;
    /* Aspecto Dark Blue Navy Premium */
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hwg-cotizador-total-wrap {
    color: #fff;
}

.hwg-cotizador-total-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #a0a8b9;
    text-transform: uppercase;
}

.hwg-cotizador-total-price {
    display: block;
    font-size: 38px;
    font-weight: 900;
    margin-top: -4px;
}

#hwg-cotizador-whatsapp-btn {
    width: 100%;
    background: #25D366;
    /* Verde WP Oficial */
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

#hwg-cotizador-whatsapp-btn:hover {
    background: #1eb956;
}

#hwg-cotizador-whatsapp-btn::before {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12.031 0C5.39 0 0 5.39 0 12.031c0 2.122.553 4.161 1.6 5.96L.103 24l6.195-1.624A11.97 11.97 0 0012.03 24c6.641 0 12.032-5.39 12.032-12.031S18.672 0 12.031 0zm0 22.015a9.982 9.982 0 01-5.1-1.396l-.366-.217-3.793.994 1.01-3.699-.239-.379A9.97 9.97 0 012.016 12.03C2.016 6.502 6.502 2.016 12.03 2.016s10.015 4.486 10.015 10.014-4.486 10.015-10.015 10.015zm5.5-7.512c-.301-.15-1.782-.879-2.058-.98-.276-.1-.477-.15-.678.15-.201.301-.778.98-.954 1.18-.176.201-.352.226-.653.076-1.698-.847-2.822-1.956-3.8A3.666 3.666 0 0110.15 11l.006-.01c.178-.205.353-.408.531-.611.176-.201.251-.351.376-.577.126-.226.05-.427-.025-.577-.076-.15-.678-1.631-.929-2.233-.243-.585-.49-.505-.678-.514-.176-.009-.376-.009-.577-.009-.201 0-.527.075-.803.376-.276.301-1.054 1.029-1.054 2.509s1.079 2.91 1.23 3.11c.15.201 2.133 3.26 5.165 4.564.721.31 1.283.495 1.722.634.723.23 1.381.197 1.898.119.581-.088 1.782-.728 2.033-1.432.251-.703.251-1.306.176-1.431-.076-.126-.276-.201-.577-.351z"/></svg>');
    background-size: cover;
}

/* Modificadores Boton WhatsApp Desactivado */
#hwg-cotizador-whatsapp-btn.hwg-btn-disabled {
    background: #888;
    cursor: default;
    opacity: 0.8;
}

#hwg-cotizador-whatsapp-btn.hwg-btn-disabled:hover {
    background: #888;
}

/* Notificación Toast Profesional */
.hwg-toast-notification {
    position: absolute;
    bottom: 95px;
    /* Arriba del footer del modal */
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #ff4a68;
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 74, 104, 0.4);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    z-index: 1000;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
}

.hwg-toast-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ========================================================================= */
/* ======================== SINGLE PRODUCT STYLES ========================== */
/* ========================================================================= */
.hwg-sp-wrapper.hwg-sp-gallery-only {
    font-family: inherit;
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.hwg-sp-container {
    padding: 0;
}

.hwg-sp-main-image {
    position: relative;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.hwg-sp-main-image img {
    width: 100%;
    display: block;
    aspect-ratio: 1/1;
    object-fit: cover;
}

.hwg-sp-gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin-bottom: 15px;
    padding-bottom: 5px;
}

.hwg-sp-gallery::-webkit-scrollbar {
    display: none;
}

.hwg-sp-gallery-item {
    flex: 0 0 75px;
    height: 75px;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 2px solid transparent;
    transition: border-color 0.2s;
    cursor: pointer;
}

.hwg-sp-gallery-item.active {
    border-color: #111;
}

.hwg-sp-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- LIGHTBOX OVERLAY --- */
.hwg-sp-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hwg-sp-lightbox-overlay.show {
    opacity: 1;
    visibility: visible;
}

.hwg-sp-lightbox-overlay img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    /* ensures image fits screen without crop */
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.hwg-sp-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.hwg-sp-lightbox-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* --- STANDALONE WHATSAPP BUTTON --- */
.hwg-btn-vendedor-wrapper {
    width: 100%;
    margin-top: 15px;
}

.hwg-btn-vendedor-action {
    display: block;
    width: 100%;
    background: #1b9a59;
    color: #fff;
    text-align: center;
    padding: 18px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(27, 154, 89, 0.3);
    transition: background 0.2s;
}

.hwg-btn-vendedor-action:hover {
    background: #137742;
    color: #fff;
    text-decoration: none;
}