/* =========================================
   HEADER TIENDA VIALSA - LIMPIO FINAL
   Responsive: PC, tablet y celular
========================================= */

:root {
    --store-primary: var(--vialsa-primary, #0757d8);
    --store-dark: var(--vialsa-header, #061936);
    --store-soft: #eff6ff;
    --store-border: #dbeafe;
    --store-muted: #64748b;
    --store-cyan: var(--vialsa-cyan, #06b6d4);
    --store-danger: #dc2626;
}

/* =========================================
   HEADER GENERAL
========================================= */

.vialsa-store-header {
    position: sticky;
    top: 0;
    z-index: 1040;
    background: var(--vialsa-header, #0f3a5f) !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .08);
}

/* =========================================
   TOPBAR
========================================= */

.store-topbar {
    background: linear-gradient(135deg, var(--vialsa-header, #061936), color-mix(in srgb, var(--vialsa-header, #061936) 82%, var(--vialsa-cyan, #06b6d4)));
    color: var(--vialsa-header-text, #eaf2ff);
    font-size: .76rem;
}

.topbar-content {
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.topbar-left span,
.topbar-right a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--vialsa-header-text, #eaf2ff);
    text-decoration: none;
    white-space: nowrap;
}

.topbar-left i,
.topbar-right i {
    color: var(--vialsa-cyan, #67e8f9);
}

.topbar-right a:hover {
    color: var(--vialsa-header-text, #ffffff);
}

/* =========================================
   NAVBAR PRINCIPAL
========================================= */

.store-main-navbar {
    min-height: 76px;
    background: var(--vialsa-header, #0f3a5f);
    color: var(--vialsa-header-text, #ffffff);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid color-mix(in srgb, var(--vialsa-header, #0f3a5f) 82%, #ffffff);
}

.store-brand {
    min-width: 190px;
    gap: 10px;
}

.logo-img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    flex: 0 0 auto;
}

.brand-stack {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.logo-text {
    color: var(--vialsa-header-text, #ffffff);
    font-size: 1.25rem;
    font-weight: 950;
    letter-spacing: -1px;
}

.brand-stack small {
    color: var(--vialsa-cyan, #00a6d6);
    font-size: .6rem;
    font-weight: 900;
    letter-spacing: .7px;
}

/* =========================================
   BOTÓN MÓVIL
========================================= */

.store-toggler {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--vialsa-header-text, #ffffff) 30%, transparent);
    border-radius: 14px;
    background: color-mix(in srgb, var(--vialsa-header-text, #ffffff) 12%, transparent);
    color: var(--vialsa-header-text, #ffffff);
    box-shadow: none !important;
}

.store-toggler i {
    font-size: 1.55rem;
}

/* =========================================
   BUSCADOR
========================================= */

.store-search {
    flex: 1;
    min-width: 280px;
    max-width: 700px;
    min-height: 48px;
    display: flex;
    align-items: center;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid var(--store-border);
    box-shadow: 0 10px 24px rgba(7, 87, 216, .08);
    overflow: hidden;
}

.search-category {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 15px;
    min-height: 48px;
    color: #334155;
    font-size: .84rem;
    font-weight: 850;
    border-right: 1px solid #eaf2ff;
    white-space: nowrap;
}

.search-input-box {
    position: relative;
    flex: 1;
    min-width: 0;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--store-primary);
    font-size: .95rem;
}

.search-input {
    height: 48px;
    padding-left: 40px;
    padding-right: 72px;
    border: none !important;
    box-shadow: none !important;
    background: transparent;
    font-size: .94rem;
}

.search-input::placeholder {
    color: #94a3b8;
}

.search-shortcut {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--store-soft);
    color: var(--store-primary);
    font-size: .66rem;
    font-weight: 900;
}

.btn-search-store {
    width: 54px;
    min-height: 48px;
    border: none;
    background: linear-gradient(135deg, var(--vialsa-primary, var(--store-primary)), var(--vialsa-cyan, var(--store-cyan)));
    color: #ffffff;
    font-size: 1.05rem;
}

/* =========================================
   ACCIONES DERECHA
========================================= */

.store-actions {
    flex-shrink: 0;
}

.store-action-item {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 16px;
    color: var(--vialsa-header-text, #ffffff);
    text-decoration: none;
    transition: background .18s ease, transform .18s ease;
}

.store-action-item:hover {
    background: color-mix(in srgb, var(--vialsa-header-text, #ffffff) 12%, transparent);
    color: var(--vialsa-header-text, #ffffff);
    transform: translateY(-1px);
}

.store-action-item i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: color-mix(in srgb, var(--vialsa-cyan, #00a6d6) 18%, transparent);
    color: var(--vialsa-cyan, #00a6d6);
    font-size: 1rem;
}

.store-action-item span {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    max-width: 120px;
}

.store-action-item small {
    color: color-mix(in srgb, var(--vialsa-header-text, #ffffff) 72%, transparent);
    font-size: .66rem;
    font-weight: 700;
}

.store-action-item strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--vialsa-header-text, #ffffff);
    font-size: .8rem;
    font-weight: 900;
}

.store-action-icon {
    position: relative;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: color-mix(in srgb, var(--vialsa-header-text, #ffffff) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--vialsa-header-text, #ffffff) 26%, transparent);
    color: var(--vialsa-header-text, #ffffff);
    text-decoration: none;
    transition: all .18s ease;
}

.store-action-icon:hover {
    background: color-mix(in srgb, var(--vialsa-cyan, #00a6d6) 18%, transparent);
    color: var(--vialsa-cyan, #00a6d6);
    transform: translateY(-1px);
}

.action-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--store-danger);
    color: #fff;
    font-size: .67rem;
    font-weight: 900;
}

/* =========================================
   CARRITO
========================================= */

.store-cart-button {
    position: relative;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--vialsa-primary, #0d6efd), var(--vialsa-cyan, #00a6d6));
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 12px 24px color-mix(in srgb, var(--vialsa-primary, #0d6efd) 22%, transparent);
    transition: transform .18s ease, box-shadow .18s ease;
}

.store-cart-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px color-mix(in srgb, var(--vialsa-primary, #0d6efd) 28%, transparent);
}

.store-cart-button i {
    font-size: 1.18rem;
}

.cart-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    text-align: left;
}

.cart-text small {
    color: rgba(255, 255, 255, .82);
    font-size: .66rem;
}

.cart-text strong {
    color: #ffffff;
    font-size: .8rem;
}

.cart-count {
    min-width: 23px;
    height: 23px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #ffffff;
    color: var(--vialsa-primary, #0d6efd);
    font-size: .72rem;
    font-weight: 950;
}

/* =========================================
   MENÚ LIMPIO
========================================= */

.clean-menu-bar,
.store-menu-bar {
    background: var(--vialsa-header, #ffffff);
    border-top: 1px solid color-mix(in srgb, var(--vialsa-header-text, #ffffff) 16%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--vialsa-header, #0f3a5f) 82%, #ffffff);
}

.clean-menu-center {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(12px, 2vw, 28px);
    overflow-x: auto;
    scrollbar-width: none;
}

.clean-menu-center::-webkit-scrollbar {
    display: none;
}

.clean-menu-center a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
    padding: 10px 16px;
    border-radius: 999px;
    color: var(--vialsa-header-text, #1e293b);
    text-decoration: none;
    font-size: .96rem;
    font-weight: 900;
    letter-spacing: -.2px;
    transition: all .2s ease;
}

.clean-menu-center a:hover,
.clean-menu-center a.active {
    background: color-mix(in srgb, var(--vialsa-header-text, #ffffff) 16%, transparent);
    color: var(--vialsa-header-text, var(--store-primary));
}

.clean-menu-center a.active::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 3px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--vialsa-primary, var(--store-primary)), var(--vialsa-cyan, var(--store-cyan)));
}

.clean-menu-center .menu-offer {
    color: var(--store-danger);
}

.clean-menu-center .menu-offer:hover {
    background: #fff1f2;
    color: var(--store-danger);
}

/* Ocultar cualquier fila antigua de categorías */
.store-category-strip,
.category-strip-scroll,
.category-chip,
.store-menu-scroll {
    display: none !important;
}

/* =========================================
   DROPDOWN
========================================= */

.dropdown-menu {
    padding: 10px;
}

.dropdown-item {
    border-radius: 12px;
    padding: 9px 11px;
    font-weight: 700;
}

.dropdown-item:hover {
    background: var(--store-soft);
}

/* =========================================
   RESPONSIVE - LAPTOP PEQUEÑA
========================================= */

@media (max-width: 1199px) {

    .store-brand {
        min-width: 170px;
    }

    .store-search {
        max-width: 560px;
    }

    .store-action-item span,
    .cart-text {
        display: none;
    }

    .store-cart-button {
        width: 46px;
        height: 46px;
        justify-content: center;
        padding: 0;
    }

    .cart-count {
        position: absolute;
        top: -6px;
        right: -6px;
    }

    .clean-menu-center {
        justify-content: flex-start;
    }
}

/* =========================================
   RESPONSIVE - TABLET
========================================= */

@media (max-width: 991px) {

    .store-topbar {
        display: none;
    }

    .store-main-navbar {
        min-height: auto;
        padding: 10px 0;
    }

    .store-brand {
        min-width: auto;
    }

    .logo-img {
        width: 40px;
        height: 40px;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .brand-stack small {
        font-size: .56rem;
    }

    .navbar-collapse {
        padding-top: 12px;
    }

    .store-search {
        width: 100%;
        max-width: none;
        min-width: 0;
        order: -1;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .search-input {
        font-size: .88rem;
        padding-right: 14px;
    }

    .store-actions {
        width: 100%;
        align-items: stretch !important;
        flex-direction: row;
        flex-wrap: wrap;
        margin-top: 8px;
    }

    .store-action-item {
        flex: 1;
        justify-content: center;
        border: 1px solid var(--store-border);
        background: #fff;
    }

    .store-action-item span {
        display: flex;
    }

    .store-action-icon,
    .store-cart-button {
        flex: 1;
        width: auto;
        min-width: 70px;
    }

    .store-cart-button {
        padding: 8px 12px;
    }

    .cart-text {
        display: flex;
    }

    .clean-menu-center {
        min-height: 50px;
        justify-content: flex-start;
        gap: 8px;
    }

    .clean-menu-center a {
        font-size: .88rem;
        padding: 9px 14px;
    }
}

/* =========================================
   RESPONSIVE - CELULAR
========================================= */

@media (max-width: 767px) {

    .store-main-navbar .container-fluid,
    .clean-menu-bar .container-fluid,
    .store-menu-bar .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .logo-img {
        width: 38px;
        height: 38px;
    }

    .logo-text {
        font-size: 1.05rem;
    }

    .brand-stack small {
        letter-spacing: .4px;
    }

    .store-search {
        border-radius: 18px;
    }

    .search-input {
        height: 46px;
        padding-left: 38px;
        font-size: .84rem;
    }

    .btn-search-store {
        width: 48px;
        min-height: 46px;
    }

    .store-actions {
        gap: 8px !important;
    }

    .store-action-item {
        width: 100%;
        flex: 1 1 100%;
        justify-content: flex-start;
    }

    .store-action-icon,
    .store-cart-button {
        flex: 1 1 calc(50% - 8px);
    }

    .store-cart-button {
        justify-content: center;
    }

    .cart-text {
        display: none;
    }

    .clean-menu-center {
        min-height: 48px;
        padding-bottom: 2px;
    }

    .clean-menu-center a {
        font-size: .82rem;
        padding: 8px 12px;
    }

    .clean-menu-center a.active::after {
        left: 14px;
        right: 14px;
        bottom: 2px;
    }
}

/* =========================================
   RESPONSIVE - CELULAR PEQUEÑO
========================================= */

@media (max-width: 420px) {

    .brand-stack small {
        display: none;
    }

    .store-brand {
        max-width: 180px;
    }

    .search-input::placeholder {
        font-size: .78rem;
    }

    .store-action-item span {
        display: none;
    }

    .store-action-item {
        flex: 1 1 calc(50% - 8px);
        justify-content: center;
    }

    .clean-menu-center a {
        font-size: .78rem;
        padding: 8px 10px;
    }
}
.clean-menu-center .menu-offer.active {
    background: #fff1f2;
    color: #dc2626;
}

.clean-menu-center .menu-offer.active::after {
    background: linear-gradient(135deg, #dc2626, #fb7185);
}

/* Aplicacion fuerte de colores configurables */
.vialsa-store-header,
.store-main-navbar,
.store-header,
.store-nav-row {
    background: var(--vialsa-header, #0f3a5f) !important;
    color: var(--vialsa-header-text, #ffffff) !important;
}

.store-main-navbar a,
.store-main-navbar .nav-link,
.store-nav-row a,
.store-nav-row .nav-link,
.store-action-btn,
.store-action-item,
.store-action-item strong,
.store-action-icon,
.store-toggler {
    color: var(--vialsa-header-text, #ffffff) !important;
}

.store-action-item,
.store-action-icon,
.store-toggler {
    background: color-mix(in srgb, var(--vialsa-header-text, #ffffff) 12%, transparent) !important;
    border-color: color-mix(in srgb, var(--vialsa-header-text, #ffffff) 26%, transparent) !important;
}

.store-action-item i,
.brand-stack small,
.topbar-left i,
.topbar-right i {
    color: var(--vialsa-accent, #00a6d6) !important;
}

.store-topbar {
    background: var(--vialsa-header, #0f3a5f) !important;
    color: var(--vialsa-header-text, #ffffff) !important;
}

.clean-menu-bar,
.store-menu-bar {
    background: var(--vialsa-header, #0f3a5f) !important;
    color: var(--vialsa-header-text, #ffffff) !important;
}
.clean-menu-center .menu-offer.active {
    background: #fff1f2;
    color: #dc2626;
}

.clean-menu-center .menu-offer.active::after {
    background: linear-gradient(135deg, #dc2626, #fb7185);
}


/* =========================================
   SEDE GLOBAL DE COMPRA
========================================= */

.store-global-branch {
    border: 1px solid rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .08);
    color: var(--vialsa-header-text, #fff);
    border-radius: 14px;
    padding: 8px 10px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    max-width: 260px;
    min-width: 210px;
    text-align: left;
}

.store-global-branch > i {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .16);
    flex: 0 0 auto;
}

.store-global-branch span {
    min-width: 0;
    display: grid;
    line-height: 1.15;
}

.store-global-branch small,
.store-global-branch em,
.store-global-branch b {
    font-size: .68rem;
    font-style: normal;
    opacity: .82;
}

.store-global-branch strong,
.store-global-branch em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.store-global-branch strong {
    font-size: .86rem;
}

.store-global-branch b {
    color: #fde68a;
    white-space: nowrap;
}

.branch-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.branch-option-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    background: #fff;
}

.branch-option-card.active {
    border-color: var(--store-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .12);
}

#modalSedeGlobal {
    z-index: 1065 !important;
}

#modalSedeGlobal .modal-dialog,
#modalSedeGlobal .modal-content {
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

body > .modal-backdrop {
    z-index: 1050 !important;
}

.branch-option-card span {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: .72rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.branch-option-card h6 {
    margin: 0 0 5px;
    font-weight: 800;
}

.branch-option-card p,
.branch-option-card small {
    margin: 0;
    color: #64748b;
}

.branch-change-review ul {
    margin: 0;
    padding-left: 18px;
}

@media (max-width: 991.98px) {
    .store-global-branch {
        width: 100%;
        max-width: 100%;
        margin: 8px 0;
    }
}

@media (max-width: 575.98px) {
    .store-branch-dialog {
        align-items: flex-end;
        margin: 0;
        min-height: 100%;
    }

    .store-branch-dialog .modal-content {
        border-radius: 20px 20px 0 0 !important;
        max-height: 92vh;
    }

    .store-branch-dialog .modal-body {
        overflow-y: auto;
    }

    .branch-card-grid {
        grid-template-columns: 1fr;
    }

    .branch-option-card {
        flex-direction: column;
    }

    .branch-option-card .btn {
        width: 100%;
    }
}
