:root {
    /* === CAMBIAR ESTOS 3 COLORES PARA NUEVO PROYECTO === */
    /* Deep Navy/Slate */
    --color-principal: #0f172a;
    --color-principal2: #94c3c1;
    --color-principal-light: #1e293b;
    /* Sky Blue */
    --color-complementary: #1e3051;
    --color-button: #94c3c1;
    --color-button-hover: #7ba5a3;
    --color-linetop: #94c3c1;

    /* Variantes con opacidad en hex (#RRGGBBAA) - basadas en principal */
    --color-principal-05: #0f172a0D;
    --color-principal-10: #0f172a1A;
    --color-principal-20: #0f172a33;
    --color-principal-40: #0f172a66;
    --color-principal-60: #0f172a99;

    /* Neutros */
    --color-text: #334155;
    --color-text-light: #1e3051;
    --color-bg: #f8fafc;
    --color-white: #ffffff;
    --color-border: #e2e8f0;

    /* Overlays */
    --color-overlay: rgba(0, 0, 0, 0.5);
    --color-overlay-60: rgba(0, 0, 0, 0.6);
    --color-overlay-15: rgba(0, 0, 0, 0.15);
    --color-overlay-10: rgba(0, 0, 0, 0.1);
    --color-overlay-light: rgba(255, 255, 255, 0.1);
    --color-white-85: rgba(255, 255, 255, 0.85);
    --color-white-70: rgba(255, 255, 255, 0.7);

    /* Aliases (derivados - no editar) */
    --color-accent: var(--color-principal2);
    --color-accent-hover: var(--color-complementary);
    --color-nav: var(--color-complementary);
    --color-nav-hover: var(--color-principal);
    --color-catalogo: var(--color-complementary);
    --color-secundario: var(--color-principal);
    --color-text-muted: var(--color-text-light);
    --color-bg-light: var(--color-bg);
    --color-accent-20: var(--color-principal-20);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 1px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --font-main: 'Outfit', sans-serif;
}

#id_section {
    min-height: calc(100vh - 429px);
}


#bP_buscaprod .marges {
    box-shadow: 0px 0px 20px 0px rgb(0 0 0 / 35%) !important;
    border-radius: 11px !important;
    max-width: 1800px !important;
    margin: auto !important;
    max-height: 100vh !important;
}

#bP_buscaprod #bP_resultados {
    float: none;
    width: 100%;
    padding-bottom: 0px;
    padding-top: 20px;
    text-align: center;
    max-height: calc(100vh - 220px);
    overflow: auto;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    text-decoration: none;
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
}

body {
    /* background-color: var(--color-bg); */
    color: var(--color-text);
    line-height: 1.5;
}

a {
    color: var(--color-accent);
    transition: color 0.2s;
}

a:hover {
    color: var(--color-accent-hover);
    text-decoration: none;
}

.header-login .agentetop {
    background: var(--color-accent);
    padding-bottom: 5px;
}

.header-login .agentetop a {
    color: white;
    font-weight: 500;
}

.header-login .agentetop .informacion {
    display: flex;
    justify-content: space-between;
}

/* Header Modernization */
.cabecera {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: 0.5rem 0;
    height: auto;
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 100;
}

.cabecera .ajuste {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* Left Side: Logo + Menu + Nav */
.bloque {
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 100%;
    justify-content: space-between;
    width: calc(100% - 50px);
    margin: 0 25px;
}

.bloque1 {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    align-items: center;
}

.cabecera #logo_header {
    display: flex;
    align-items: center;
}

.cabecera #logo_header img {
    max-height: 50px;
    width: auto;
    display: block;
    max-width: 46vw;
    height: auto;
}

.cabecera .buttonmenu {
    display: none;
    /* Hidden on desktop by default */
    width: 35px;
    cursor: pointer;
}

/* Navigation */
nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 100%;
}

.categoria-nav-bar-menu {
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    padding: 0.5rem 0;
    position: relative;
    display: inline-block;
}

.categoria-nav-bar-menu:hover {
    color: var(--color-accent);
}

.categoria-nav-bar-menu::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--color-accent);
    transition: width 0.3s ease;
}

.categoria-nav-bar-menu:hover::after {
    width: 100%;
}

/* Search Bar */
.cabecera .buscar {
    position: relative;
    margin: 0 15px;
    flex-grow: 1;
    max-width: 500px;
}

.cabecera .buscar .inputbuscar {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    font-size: 0.9rem;
    transition: all 0.2s;
    color: var(--color-text);
}

.cabecera .buscar .inputbuscar:focus {
    outline: none;
    border-color: var(--color-accent);
    background: var(--color-white);
    box-shadow: 0 0 0 3px var(--color-principal-10);
}

.cabecera .buscar .imglupa {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    opacity: 0.5;
}

/* User Menu (Right Side) */
.cabecera .cabeceralogin {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 0;
    height: auto;
}

.cabecera .textologin {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
}

.cabecera .textologin:hover {
    color: var(--color-accent);
}

.cabecera .imgaccount,
.cabecera .imgcarro {
    height: 24px;
    width: 24px;
}

.numbercarro {
    background: var(--color-accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 9999px;
    margin-left: -0.5rem;
    margin-top: -0.8rem;
}

/* Selector de idioma: <details>/<summary> con <a href> reales para SEO.
   Visualmente imita un select clásico (click → desplegable). Sin JavaScript. */
.selectidioma {
    position: relative;
    display: inline-block;
    margin: 0 6px;
    font-size: 12px;
    line-height: 1;
}
.selectidioma > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    padding: 6px 22px 6px 10px;
    background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M0 0l5 6 5-6z' fill='%23666'/></svg>") right 8px center no-repeat;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-weight: 600;
    color: #333;
    min-width: 44px;
    text-align: left;
}
.selectidioma > summary::-webkit-details-marker { display: none; }
.selectidioma > summary::marker { content: ""; display: none; }
.selectidioma[open] > summary {
    border-color: #888;
}
.selectidioma ul {
    position: absolute;
    top: calc(100% + 2px);
    right: 0;
    z-index: 100;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    min-width: 60px;
}
.selectidioma li { margin: 0; padding: 0; }
.selectidioma li a {
    display: block;
    padding: 6px 12px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
}
.selectidioma li a:hover {
    background: #f0f0f0;
    color: #000;
}
.selectidioma li.active a {
    font-weight: 700;
    background: rgba(0,0,0,0.05);
}

/* Mobile Section */
.movil {
    display: none;
    /* Hidden on desktop */
}

/* Responsive */
@media (max-width: 1185px) {
    .cabecera .ajuste {
        padding: 0 1rem;
    }

    .bloque {
        gap: 1rem;
    }

    nav {
        display: none;
        /* Hide nav on smaller screens, rely on burger menu */
    }

    .cabecera .buttonmenu {
        display: block;
        /* Show burger menu */
    }
    .portada .balls ul li{
        width: 30%;
    }
}

@media (max-width: 900px) {
    .header-login .agentetop .informacion {
        flex-direction: column;
        font-size: 13px;
    }

    .portada .balls ul li{
        width: 100%;
    }
}

@media (max-width: 768px) {

    .cabecera {
        padding: 0.5rem 0;
    }

    .cabecera .ajuste {
        flex-wrap: wrap;
    }

    .cabecera .bloque {
        width: calc(100% - 30px);
        margin: 0 15px;
    }

    .cabecera .account_text {
        display: none;
    }

    .cabecera .buscar {
        order: 3;
        width: 100%;
        margin: 1rem 0 0 0;
        max-width: none;
        display: none;
        /* Hide desktop search on mobile if needed, or style it */
    }


    .movil {
        display: block;
        width: 100%;
        margin-top: 10px;
    }

    .movil .buscar {
        display: block;
        width: 100%;
    }

    .movil .inputbuscar {
        width: 100%;
        padding: 0.6rem 1rem;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
    }
}

@media (max-width: 400px) {
    .cabecera #logo_header img {
        max-width: 40vw;
    }
}

@media (max-width: 350px) {
    .cabecera #logo_header img {
        max-width: 38vw;
    }
}


/* Footer */
footer {
    background: linear-gradient(to bottom, var(--color-principal) 0%, var(--color-principal) 0%, var(--color-principal2) 140%);
    color: var(--color-white);
    padding: 10px 0;
}

/* Utilities */
.ajuste {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 5px;
}

.linetop {
    background: var(--color-linetop);
    height: 4px;
    width: 100%;
}

.linkmenutop {
    margin-top: 5px;
    display: flex;
    flex-direction: row;
    /* La ruta puede ser larga (Catálogo / Categoría / Subcategoría / Producto).
       Sin wrap, en móvil desbordaba en horizontal y descuadraba la cabecera/menú. */
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

.linkmenutop span,
.linkmenutop a {
    padding: 0 12px;
    text-transform: uppercase;
}

@media all and (max-width: 750px) {
    .linkmenutop {
        margin-top: 2px;
        font-size: 12px;
        row-gap: 2px;
    }
    .linkmenutop span,
    .linkmenutop a {
        padding: 0 6px;
    }
}

/* Guarda anti-scroll horizontal en móvil/tablet: el panel de filtro de
   subcatálogo se posiciona fuera de pantalla (position:fixed; margin-left:100vw)
   y, sin esta regla, genera scroll lateral que "saca" el filtro y descuadra el
   menú. Se limita a <=1185px (donde el menú de escritorio sticky ya no aplica,
   se usa el menú móvil fixed), por lo que no afecta a la cabecera de escritorio. */
@media all and (max-width: 1185px) {
    html,
    body {
        overflow-x: hidden;
    }
}

/* Toastr Overrides */
.toast-top-right {
    top: 20px !important;
    right: 20px !important;
}

#toast-container>div {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 1;
}

/* ============================================
   SCROLLBAR STYLES
   ============================================ */

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-nav, --color-nav) var(--color-border, #e2e8f0);
}

/* Webkit browsers (Chrome, Safari, Edge) */
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: var(--color-border, #e2e8f0);
    border-radius: 10px;
}

*::-webkit-scrollbar-thumb {
    background: var(--color-nav, --color-nav);
    border-radius: 10px;
    border: 2px solid var(--color-border, #e2e8f0);
    transition: background 0.3s ease;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--color-principal, #0f172a);
}

*::-webkit-scrollbar-corner {
    background: var(--color-border, #e2e8f0);
}

/* Scrollbar para elementos con overflow específico */
body::-webkit-scrollbar {
    width: 12px;
}

body::-webkit-scrollbar-track {
    background: var(--color-bg, #f8fafc);
}

body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-nav, --color-nav) 0%, var(--color-principal, #0f172a) 100%);
    border-radius: 10px;
    border: 2px solid var(--color-bg, #f8fafc);
}

body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--color-principal, #0f172a) 0%, var(--color-nav, #1e3051) 100%);
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--color-accent, #94c3c1);
    color: var(--color-white, #ffffff);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1));
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
    padding: 0;
}

.scroll-to-top:hover {
    background: var(--color-principal, #0f172a);
    transform: translateY(-5px);
    box-shadow: 0 15px 25px -5px rgb(0 0 0 / 0.2), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.scroll-to-top:active {
    transform: translateY(-2px);
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .scroll-to-top svg {
        width: 20px;
        height: 20px;
    }
}

/* Selector de idioma — visualmente es el <select> nativo (diseño original).
   El bloque previo de estilos para .idioma-opt se retiró al revertir a <select>. */