/* ================================================
   Productos - AptonerVS
   ================================================ */

.navbar:not(.scrolled) .btn-link.text-dark {
    color: rgba(255, 255, 255, 0.95) !important;
}

.navbar:not(.scrolled) .btn-link.text-dark i {
    color: #ffffff !important;
}

.btn-warning {
    background-color: var(--blue-green) !important;
    border-color: var(--blue-green) !important;
    color: white !important;
}

.navbar .navbar-brand img {
    height: 52px;
    width: auto;
    transition: all 0.35s ease;
}

.navbar .nav-link {
    font-family: 'Lato', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: var(--transition);
    position: relative;
}

.navbar:not(.scrolled) .nav-link:hover,
.navbar:not(.scrolled) .nav-item.active .nav-link {
    color: var(--white) !important;
    background: rgba(255, 255, 255, 0.15);
}

.navbar .nav-item.active .nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--blue-green);
    border-radius: 2px;
}

.navbar .btn-primary {
    background: var(--primary-color);
    border: 2px solid var(--primary-color);
    color: var(--white) !important;
    border-radius: 10px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1rem;
    transition: var(--transition);
    position: relative;
}

#carrito-contador {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid var(--white);
}

/* ── SCROLLED ── */
.navbar.scrolled {
    background: #ffffff !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    border-bottom: 1px solid #e5e7eb !important;
    padding: 0.5rem 0;
}

.navbar.scrolled .nav-link,
.navbar.scrolled .dropdown-toggle,
.navbar.scrolled .btn-link {
    color: #1a1a1a !important;
}

.navbar.scrolled .btn-outline-dark {
    color: #212529 !important;
    border-color: #212529 !important;
}

.navbar.scrolled .btn-search-filter {
    color: #212529 !important;
    background-color: #f8f9fa !important;
}

.navbar.scrolled .btn-explorar-externo {
    color: var(--blue-green) !important;
}

.navbar.scrolled .navbar-brand img {
    height: 42px;
}

.btn-search-filter {
    border: 1px solid #ced4da !important;
    border-right: none !important;
    border-radius: 6px 0 0 6px !important;
    font-size: 0.9rem;
}

.hd-search-input {
    border: 1px solid #ced4da !important;
    border-radius: 0 !important;
}

.hd-search-input:focus {
    box-shadow: none !important;
    border-color: var(--blue-green) !important;
}

.btn-search-submit {
    background-color: var(--blue-green) !important;
    border: 1px solid var(--blue-green) !important;
    border-radius: 0 6px 6px 0 !important;
}

.btn-action-hd {
    border: 1px solid transparent;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.25s ease;
    background: transparent;
}

.navbar.scrolled .btn-action-hd {
    color: #212529 !important;
    border-color: #ced4da;
}

.navbar.scrolled .btn-action-hd:hover {
    background-color: var(--blue-green) !important;
    color: #ffffff !important;
}

.navbar:not(.scrolled) .btn-action-hd {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.4);
}

.navbar:not(.scrolled) .btn-action-hd:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

.btn-explorar-externo {
    font-size: 0.9rem;
    background-color: transparent !important;
    transition: all 0.25s ease;
}

.navbar:not(.scrolled) .btn-explorar-externo {
    border: 2px solid #ffffff !important;
    color: #ffffff !important;
}

.navbar:not(.scrolled) .btn-explorar-externo:hover {
    background-color: #ffffff !important;
    color: #212529 !important;
}

.navbar:not(.scrolled) .btn-search-filter {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border-color: #ced4da !important;
}

/* ============================================================
   ESTILOS DETALLE DE PRODUCTO (CORREGIDOS Y SEPARADOS)
   ============================================================ */
.miniatura {
    transition: all 0.2s ease;
    cursor: pointer;
    opacity: 0.7;
}

.miniatura:hover,
.miniatura.active {
    border-color: var(--blue-green) !important;
    box-shadow: 0 0 0 2px rgba(35, 118, 50, 0.15);
    opacity: 1;
}

/* Manejo de tabs de descripción */
.tab-btn {
    color: #6c757d;
    border-bottom: 2px solid transparent !important;
    transition: all 0.2s ease;
}

.tab-btn.active {
    color: var(--blue-green) !important;
    border-bottom: 2px solid var(--blue-green) !important;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeInTab 0.3s ease-in-out;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.imagen-principal-container {
    position: relative;
    overflow: visible !important;
    cursor: crosshair;
}

.zoom-lens {
    position: absolute;
    border: 1.5px solid var(--blue-green);
    background-color: rgba(35, 118, 50, 0.1);
    width: 140px;
    height: 140px;
    cursor: crosshair;
    display: none;
    pointer-events: none;
    z-index: 10;
}

.zoom-result {
    position: absolute;
    left: 105%;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    display: none;
    overflow: hidden;
    z-index: 100;
    background-repeat: no-repeat;
}

.metodos-pago-extendido {
    position: relative;
    cursor: help;
}

.metodos-subtexto {
    font-size: 0.72rem;
    color: #757575;
    display: block;
    margin-top: 0.1rem;
}

.metodos-popover-flotante {
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    width: 290px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    padding: 1.1rem;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.12);
    display: none;
    flex-direction: column;
    gap: 0.65rem;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease-in-out;
    z-index: 200;
}

.metodos-popover-flotante::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: #ffffff transparent transparent transparent;
}

.metodos-pago-extendido:hover .metodos-popover-flotante {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(-4px);
}

.btn-agregar-carrito-grande {
    position: relative;
    transition: all 0.25s ease-in-out;
}

.btn-agregar-carrito-grande.btn-agregando-detalle {
    pointer-events: none;
    color: transparent !important;
}

.btn-agregar-carrito-grande.btn-agregando-detalle i {
    opacity: 0;
}

.btn-agregar-carrito-grande.btn-agregando-detalle::after {
    content: "\f1ce";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff !important;
    font-size: 1.15rem;
    animation: spinDetalleProducto 0.8s linear infinite;
}

@keyframes spinDetalleProducto {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@media (max-width: 768px) {

    .zoom-lens,
    .zoom-result {
        display: none !important;
    }

    .metodos-popover-flotante {
        position: static;
        transform: none;
        width: 100%;
        box-shadow: none;
        padding: 0.5rem 0 0 0;
        border: none;
        display: flex;
        opacity: 1;
        visibility: visible;
    }

    .metodos-popover-flotante::after {
        display: none;
    }
}