﻿/* ============================
   CONTAINERS RESPONSIVE
============================ */

@media (min-width: 1500px) and (max-width: 1700px) {
    .container,
    .container-fluid {
        max-width: 1480px !important;
    }
}

@media (min-width: 1700px) {
    .container,
    .container-fluid {
        max-width: 1650px !important;
    }
}

@media (min-width: 2000px) {
    .container,
    .container-fluid {
        max-width: 1850px !important;
    }
}

@media (min-width: 2600px) {
    .container,
    .container-fluid {
        max-width: 2450px !important;
    }
}

@media (min-width: 3300px) {
    .container,
    .container-fluid {
        max-width: 3200px !important;
    }
}


/* ============================
   HEADER
============================ */

header.bg-new-dark {
    border-bottom: 1px solid #495057;
    min-height: 45px;
}

.navbar.bg-new-dark {
    min-height: 45px;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

@media (max-width: 680px) {
    header .navbar-collapse ul.navbar-nav {
        display: none !important;
    }
}

@media screen and (max-width: 680px) {
    header .navbar-collapse {
        margin-left: 90px;
    }
}

@media (min-width:680px) and (max-width: 1279px) {
    header .navbar-collapse {
        margin-left: 150px;
    }
}

/* ============================
   DROPDOWN GENERAL
============================ */
.dropdown-menu {
    right: 0;
    left: auto !important;
    z-index: 9999;
}

.dropdown a.dropdown-toggle {
    color: white !important;
    transition: all 0.2s ease;
}

    .dropdown a.dropdown-toggle:hover {
        color: #e7e7e7 !important;
    }

.dropdown-menu.show {
    background-color: #2c444f !important;
}

    .dropdown-menu.show a,
    .dropdown-menu.show li {
        color: white;
        font-family: 'Poppins', sans-serif !important;
    }

    .dropdown-menu.show .dropdown-item:hover {
        background-color: #fd8839;
    }

/* ============================
   IDIOMA SELECTOR
============================ */

.dropdown-menu.language-selector {
    background-color: #2c444f !important;
    color: white;
    border-radius: 0.5rem;
    padding: 0.5rem;
    min-width: 140px;
}

    .dropdown-menu.language-selector a.dropdown-item {
        color: white;
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.4rem 0.75rem;
    }

        .dropdown-menu.language-selector a.dropdown-item:hover {
            background-color: #3b5a66;
        }

/* ============================
   AVATAR DROPDOWN
============================ */

.avatarUserHeader {
    width: 32px;
    height: 32px;
    background-color: transparent;
    border: 1px solid #2c444f;
    padding: 18px;
}

    .avatarUserHeader:hover {
        border: 1px solid #e7e7e7 !important;
    }

.dropdown-menu-avatar {
    color: white;
}

    .dropdown-menu-avatar:hover {
        color: #e7e7e7 !important;
    }

        .dropdown-menu-avatar:hover .avatarUserHeader {
            border: 1px solid #e7e7e7 !important;
        }

/* ============================
   NAV GENERAL
============================ */

.spanHeaderWhite {
    color: white;
}

    .spanHeaderWhite:hover,
    .spanHeaderWhite:focus {
        color: #e7e7e7 !important;
    }

.ul-nav-links-mobile {
    padding: 0;
    display: none;
}

.carrito-header-mobile {
    padding: 0;
    display: none;
}


@media screen and (max-width: 680px) {
    .ul-nav-links-mobile {
        display: flex;
    }

    .carrito-header-mobile {
        display: flex;
    }
}

.ul-nav-links-mobile .nav-item {
    padding: .625rem .625rem !important;
}

.ul-nav-links-mobile a:hover {
    color: #e7e7e7 !important;
}

.ul-nav-links-mobile .badge {
    background-color: #fd8839 !important;
    color: white !important;
}

/* ============================
   SEARCH
============================ */

.search-container {
    max-width: 800px !important;
    min-width: 150px;
    position: relative;
}


#input-search-global {
    border-radius: 0.375rem;
    padding: 0.4rem 0.75rem;
}

/* Dropdown contenedor */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #2c444f;
    color: white;
    z-index: 9999;
    max-height: 450px;
    overflow-y: auto;
    border-radius: 0.3rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    width: auto;
    min-width: 100%;
    max-width: 90vw;
}

/* Override para pantallas grandes */
@media (min-width: 768px) {
    .search-dropdown {
        width: 500px;
    }
}

@media (min-width: 1200px) {
    .search-dropdown {
        width: 600px;
    }
}

/* Ítems de resultados */
.search-result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: center;
}

    .search-result-item:hover {
        background-color: #3b5a66;
    }

    .search-result-item img {
        width: 60px;
        height: 60px;
        object-fit: contain;
        border-radius: 0.25rem;
        margin-bottom: 0.5rem;
        flex-shrink: 0;
    }

    .search-result-item .text-block {
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
    }

/* Texto resultado */
.product-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    line-height: 1.3;
}

.product-description {
    font-weight: 400;
    font-size: 0.85rem;
    color: #d1d1d1;
    line-height: 1.2;
}

/* En pantallas grandes: imagen a la izquierda */
@media (min-width: 768px) {
    .search-result-item {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
    }

        .search-result-item img {
            margin-bottom: 0;
            margin-right: 1rem;
        }

        .search-result-item .text-block {
            flex-grow: 1;
        }
}

/* Dropdown para "cargando" o "no hay resultados" */
.search-dropdown-system {
    background-color: #2c444f;
    color: white;
    z-index: 9999;
    border-radius: 0.3rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    padding: 1rem;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 250px;
    max-width: 90vw;
    text-align: center;
    font-size: 0.9rem;
}

    .search-dropdown-system i {
        display: block;
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
        color: #ccc;
    }


header .navbar-brand {
    left: 1.5rem;
}

    header .navbar-brand img {
        height: 25px;
    }

@media screen and (max-width: 390px) {
    header .navbar-brand img {
        height: 15px !important;
        margin: 0 !important;
    }

    header .navbar-brand a.overflow-hidden {
        position: absolute;
        top: 5rem;
        top: 5rem;
        left: 0;
    }
}

@media (min-width: 390px) and (max-width: 490px) {
    header .navbar-brand img {
        height: 15px !important;
        margin: 0 !important;
    }

    header .navbar-brand a.overflow-hidden {
        position: absolute;
        top: 3.5rem;
        left: 0;
    }
}

@media (min-width: 490px) and (max-width: 600px) {
    header .navbar-brand img {
        height: 20px !important;
        margin: 0 !important;
    }

    header .navbar-brand a.overflow-hidden {
        position: absolute;
        top: 2.5rem;
        left: 0;
    }
}



@media (min-width: 500px) and (max-width: 1200px) {
    header .navbar-brand img {
        height: 20px !important;
    }
}


a.sidebar-link {
    padding: .625rem .625rem !important;
}

@media (max-width: 680px) {
    aside#sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        overflow: auto;
        max-width: 500px;
    }

    #sidebar.collapsed {
        margin-left: -800px;
    }
}

.offcanvas {
    z-index: 99999 !important;
}

/* Shopping Cart Mejoras*/
.img-cart {
    width: 120px !important;
    height: 120px !important;
}

.hide-xs {
    display: none;
}
/* 2.2  Layout tipo «card» en xs (≤575 px)  */
@media (max-width:575.98px) {
    .hide-xs {
        display: none !important;
    }

    .table-cart thead { /* ocultar encabezados */
        display: none;
    }

    .table-cart tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: .5rem;
        padding: .5rem;
    }

    .table-cart td {
        display: flex;
        width: 100%;
        justify-content: space-between;
        padding: .25rem .5rem;
    }

        .table-cart td::before { /* etiqueta de la columna */
            content: attr(data-label);
            font-weight: 600;
            margin-right: .5rem;
            color: #6c757d;
        }
}

@media (min-width:576px) {
    .hide-xs {
        display: table-cell !important;
    }
}


#carritoImg {
    width: 150px !important;
    min-width: 150px;
    height: 150px;
    flex-shrink: 0;
}


@media (max-width: 679px) {
    #carritoImg {
        width: 100px !important;
        min-width: 100px !important;
        height: 100px !important;
    }
}

#carritoContent, #carritoQuantity, #carritoStock {
    font-size: 14px !important;
}

@media (min-width: 992px) {
    #carritoContent,
    #carritoQuantity,
    #carritoStock {
        font-size: 16px !important;
    }
}

.search-dropdown-places {
    position: absolute;
    z-index: 9999;
    width: 100%;
    min-width: 400px;
    max-height: 500px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
    color: black !important;
}


#places-results .search-result-item {
    color: black !important;
}

#places-results .search-result-item:hover {
    color: white !important;
}


@media (max-width: 576px) {
    .search-dropdown-places {
        min-width: 100%;
        max-height: 300px;
    }
}
