* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    padding-bottom: 80px;
}

/* Header */
.header {
    background-color: #d4d4d4;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status {
    margin: 8px 16px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
}

.status.loading {
    background: #fffbe6;
    color: #8a6d3b;
    border: 1px solid #ffecb5;
}

.status.success {
    background: #e6ffed;
    color: #2c7a7b;
    border: 1px solid #b7f7c8;
}

.status.error {
    background: #ffe6e6;
    color: #9b2c2c;
    border: 1px solid #f5b7b7;
}

.menu-icon,
.notification-icon {
    cursor: pointer;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    color: #555;
}

.menu-icon:hover,
.notification-icon:hover {
    color: #2f2f2f;
}

svg.icon {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}

.notification-icon svg {
    stroke-width: 1.6;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo img {
    height: 36px;
    width: auto;
}

.notification-icon {
    position: relative;
}

/* Side menu */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
    z-index: 1000;
}

.menu-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 260px;
    background: #f5f0ff;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    padding: 24px 20px 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    transform: translateX(-110%);
    transition: transform 0.25s ease;
    z-index: 1001;
}

.side-menu.open {
    transform: translateX(0);
}

.side-menu__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.side-menu__title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.close-menu {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    padding: 4px;
}

.close-menu svg {
    width: 20px;
    height: 20px;
}

.side-menu__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-menu__item {
    padding: 10px 8px;
    border-radius: 8px;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.side-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: block;
}

.side-menu__text {
    display: inline-block;
}

.side-menu__item:hover {
    background: rgba(90, 79, 207, 0.12);
    color: #3c318f;
}

/* Search Bar */
.search-container {
    padding: 16px;
    background-color: #f5f5f5;
}

.search-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    display: block;
}

.search-box {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 2px solid #333;
    border-radius: 4px;
    font-size: 16px;
    background-color: white;
    position: relative;
}

.search-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    display: flex;
    align-items: center;
}

/* Activity Card */
.activity-card {
    margin: 16px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.activity-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.activity-content {
    padding: 16px;
}

.activity-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.activity-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* Tabs */
.tabs {
    display: flex;
    padding: 0 16px;
    border-bottom: 1px solid #ddd;
    background-color: #f5f5f5;
    gap: 24px;
    justify-content: center;
}

.tab {
    padding: 10px 12px;
    font-size: 15px;
    color: #666;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 44px;
    height: 44px;
    border-radius: 8px;
}

.tab.active {
    color: #5a4fcf;
    font-weight: 600;
    background: rgba(90, 79, 207, 0.06);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #5a4fcf;
}

.tab-icon svg {
    width: 18px;
    height: 18px;
}

/* Mostrar etiquetas debajo de los iconos y que las pestañas ocupen todo el ancho */
.tabs {
    width: 100%;
    display: flex;
    gap: 0;
    padding: 0 6px;
}

.tabs .tab {
    padding: 8px 6px;
    justify-content: center;
    align-items: center;
    display: inline-flex;
    flex-direction: column;
    flex: 1 1 0;
    text-align: center;
    min-width: 0;
    gap: 6px;
    height: 64px;
    border-radius: 8px;
}

.tabs .tab-label {
    display: block;
    font-size: 12px;
    color: #666;
    line-height: 1;
}

.tabs .tab .tab-icon {
    display: block;
}

/* ajustar tamaño de iconos para mejor centrado */
.tab-icon svg {
    width: 20px;
    height: 20px;
}

/* Estilos específicos para el icono Fuel */
.tab[data-tab="fuel"] .tab-icon img.icon {
    width: 20px;
    height: 20px;
    display: block;
}

/* Asegurar que otros iconos queden alineados: reducir su tamaño si es <img> */
.tab-icon img.icon {
    width: 20px;
    height: 20px;
    display: block;
}

/* Iconos rellenos (utilizar cuando quieras un icono sólido) */
.icon-filled {
    fill: currentColor;
    stroke: none;
}

.tab-icon .icon-filled {
    width: 22px;
    height: 22px;
    display: block;
}

/* Content Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* News List */
.news-list {
    padding: 8px 16px 16px;
    background-color: #f5f5f5;
}

.news-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.news-image {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Video thumbnail pequeño (igual que imágenes) */
.news-video-thumb {
    position: relative;
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
}

.news-video-thumb .news-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    pointer-events: none;
}

.news-video-thumb:hover .video-play-icon {
    background: rgba(0, 0, 0, 0.9);
}

/* Video Overlay Modal */
#videoOverlay {
    background: rgba(0, 0, 0, 0.95);
}

.video-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.video-modal-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 16px 16px;
}

.video-full {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    border-radius: 8px;
}

#youtubePlayer {
    aspect-ratio: 16/9;
    max-height: 80vh;
}

.news-content {
    flex: 1;
}

.news-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.activity-description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Weather Forecast */
.weather-forecast {
    padding: 16px;
    background-color: #f5f5f5;
}

.weather-day {
    padding: 16px;
    background: white;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.weather-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.weather-day-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.weather-day-name {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    min-width: 80px;
}

.weather-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5a4fcf;
}

.weather-icon svg {
    width: 32px;
    height: 32px;
}

.weather-temp {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.weather-temp-max {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.weather-temp-min {
    font-size: 14px;
    color: #999;
}

.weather-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

@media (max-width: 480px) {
    .weather-details {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Ajustes específicos para la sección de Sucursales */
    .branches-container {
        padding: 10px 12px;
        margin-top: 6px;
    }

    .branches-list h3 {
        display: none;
    }

    .branches-list {
        margin-bottom: 8px;
    }

    #branchesMap {
        margin-top: 6px;
    }

    #branchIframe {
        min-height: 260px;
        height: 320px;
    }


    /* Estilos generales para mejorar apariencia de Sucursales */
    .branches-container {
        padding: 12px 16px;
    }

    .branches-list h3 {
        display: none;
    }

    .branches-list {
        margin-bottom: 8px;
    }

    #branchesMap {
        margin-top: 8px;
        border-radius: 12px;
        box-shadow: 0 6px 18px rgba(60, 49, 143, 0.08);
        overflow: hidden;
    }

    #branchIframe {
        width: 100%;
        height: 420px;
        border: 0;
        display: block;
        transition: opacity 0.18s ease, transform 0.18s ease;
        opacity: 1;
    }

    /* Hacer el selector más compacto y subirlo visualmente */
    #branchesSelect {
        padding: 8px 10px;
        height: 36px;
    }

    .branches-list label {
        margin-right: 8px;
    }

    .weather-day-name {
        min-width: 60px;
        font-size: 14px;
    }
}

.weather-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.weather-detail-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.weather-detail-value {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.weather-loading {
    padding: 40px 16px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.weather-error {
    padding: 40px 16px;
    text-align: center;
    color: #d32f2f;
    font-size: 14px;
}

/* Market Section */
.market-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.market-item-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.market-item-price {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.market-item-change {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
}

.market-item-change.positive {
    color: #2e7d32;
}

.market-item-change.negative {
    color: #d32f2f;
}

/* View All Link */
.view-all {
    text-align: center;
    padding: 16px;
    background-color: #f5f5f5;
}

.view-all a {
    color: #5a4fcf;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.overlay.open {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    width: 100%;
    max-width: 640px;
    padding: 24px;
    max-height: 80vh;
    overflow: auto;
}

.modal h3 {
    font-size: 20px;
    color: #1a1a1a;
    margin-bottom: 8px;
    font-weight: 600;
}

/* Asegurar contraste de texto dentro de modales en modo claro y oscuro */
.overlay .modal,
.overlay .modal * {
    color: var(--text-primary) !important;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 12px;
}

.btn {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1.5px solid #e0e0e0;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn.secondary {
    background: #fff;
    color: #1a1a1a;
}

.btn.primary {
    background: #3c318f;
    color: #fff;
    border-color: #3c318f;
}

.image-full {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

/* Products grid */
.product-search {
    padding: 12px 16px;
    background: #f5f5f5;
}

.product-search input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    background: white;
    font-size: 14px;
    outline: none;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px 12px 80px;
}

@media (min-width: 720px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    cursor: pointer;
}

.product-card img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    display: block;
}

.product-card .product-label {
    padding: 10px;
    text-align: center;
    font-weight: 600;
    color: #333;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), #ffffff);
}

.product-grid a {
    text-decoration: none;
}

.product-card .product-label small {
    display: block;
    margin-top: 6px;
    font-weight: 500;
    color: #666;
    font-size: 13px;
}

/* ── CSS Custom Properties ── */
:root {
    color-scheme: light dark;
    --primary: #5a4fcf;
    --primary-hover: rgba(90, 79, 207, 0.12);
    --muted: #666;
    --bg-main: #f5f5f5;
    --bg-card: #ffffff;
    --bg-header: #d4d4d4;
    --bg-side-menu: #f5f0ff;
    --text-primary: #333;
    --text-secondary: #666;
    --text-heading: #1a1a1a;
    --border-color: #e0e0e0;
    --border-light: #ddd;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --overlay-bg: rgba(0, 0, 0, 0.35);
    --nav-bg: #ffffff;
    --loader-bg: #ffffff;
    --loader-bar-bg: #eee;
    --input-bg: #ffffff;
}

body.dark-mode {
    --primary: #7b71e0;
    --primary-hover: rgba(123, 113, 224, 0.18);
    --muted: #9ca3af;
    --bg-main: #121218;
    --bg-card: #1e1e2a;
    --bg-header: #1a1a24;
    --bg-side-menu: #1a1a28;
    --text-primary: #e4e4e7;
    --text-secondary: #9ca3af;
    --text-heading: #f3f3f5;
    --border-color: #2e2e3a;
    --border-light: #2a2a36;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --overlay-bg: rgba(0, 0, 0, 0.6);
    --nav-bg: #16161e;
    --loader-bg: #121218;
    --loader-bar-bg: #2a2a36;
    --input-bg: #1e1e2a;
}

/* Apply variables to core elements */
body.dark-mode {
    background-color: var(--bg-main);
    color: var(--text-primary);
}

body.dark-mode .header {
    background-color: var(--bg-header);
    box-shadow: 0 2px 4px var(--shadow-color);
}

body.dark-mode .menu-icon,
body.dark-mode .notification-icon {
    color: var(--text-secondary);
}

body.dark-mode .side-menu {
    background: var(--bg-side-menu);
    box-shadow: 2px 0 12px var(--shadow-color);
}

body.dark-mode .side-menu__title {
    color: var(--text-primary);
}

body.dark-mode .close-menu {
    color: var(--text-secondary);
}

body.dark-mode .side-menu__item {
    color: var(--text-primary);
}

body.dark-mode .side-menu__item:hover {
    background: var(--primary-hover);
    color: var(--primary);
}

body.dark-mode .activity-card {
    background: var(--bg-card);
    box-shadow: 0 2px 8px var(--shadow-color);
}

body.dark-mode .activity-title {
    color: var(--text-primary);
}

body.dark-mode .activity-description {
    color: var(--text-secondary);
}

body.dark-mode .tabs {
    background-color: var(--bg-main);
    border-bottom-color: var(--border-light);
}

body.dark-mode .tab {
    color: var(--text-secondary);
}

body.dark-mode .tab.active {
    color: var(--primary);
    background: var(--primary-hover);
}

body.dark-mode .tab.active::after {
    background-color: var(--primary);
}

body.dark-mode .tabs .tab-label {
    color: var(--text-secondary);
}

body.dark-mode .news-list {
    background-color: var(--bg-main);
}

body.dark-mode .news-item {
    background: var(--bg-card);
    box-shadow: 0 1px 4px var(--shadow-color);
}

body.dark-mode .news-title {
    color: var(--text-primary);
}

body.dark-mode .view-all {
    background-color: var(--bg-main);
}

body.dark-mode .view-all a {
    color: var(--primary);
}

body.dark-mode .weather-forecast {
    background-color: var(--bg-main);
}

body.dark-mode .weather-day {
    background: var(--bg-card);
    box-shadow: 0 1px 4px var(--shadow-color);
}

body.dark-mode .weather-day-name {
    color: var(--text-primary);
}

body.dark-mode .weather-temp-max {
    color: var(--text-primary);
}

body.dark-mode .weather-temp-min {
    color: var(--text-secondary);
}

body.dark-mode .weather-description {
    color: var(--text-secondary);
}

body.dark-mode .weather-details {
    border-top-color: var(--border-light);
}

body.dark-mode .weather-detail-label {
    color: var(--text-secondary);
}

body.dark-mode .weather-detail-value {
    color: var(--text-primary);
}

body.dark-mode .weather-loading {
    color: var(--text-secondary);
}

body.dark-mode .product-search {
    background: var(--bg-main);
}

body.dark-mode .product-search input {
    background: var(--input-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-mode .product-card {
    background: var(--bg-card);
    box-shadow: 0 1px 6px var(--shadow-color);
}

body.dark-mode .product-card .product-label {
    color: var(--text-primary);
    background: linear-gradient(180deg, rgba(30, 30, 42, 0), var(--bg-card));
}

body.dark-mode .product-card .product-label small {
    color: var(--text-secondary);
}

body.dark-mode .bottom-nav {
    background: var(--nav-bg);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.15);
    border-top-color: var(--border-color);
}

body.dark-mode .modal {
    background: var(--bg-card);
}

body.dark-mode .modal h3 {
    color: var(--text-heading);
}

body.dark-mode .btn.secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.dark-mode .overlay {
    background: var(--overlay-bg);
}

body.dark-mode .sw-update-banner {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body.dark-mode .sw-update-text {
    color: var(--text-primary);
}

body.dark-mode .card {
    background: var(--bg-card);
}

body.dark-mode #appLoader {
    background: var(--loader-bg);
}

body.dark-mode #appLoader .loader-title {
    color: var(--text-primary);
}

body.dark-mode #appLoader .loader-bar {
    background: var(--loader-bar-bg);
}

/* Dark mode icons: invert dark icons so they're visible on dark backgrounds */
body.dark-mode .side-icon:not(svg):not(span) {
    filter: invert(0.85) hue-rotate(180deg);
}

body.dark-mode .tab-icon img.icon {
    filter: invert(0.85) hue-rotate(180deg);
}



body.dark-mode .header svg.icon {
    stroke: var(--text-primary);
}

/* Fix for logo color in dark mode */
body.dark-mode .logo img {
    filter: none !important;
    -webkit-filter: none !important;
    isolation: isolate;
}

body.dark-mode .bottom-nav svg.icon {
    stroke: var(--text-primary);
}

body.dark-mode .nav-item.active svg.icon {
    stroke: var(--primary);
}

/* ── Dark Mode Toggle Switch (sidebar) ── */
.dark-mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 8px;
    margin-top: auto;
    border-top: 1px solid var(--border-light);
}

.dark-mode-toggle__label {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    user-select: none;
    cursor: pointer;
}

.dark-mode-toggle__switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.dark-mode-toggle__switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.dark-mode-toggle__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    transition: background 0.25s ease;
}

.dark-mode-toggle__slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.dark-mode-toggle__switch input:checked+.dark-mode-toggle__slider {
    background: var(--primary);
}

.dark-mode-toggle__switch input:checked+.dark-mode-toggle__slider::before {
    transform: translateX(20px);
}

/* Bottom Navigation - mejorada */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 8px 6px;
    box-shadow: 0 -6px 20px rgba(16, 16, 24, 0.06);
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    z-index: 40;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 6px 6px 10px;
    flex: 1 1 auto;
    min-width: 64px;
    min-height: 56px;
    /* buen tamaño táctil */
    transition: color 160ms ease;
    color: var(--muted);
}

/* círculo detrás del icono para mejor legibilidad y consistencia */
.nav-icon {
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    transition: background-color 160ms ease, transform 160ms ease, color 160ms ease;
}

.nav-icon svg {
    width: 22px;
    height: 22px;
    display: block;
    stroke: currentColor;
    fill: none;
    transition: fill 160ms ease, stroke 160ms ease, transform 160ms ease;
}

/* estado activo: color primario y fondo sutil redondeado */
.nav-item.active {
    color: var(--primary);
}

/* Ajustes para iconos SVG usados dentro del menú lateral */
.side-menu .nav-icon {
    width: 22px;
    height: 22px;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.side-menu .nav-icon svg {
    width: 22px;
    height: 22px;
}

.nav-item.active .nav-icon {
    background: rgba(90, 79, 207, 0.10);
    transform: translateY(-2px);
    color: var(--primary);
    box-shadow: 0 6px 14px rgba(60, 49, 143, 0.06);
}

.nav-label {
    font-size: 12px;
    color: inherit;
    transition: color 160ms ease, opacity 160ms ease;
    opacity: 0.95;
    line-height: 1;
}

/* reducir ruido en estados inactivos */
.nav-item:not(.active):hover .nav-icon {
    background: rgba(0, 0, 0, 0.03);
    transform: translateY(-1px);
}

/* Tamaño en pantallas grandes */
@media (min-width: 720px) {

    /* En pantallas grandes dejar la barra inferior ocupando todo el ancho */
    .bottom-nav {
        max-width: none;
        width: 100%;
        margin: 0;
        left: 0;
        right: 0;
    }
}

/* Iconos rellenos al activar: aplica fill cuando el item está activo */
.nav-item.active .nav-icon svg {
    fill: currentColor;
    stroke: none;
}

/* Mejor interacción para iconos en el header */
.menu-icon,
.notification-icon {
    border-radius: 10px;
    transition: background-color 160ms ease, transform 160ms ease, color 160ms ease;
    padding: 6px;
}

/* Banner para notificar actualización del Service Worker */
.sw-update-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 76px;
    /* encima de la bottom-nav */
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 6px 20px rgba(16, 16, 24, 0.08);
    border-radius: 10px;
    z-index: 1100;
    padding: 10px;
}

.sw-update-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sw-update-text {
    font-size: 14px;
    color: #222;
}

.sw-update-actions {
    display: flex;
    gap: 8px;
}

.sw-update-actions .btn {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: transparent;
    cursor: pointer
}

.sw-update-actions .btn.primary {
    background: var(--primary);
    color: #fff;
    border: none
}

.menu-icon:hover,
.notification-icon:hover {
    background: rgba(0, 0, 0, 0.03);
    transform: translateY(-1px);
    color: var(--primary);
}

.menu-icon .icon svg,
.notification-icon .icon svg {
    width: 20px;
    height: 20px;
    transition: fill 160ms ease, stroke 160ms ease, transform 160ms ease;
}

/* Si en el futuro deseas que los iconos del header también se rellenen al activarlos, usa:
           .menu-icon.active .icon svg { fill: currentColor; stroke: none; } */