/**
 * CSS Modal Producto — Módulo Home
 * Ruta: app/Views/Pages/Home/assets/css/home_modal.css
 *
 * Prefijo de clases: hpv- (Home Product View)
 * Totalmente aislado del modal del módulo Products.
 */

/* ==========================================================================
   Overlay
   ========================================================================== */
.hpv-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 3000;
    animation: hpvFadeIn 0.25s ease;
}
.hpv-overlay.active { display: block; }

/* ==========================================================================
   Modal Shell
   ========================================================================== */
.hpv-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -62%) scale(0.93);
    opacity: 0;
    pointer-events: none;
    z-index: 3001;
    background: #ffffff;
    border-radius: 22px;
    width: min(920px, 95vw);
    max-height: 92vh;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0,0,0,0.04);
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.25s ease;
}
.hpv-modal.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================================================
   Botón cerrar
   ========================================================================== */
.hpv-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #475569;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.hpv-close:hover {
    background: #fee2e2;
    color: #e30613;
    transform: rotate(90deg) scale(1.1);
}

/* ==========================================================================
   Body (grid 2 columnas)
   ========================================================================== */
.hpv-body {
    display: grid;
    grid-template-columns: 380px 1fr;
    min-height: 480px;
    max-height: 92vh;
    overflow: hidden;
}

/* Columna imagen */
.hpv-image-col {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    position: relative;
    border-right: 1px solid #f1f5f9;
}
.hpv-img-wrapper {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.07);
    display: flex;
    align-items: center;
    justify-content: center;
}
.hpv-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: transform 0.4s ease;
}
.hpv-img:hover { transform: scale(1.06); }

.hpv-badge-oferta {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #e30613;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 12px;
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(227,6,19,0.3);
}

/* Columna info */
.hpv-info-col {
    padding: 32px 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    max-height: 92vh;
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}
.hpv-info-col::-webkit-scrollbar { width: 4px; }
.hpv-info-col::-webkit-scrollbar-track { background: transparent; }
.hpv-info-col::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }

/* Nombre */
.hpv-nombre {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.35rem;
    color: #0f172a;
    line-height: 1.2;
    margin: 0;
    letter-spacing: -0.3px;
}

/* Descripción */
.hpv-desc {
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.55;
    margin: 0;
}

/* ==========================================================================
   Selector de Presentación
   ========================================================================== */
.hpv-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #94a3b8;
    margin: 0 0 8px;
}

.hpv-presentacion-block {
    background: #f8fafc;
    border-radius: 14px;
    padding: 14px 16px;
    border: 1px solid #f1f5f9;
}

.hpv-presentacion-tabs {
    display: flex;
    gap: 8px;
}

.hpv-tab {
    flex: 1;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
}
.hpv-tab:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    transform: translateY(-1px);
}
.hpv-tab.active {
    border-color: #e30613;
    background: #fff1f1;
    box-shadow: 0 4px 14px rgba(227, 6, 19, 0.12);
}

.hpv-tab-icon {
    font-size: 1.25rem;
    color: #94a3b8;
    transition: color 0.2s;
    line-height: 1;
}
.hpv-tab.active .hpv-tab-icon { color: #e30613; }
.hpv-tab:hover .hpv-tab-icon  { color: #64748b; }

.hpv-tab-label {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.82rem;
    color: #0f172a;
}
.hpv-tab.active .hpv-tab-label { color: #e30613; }

.hpv-tab-qty {
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    background: #f1f5f9;
    border-radius: 20px;
    padding: 1px 7px;
    transition: background 0.2s, color 0.2s;
}
.hpv-tab.active .hpv-tab-qty {
    background: rgba(227,6,19,0.1);
    color: #e30613;
}

/* ==========================================================================
   Bloque de precio
   ========================================================================== */
.hpv-precio-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hpv-precio-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #94a3b8;
}
.hpv-precio {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 2rem;
    color: #e30613;
    line-height: 1;
}
.hpv-precio-sub {
    font-size: 0.78rem;
    color: #94a3b8;
    font-style: italic;
}

/* Separador */
.hpv-separator {
    height: 1px;
    background: linear-gradient(90deg,
        rgba(227,6,19,0) 0%,
        rgba(227,6,19,0.4) 50%,
        rgba(227,6,19,0) 100%);
    margin: 2px 0;
}

/* ==========================================================================
   Tabla Precios por Mayor
   ========================================================================== */
.hpv-mayor-block { }
.hpv-mayor-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #94a3b8;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
}
.hpv-mayor-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.hpv-mayor-table tr {
    border-bottom: 1px dashed #f1f5f9;
}
.hpv-mayor-table tr:last-child { border-bottom: none; }
.hpv-mayor-table td {
    padding: 5px 4px;
    color: #475569;
}
.hpv-mayor-table td:first-child { font-weight: 700; color: #0f172a; }
.hpv-mayor-table td:last-child  { text-align: right; font-weight: 800; color: #0f172a; }

/* ==========================================================================
   Cantidad
   ========================================================================== */
.hpv-cantidad-block {
    display: flex;
    align-items: center;
    gap: 14px;
}
.hpv-cantidad-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #94a3b8;
    white-space: nowrap;
}
.hpv-qty-control {
    display: flex;
    align-items: center;
    border: 1.5px solid #e2e8f0;
    border-radius: 30px;
    overflow: hidden;
    height: 40px;
    padding: 0 4px;
    background: #fff;
    gap: 2px;
}
.hpv-qty-btn {
    background: transparent;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #334155;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.hpv-qty-btn:hover { background: #fee2e2; color: #e30613; }
.hpv-qty-input {
    border: none;
    background: transparent;
    width: 44px;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    color: #0f172a;
    -moz-appearance: textfield;
}
.hpv-qty-input::-webkit-outer-spin-button,
.hpv-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ==========================================================================
   Botones CTA
   ========================================================================== */
.hpv-btn-carrito {
    width: 100%;
    background: #e30613;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.22s, transform 0.18s, box-shadow 0.22s;
    margin-top: auto;
}
.hpv-btn-carrito:hover {
    background: #c0000f;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(227, 6, 19, 0.28);
}

.hpv-btn-wsp {
    width: 100%;
    background: #25d366;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.22s, transform 0.18s, box-shadow 0.22s;
}
.hpv-btn-wsp:hover {
    background: #1da851;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.28);
}

/* ==========================================================================
   Animación de entrada del overlay
   ========================================================================== */
@keyframes hpvFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ==========================================================================
   Responsive — tablets y móvil
   ========================================================================== */
@media (max-width: 768px) {
    .hpv-modal {
        width: 96vw;
        border-radius: 18px;
    }
    .hpv-body {
        grid-template-columns: 1fr;
        grid-template-rows: 200px 1fr;
    }
    .hpv-image-col {
        border-right: none;
        border-bottom: 1px solid #f1f5f9;
        border-radius: 18px 18px 0 0;
        padding: 20px;
        max-height: 200px;
    }
    .hpv-img-wrapper {
        max-width: 160px;
        max-height: 160px;
    }
    .hpv-info-col {
        padding: 20px 18px 24px;
        gap: 12px;
    }
    .hpv-nombre { font-size: 1.1rem; }
    .hpv-precio { font-size: 1.6rem; }
    .hpv-tab-label { font-size: 0.75rem; }
}

@media (max-width: 480px) {
    .hpv-presentacion-tabs {
        gap: 6px;
    }
    .hpv-tab {
        padding: 8px 4px;
        border-radius: 10px;
    }
    .hpv-tab-icon { font-size: 1.1rem; }
}
