:root {
    --color-principal: #0f172a;
    --color-principal2: #94c3c1;
    /* Deep Navy/Slate */
    --color-principal-light: #1e293b;
    --color-accent: #efb8ac;
    --color-accent: #94c3c1;
    --color-nav: #1e3051;
    /* Sky Blue */
    --color-accent-hover: #1e3051;
    --color-text: #334155;
    --color-text-light: #1e3051;
    --color-bg: #f8fafc;
    --color-white: #ffffff;
    --color-border: #e2e8f0;
    --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: var(--color-nav);
    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-principal);
    color: var(--color-white);
    padding: 10px 0;
}

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

.linetop {
    background: var(--color-accent);
    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;
    }
}
