:root {
    /* === CAMBIAR ESTOS 3 COLORES PARA NUEVO PROYECTO === */
    /* Gris Oscuro / Carbón Profundo (Elegancia y alto contraste) */
    --color-principal: #1a1a1a; 
    /* Lino / Beige Cálido (Refleja el mundo textil y orgánico) */
    --color-principal2: #4b4b4b; 
    --color-principal-light: #333333;
    --color-footer: #ae9e92;
    --color-footer-texto: #ffffff;

    /* Neutro de apoyo / Complementario */
    --color-complementary: #2a2a2a; 
    --color-button: #000000; /* Tono arena ligeramente más oscuro para botones */
    --color-button-hover: #a69588;
    --color-linetop: #cdc5c0;

    /* Variantes con opacidad en hex (#RRGGBBAA) - basadas en principal (#1a1a1a) */
    --color-principal-05: #1a1a1a0D;
    --color-principal-10: #1a1a1a1A;
    --color-principal-20: #1a1a1a33;
    --color-principal-40: #1a1a1a66;
    --color-principal-60: #1a1a1a99;

    /* Neutros */
    --color-text: #3f3f3f;       /* Gris oscuro suave para facilitar la lectura */
    --color-text-light: #595959; /* Textos secundarios */
    --color-text-complementario: #a69588; /* Textos secundarios */
    --color-bg: #faf9f8;         /* Blanco roto, similar al algodón */
    --color-white: #ffffff;
    --color-border: #e6e4e0;     /* Bordes sutiles y cálidos */

    /* 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-button-hover);
    --color-nav: var(--color-principal);
    --color-nav-hover: var(--color-button);
    --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: #cdc5c033; /* 20% de opacidad del color principal2 */
    
    /* Sombras y Radios */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 1px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.08);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
    --radius-md: 0.25rem; /* Un borde un poco más recto (0.25 en vez de 0.375) da un toque más corporativo y maduro */
    --radius-lg: 0.35rem;
    --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;
}

.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%;
}

/* Hide the old temp menu if it exists */
.menu_tmp {
    display: none;
}

/* Search Bar */
.cabecera .buscar {
    position: relative;
    margin: 0 2rem;
    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 rgba(14, 165, 233, 0.1);
}

.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;
}

/* 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 */
    }
}

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

    }
}

@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: var(--color-footer);
    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;
}

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

/* 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;
    }
}
