/* =========================================
   ESTILOS GENERALES Y COMPONENTES
   ========================================= */
.mn-search-home-box {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #e8eef6;
    border-radius: 24px;
    padding: clamp(16px, 3vw, 22px);
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.06);
    margin-bottom: 24px;
}

.mn-search-home-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.mn-search-home-title {
    margin: 0;
    font-size: clamp(20px, 3vw, 24px);
    font-weight: 800;
    color: #0f172a;
}

.mn-search-home-subtitle {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 14px;
}

.mn-search-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 18px;
    padding: 14px 18px;
    margin: 14px 0 18px;
    flex-wrap: wrap;
}

.mn-search-summary .count {
    color: #0a2c4e;
    font-weight: 700;
}

.mn-search-summary .hint {
    color: #64748b;
    font-size: 13px;
}

.mn-search-empty {
    border-radius: 22px;
    background: #fff;
    border: 1px dashed #dbe5ef;
    padding: 36px 24px;
    text-align: center;
    color: #64748b;
}

.mn-search-loading {
    text-align: center;
    padding: 18px 0;
    color: #0a2c4e;
}

/* =========================================
   HERO SECTION
   ========================================= */
.mn-hero-slide {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
    min-height: clamp(280px, 50vh, 550px);
    border-radius: clamp(16px, 3vw, 24px);
}

.hero-img-controlled {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 20%;
    z-index: 1;
}

.mn-hero-detail {
    position: relative;
    z-index: 3;
    padding-left: clamp(20px, 8vw, 10%);
    padding-right: clamp(20px, 4vw, 40px);
    max-width: 620px;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(5, 19, 38, 0.72) 0%, rgba(5, 19, 38, 0.20) 55%, rgba(5, 19, 38, 0.08) 100%);
    z-index: 2;
}

/* =========================================
   TARJETAS Y CATEGORÍAS
   ========================================= */
.category-featured-card,
.category-banner {
    height: 100%;
    min-height: 100%;
}

.category-banner-link {
    display: block;
    height: 100%;
    text-decoration: none;
}

.category-banner {
    border-radius: 24px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    position: relative;
    box-shadow: 0 16px 40px rgba(16, 24, 40, 0.12);
    min-height: 250px;
    max-height: 400px;
}

.category-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .12), rgba(0, 0, 0, .55));
    padding: clamp(16px, 4vw, 30px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* TARJETA DE PRODUCTO PEQUEÑA (CORREGIDA) */
.small-card {
    border-radius: 18px;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.small-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .12);
}

/* CONTROL DE IMAGEN PRINCIPAL EN SMALL-CARD */
.small-card .mn-product-img .mn-img .image img {
    width: 100%;
    height: clamp(180px, 20vw, 220px) !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
}

/* =========================================
   MINICATEGORÍAS - CORRECCIÓN COMPLETA
   ========================================= */

/* Contenedor de miniaturas en tarjetas de producto normales */
.mn-minicategory-thumbs {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eef2f7;
}

.mn-minicategory-title {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mn-minicategory-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.mn-minicategory-item {
    display: inline-block;
    text-decoration: none;
    position: relative;
    flex-shrink: 0;
}

/* TAMAÑO DE MINIATURAS EN TARJETA NORMAL - CORREGIDO */
.mn-minicategory-thumb {
    width: 40px !important;
    height: 40px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    background: #f8fafc !important;
    border: 1px solid #eef2f7 !important;
    transition: all 0.2s ease !important;
    position: relative !important;
}

.mn-minicategory-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
}

.mn-minicategory-item:hover .mn-minicategory-thumb {
    transform: scale(1.1);
    border-color: #0a2c4e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.mn-minicategory-discount {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #dc2626;
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    z-index: 3;
    line-height: 1;
}

/* MINICATEGORÍAS EN SMALL-CARD (MÁS PEQUEÑAS AÚN) */
.mn-minicategory-thumbs-small {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eef2f7;
}

.mn-minicategory-grid-small {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.mn-minicategory-item-small {
    display: inline-block;
    text-decoration: none;
    position: relative;
    flex-shrink: 0;
}

/* MINIATURAS ULTRA-PEQUEÑAS PARA SMALL-CARD */
.mn-minicategory-thumb-small {
    width: 35px !important;
    height: 35px !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    background: #f8fafc !important;
    border: 1px solid #eef2f7 !important;
    transition: all 0.2s ease !important;
}

.mn-minicategory-thumb-small img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
}

.mn-minicategory-item-small:hover .mn-minicategory-thumb-small {
    transform: scale(1.1);
    border-color: #0a2c4e;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

/* VER MÁS */
.mn-minicategory-more {
    margin-top: 8px;
    text-align: right;
}

.mn-view-more {
    font-size: 12px;
    font-weight: 700;
    color: #1e4a7a;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mn-view-more:hover {
    color: #0a2c4e;
    text-decoration: underline;
}

/* =========================================
   MODAL QUICKVIEW
   ========================================= */
#quickview_modal .modal-dialog {
    max-width: min(1180px, 95vw);
    margin: 1rem auto;
}

#quickview_modal .modal-content {
    border: 0;
    border-radius: clamp(16px, 3vw, 28px) !important;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 35px 80px -18px rgba(15, 23, 42, 0.32);
}

#quickview_modal .btn-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 20;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: #fff;
    opacity: 1;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .15);
}

.qv-shell {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    min-height: 650px;
    background: #fff;
}

.qv-left {
    background: radial-gradient(circle at top left, rgba(59, 130, 246, .10), transparent 28%), linear-gradient(145deg, #f8fbff, #eef4fb);
    padding: clamp(16px, 3vw, 28px);
    border-right: 1px solid rgba(15, 23, 42, 0.06);
}

.qv-gallery-main {
    background: #fff;
    border-radius: 24px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    height: clamp(280px, 45vw, 490px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2), 0 12px 30px rgba(15, 23, 42, .08);
}

.qv-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .35s ease;
}

.qv-gallery-main:hover img {
    transform: scale(1.02);
}

.qv-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
    align-items: center;
}

.qv-thumb {
    width: clamp(50px, 8vw, 76px);
    height: clamp(50px, 8vw, 76px);
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid transparent;
    background: #fff;
    cursor: pointer;
    transition: all .22s ease;
    opacity: .85;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}

.qv-thumb:hover,
.qv-thumb.active {
    border-color: #1e4a7a;
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 14px 22px rgba(30, 74, 122, .18);
}

.qv-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qv-right {
    padding: clamp(16px, 3vw, 34px);
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    overflow-y: auto;
}

.qv-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.qv-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    padding: 7px 13px;
    border-radius: 999px;
    letter-spacing: .4px;
    text-transform: uppercase;
}

.qv-pill.cat {
    background: #edf4ff;
    color: #234b7c;
    border: 1px solid rgba(35, 75, 124, .12);
}

.qv-pill.stock-ok {
    background: #e7f8ee;
    color: #0c6b39;
    border: 1px solid rgba(12, 107, 57, .14);
}

.qv-pill.stock-no {
    background: #feeceb;
    color: #be3c30;
    border: 1px solid rgba(190, 60, 48, .14);
}

.qv-name {
    margin: 0 0 12px;
    font-size: clamp(22px, 3vw, 32px);
    line-height: 1.15;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -.5px;
}

.qv-desc {
    font-size: 15px;
    line-height: 1.8;
    color: #5b6474;
    margin-bottom: 22px;
    max-height: 155px;
    overflow-y: auto;
    padding-right: 8px;
}

.qv-pricebox {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 22px;
    border-radius: 22px;
    background: linear-gradient(135deg, #0c2545, #1d4675, #2b5d97);
    box-shadow: 0 18px 35px -12px rgba(13, 37, 69, .34);
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.qv-price {
    display: block;
    color: #fff;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 800;
    letter-spacing: -.6px;
}

.qv-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

.qv-meta-card {
    border-radius: 18px;
    background: #f8fbff;
    border: 1px solid #e7edf5;
    padding: 14px 16px;
    transition: all .2s ease;
}

.qv-meta-label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 4px;
    letter-spacing: .3px;
}

.qv-meta-value {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.qv-qty-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.qv-qty-label {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

.qv-qty-box {
    display: inline-flex;
    align-items: center;
    border: 1px solid #dbe5ef;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.qv-qty-btn {
    width: 48px;
    height: 48px;
    border: 0;
    background: #fff;
    color: #0f172a;
    font-size: 20px;
    font-weight: 700;
    transition: background .2s ease;
}

.qv-qty-btn:hover {
    background: #f5f8fc;
}

.qv-qty-input {
    width: 58px;
    height: 48px;
    border: 0;
    text-align: center;
    font-weight: 800;
    color: #0f172a;
    outline: none;
    background: #fff;
}

.qv-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: auto;
}

.qv-btn {
    border: 0;
    border-radius: 18px;
    padding: 16px 18px;
    font-size: 15px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    transition: all .22s ease;
    cursor: pointer;
}

.qv-btn.primary {
    color: #fff;
    background: linear-gradient(135deg, #1c4d84, #2f67a7);
    box-shadow: 0 14px 28px -12px rgba(28, 77, 132, .45);
}

.qv-btn.primary:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #163c67, #25588f);
}

.qv-btn.outline {
    color: #1c4d84;
    background: #fff;
    border: 2px solid #d9e4f0;
}

.qv-btn.outline:hover {
    transform: translateY(-2px);
    color: #163c67;
    border-color: #1c4d84;
    background: #f8fbff;
}

/* =========================================
   BARRA DE BÚSQUEDA
   ========================================= */
.search-bar-box .search-input-wrap .form-control {
    height: 52px;
    border-radius: 14px;
}

.search-bar-box .js-search-clear {
    height: 52px;
    border-radius: 14px;
    font-weight: 600;
}

.search-bar-box .live-search-status {
    min-height: 20px;
    padding-left: 4px;
}

/* =========================================
   MEDIA QUERIES
   ========================================= */

/* TABLET Y LAPTOPS PEQUEÑAS */
@media (max-width: 991px) {
    .qv-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .qv-left {
        border-right: 0;
        border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    }

    .qv-gallery-main {
        height: 360px;
    }

    .qv-right {
        padding: 24px;
        max-height: none;
    }

    .qv-actions,
    .qv-meta-grid {
        grid-template-columns: 1fr;
    }

    .mn-hero-slide {
        min-height: 450px;
    }

    .mn-hero-detail {
        padding-left: 6%;
    }

    .small-card .mn-product-img .mn-img .image img {
        height: 200px !important;
    }
}

/* MÓVILES GRANDES Y TABLETS VERTICALES */
@media (max-width: 768px) {
    .mn-minicategory-thumb {
        width: 36px !important;
        height: 36px !important;
    }

    .mn-minicategory-thumb-small {
        width: 30px !important;
        height: 30px !important;
    }

    .mn-search-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .mn-hero-slide {
        min-height: 350px;
        border-radius: 16px;
    }

    .mn-hero-detail {
        padding-left: 20px;
        padding-right: 20px;
    }

    .qv-name {
        font-size: 26px;
    }

    .qv-price {
        font-size: 28px;
    }

    .qv-pricebox {
        flex-direction: column;
        align-items: flex-start;
    }

    .small-card .mn-product-img .mn-img .image img {
        height: 180px !important;
    }

    .mn-minicategory-grid {
        gap: 5px;
    }

    .mn-minicategory-grid-small {
        gap: 3px;
    }

    .category-banner {
        min-height: 200px;
        max-height: 300px;
    }
}

/* MÓVILES PEQUEÑOS */
@media (max-width: 576px) {
    .mn-search-home-box {
        padding: 14px;
        border-radius: 16px;
    }

    .mn-search-home-title {
        font-size: 18px;
    }

    .mn-hero-slide {
        min-height: 280px;
    }

    .category-overlay {
        padding: 14px;
    }

    #quickview_modal .modal-content {
        border-radius: 16px !important;
    }

    .qv-right,
    .qv-left {
        padding: 14px;
    }

    .qv-gallery-main {
        height: 250px;
        border-radius: 16px;
    }

    .qv-thumb {
        width: 50px;
        height: 50px;
    }

    .qv-actions {
        display: flex;
        flex-direction: column;
    }

    .qv-meta-grid {
        grid-template-columns: 1fr;
    }

    .small-card .mn-product-img .mn-img .image img {
        height: 160px !important;
    }

    .mn-minicategory-thumb {
        width: 32px !important;
        height: 32px !important;
    }

    .mn-minicategory-thumb-small {
        width: 28px !important;
        height: 28px !important;
    }

    .category-banner {
        min-height: 180px;
        max-height: 250px;
        border-radius: 16px;
    }
}

/* =========================================
   UTILIDADES EXTRA
   ========================================= */

/* Scrollbar personalizado para quickview */
.qv-desc::-webkit-scrollbar,
.qv-right::-webkit-scrollbar {
    width: 4px;
}

.qv-desc::-webkit-scrollbar-track,
.qv-right::-webkit-scrollbar-track {
    background: transparent;
}

.qv-desc::-webkit-scrollbar-thumb,
.qv-right::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Asegurar que las imágenes no se salgan */
img {
    max-width: 100%;
    height: auto;
}

/* Fix para imágenes en cards normales de producto */
.mn-product-card .mn-product-img .mn-img .image .main-img,
.mn-product-card .mn-product-img .mn-img .image .hover-img {
    width: 100% !important;
    height: 250px !important;
    object-fit: cover !important;
    object-position: center !important;
}

@media (max-width: 768px) {

    .mn-product-card .mn-product-img .mn-img .image .main-img,
    .mn-product-card .mn-product-img .mn-img .image .hover-img {
        height: 220px !important;
    }
}

@media (max-width: 576px) {

    .mn-product-card .mn-product-img .mn-img .image .main-img,
    .mn-product-card .mn-product-img .mn-img .image .hover-img {
        height: 200px !important;
    }
}

/* =========================================
   CART TOAST - NOTIFICACIÓN FLOTANTE
   ========================================= */
.cart-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 320px;
    max-width: 420px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.08);
    transform: translateX(120%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

.cart-toast.show {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

.cart-toast-header {
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 700;
}

.cart-toast-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.9;
    font-size: 12px;
}

.cart-toast-body {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
}

.cart-toast-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #2e7d32;
}

.cart-toast-text {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

/* Animación de entrada */
@keyframes toastSlideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 576px) {
    .cart-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
}