/* =========================================================
   App Clientes - Ajustes Globales
   ========================================================= */

body {
    background: #f6f7fb;
}

/* ✅ Evita que el topbar fijo pise el contenido */
body:not(.no-topbar) .page-content {
    padding-top: 72px;
    /* probá 64–80 según alto real del header */
    padding-bottom: 90px;
    /* altura del menubar + aire */
}

/* Si en desktop cambia el alto del header */
@media (min-width: 992px) {
    body:not(.no-topbar) .page-content {
        padding-top: 80px;
        padding-bottom: 40px;
    }
}

/* ✅ Cuando ocultamos topbar, no necesitamos padding */
.no-topbar .page-content {
    padding-top: 0 !important;
    padding-bottom: 90px;
    /* altura del menubar + aire */
}

.header {
    background: #ffffff;
    z-index: 999;
}

.header .material-icons-outlined {
    font-size: 22px;
    color: #333;
}

.header .btn-link {
    text-decoration: none;
    color: inherit;
}

.header .small {
    font-size: 13px;
    letter-spacing: 0.3px;
}

/* Topbar icons oscuro */
.header .back-btn,
.header .theme-btn,
.header .logout-btn,
.header .back-btn i,
.header .logout-btn i,
.header .theme-btn svg {
    color: #111 !important;
    stroke: #111 !important;
    opacity: 1 !important;
}

.header .logout-btn {
    background: transparent;
    border: 0;
    padding: 0;
}

/* =========================================================
   Wrapper Global Desktop
   ========================================================= */

.app-container {
    width: 100%;
    margin: 0 auto;
}

@media (min-width:992px) {
    .app-container {
        max-width: 1120px;
        padding-left: 18px;
        padding-right: 18px;
    }
}

/* Centrar menubar en desktop */
@media (min-width:992px) {
    .menubar-area {
        left: 0;
        right: 0;
        margin: 0 auto;
        max-width: 1120px;
        border-radius: 18px 18px 0 0;
        overflow: hidden;
    }
}

/* =========================================================
   HERO Dashboard (Full Width Real)
   ========================================================= */

.home-hero {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);

    background: var(--emedos-gradient) !important;
    color: #fff;
    border-bottom-left-radius: 26px;
    border-bottom-right-radius: 26px;
    padding: 18px 0 20px;
}

.home-hero-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.home-hero-greet {
    color: rgba(255, 255, 255, .9);
    font-size: 13px;
}

.home-hero-name {
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
}

.home-hero-avatar {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    object-fit: cover;
    background: rgba(255, 255, 255, .18);
}

.home-after-hero {
    margin-top: 14px;
}


/* ===== Hero actions (logout + avatar) ===== */
.hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hero-logout-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: all .2s ease;
}

.hero-logout-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.05);
}

:root {
    --emedos-blue-primary: #0d6efd;
    /* Azul principal */
    --emedos-blue-dark: #084298;
    /* Azul profundo */
    --emedos-blue-soft: #3d8bfd;
    /* Azul intermedio */
    --emedos-blue-light: #e7f1ff;
    /* Fondo suave */
    --emedos-gradient: linear-gradient(135deg, #0d6efd 0%, #084298 100%);

    --hero-bg: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
}

/* Topbar mismo fondo que hero */
.header.transparent {
    background: var(--emedos-gradient) !important;
    color: #fff;
}

/* Iconos blancos */
.header.transparent .back-btn i,
.header.transparent .theme-btn svg {
    color: #fff !important;
    stroke: #fff !important;
}

/* Logout circular estilo hero */
.hero-circle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all .2s ease;
}

.hero-circle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* Avatar igual que hero */
.home-hero-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .4);
    object-fit: cover;
}

/* =========================================================
   Novedades - Carousel estilo card
   ========================================================= */

.novedades-swiper {
    margin-top: 8px;
}

/* Padding real aplicado al wrapper (Swiper safe) */
.novedades-swiper .swiper-wrapper {
    padding-left: 14px !important;
    padding-right: 14px !important;
    box-sizing: border-box;
}

/* Slide mobile */
.novedades-swiper .swiper-slide {
    width: 88vw;
    max-width: 420px;
    box-sizing: border-box;
}

.dz-banner-card {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .08);
}

.dz-banner-card img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;
}

/* Desktop */
@media (min-width:768px) {
    .novedades-swiper .swiper-wrapper {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .novedades-swiper .swiper-slide {
        width: 360px;
        max-width: 360px;
    }

    .dz-banner-card img {
        height: 180px;
    }
}

/* =========================================================
   Card Resumen Pedidos
   ========================================================= */

.pedidos-resumen-card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, #3843df 0%, #1e38af 100%);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .10);
}

.pedidos-resumen-card .card-body {
    padding: 16px;
}

.pedidos-resumen-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pedidos-resumen-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .18);
}

.pedidos-resumen-num {
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
}

.pedidos-resumen-label {
    margin-top: 3px;
    font-size: 13px;
    opacity: .92;
}

.pedidos-resumen-arrow {
    margin-left: auto;
    opacity: .9;
}

/* =========================================================
   Accesos rápidos
   ========================================================= */

.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
}

.quick-iconbox {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 0 10px 20px rgba(0, 0, 0, .05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-label {
    margin-top: 8px;
    font-size: 12px;
    opacity: .85;
    text-align: center;
}

/* Desktop más columnas */
@media (min-width:992px) {
    .quick-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width:1200px) {
    .quick-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

/* ===== Novedades: paginación horizontal (evita vertical del theme) ===== */
.novedades-title-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.novedades-pagination {
    position: static !important;
    /* evita que se vaya a la derecha */
    width: auto !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px;
    margin: 0 !important;
    padding: 0 !important;
}

/* bullets estilo línea */
.novedades-pagination .swiper-pagination-bullet {
    width: 18px;
    height: 5px;
    border-radius: 999px;
    opacity: .25;
    margin: 0 !important;
    /* Swiper suele meter margin */
}

.novedades-pagination .swiper-pagination-bullet-active {
    opacity: 1;
}

/* ===== Padding lateral en mobile para todas las secciones ===== */
.page-pad {
    padding-left: 14px;
    padding-right: 14px;
}

@media (min-width:768px) {
    .page-pad {
        padding-left: 0;
        padding-right: 0;
    }
}

/* ===== Estado de cuenta (minimal) ===== */
.estado-cuenta-card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .08);
}

.estado-cuenta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.estado-cuenta-num {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
}

.estado-cuenta-label {
    margin-top: 4px;
    font-size: 13px;
    opacity: .9;
}

.estado-cuenta-arrow {
    opacity: .9;
}

/* Rojo / Verde */
.estado-rojo {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
}

.estado-verde {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.btn-primary {
    background-color: var(--emedos-blue-primary);
    border-color: var(--emedos-blue-primary);
}

.btn-primary:hover {
    background-color: var(--emedos-blue-dark);
    border-color: var(--emedos-blue-dark);
}

.card-highlight {
    background: var(--emedos-blue-light);
    border-radius: 16px;
}

/* =========================
   LOGIN (Jobie)
========================= */

.auth-hero {
    position: relative;
    padding: 34px 0 78px;
    background: radial-gradient(1200px 420px at 20% 10%, rgba(255, 255, 255, .22), transparent 60%),
        linear-gradient(135deg, #0B2A66 0%, #0A4BA8 45%, #0B2A66 100%);
    overflow: hidden;
}

.auth-hero:after {
    content: "";
    position: absolute;
    inset: -60px -80px auto auto;
    width: 220px;
    height: 220px;
    background: rgba(255, 255, 255, .12);
    border-radius: 999px;
    filter: blur(0.5px);
}

.auth-hero-inner {
    position: relative;
    z-index: 1;
}

.auth-brand {
    max-width: 520px;
    margin: 0 auto;
    padding: 0 14px;
    text-align: center;
}

.auth-logo {
    width: 150px;
    height: auto;
    margin-bottom: 10px;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .18));
}

.auth-title {
    color: #fff;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: .2px;
}

.auth-subtitle {
    margin-top: 4px;
    color: rgba(255, 255, 255, .82);
    font-size: 13px;
}

.auth-content {
    margin-top: -52px;
    /* hace el efecto “card flotante” */
    padding-bottom: 24px;
}

.auth-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(10, 20, 40, .18);
    padding: 18px;
}

.auth-label {
    font-size: 13px;
    font-weight: 700;
    color: rgba(20, 30, 50, .85);
    margin-bottom: 8px;
}

.auth-input {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(10, 60, 160, .06);
    border: 1px solid rgba(10, 60, 160, .10);
    border-radius: 14px;
    padding: 10px 12px;
}

.auth-input .material-icons-outlined {
    font-size: 20px;
    color: rgba(10, 60, 160, .75);
}

.auth-input .form-control {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    height: 22px;
    font-size: 14px;
}

.auth-btn {
    border-radius: 14px;
    padding: 12px 14px;
    font-weight: 800;
    margin-top: 8px;
}

.auth-help {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 0, 0, .06);
}

.auth-help-text {
    text-align: center;
    font-size: 12.5px;
    color: rgba(20, 30, 50, .70);
    margin-bottom: 10px;
}

.auth-btn-outline {
    border-radius: 14px;
    padding: 11px 14px;
    font-weight: 800;
}

.auth-footer {
    margin-top: 14px;
    text-align: center;
}

.auth-footer-text {
    font-size: 11.5px;
    color: rgba(20, 30, 50, .55);
}

/* =========================
   PWA Install Banner (Pro)
========================= */
.pwa-install {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    /* evita pisar menubar */
    z-index: 9999;

    transform: translateY(18px);
    opacity: 0;
    pointer-events: none;

    transition: transform .28s ease, opacity .28s ease;
}

.pwa-install.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.pwa-install__inner {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 12px 12px;
    border-radius: 16px;

    background: linear-gradient(135deg, #0B5ED7 0%, #0D6EFD 55%, #2F8BFF 100%);
    color: #fff;

    box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
    border: 1px solid rgba(255, 255, 255, .18);

    backdrop-filter: blur(6px);
}

.pwa-install__icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .12);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
}

.pwa-install__icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .25));
}

.pwa-install__text {
    flex: 1 1 auto;
    min-width: 0;
}

.pwa-install__title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.1;
}

.pwa-install__subtitle {
    font-size: 12px;
    opacity: .9;
    line-height: 1.2;
    margin-top: 2px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-install__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.pwa-btn {
    border: 0;
    outline: none;
    border-radius: 12px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    font-weight: 700;
    font-size: 13px;
}

.pwa-btn--primary {
    background: rgba(255, 255, 255, 0.96);
    color: #0D6EFD;
}

.pwa-btn--primary:active {
    transform: translateY(1px);
}

.pwa-btn--ghost {
    background: rgba(255, 255, 255, .14);
    color: #fff;
    width: 36px;
    padding: 0;
}

.pwa-btn--ghost .material-icons-outlined {
    font-size: 20px;
}

/* En desktop centramos el banner con max-width (tu estándar) */
@media (min-width: 992px) {
    .pwa-install {
        max-width: 520px;
        left: 50%;
        right: auto;
        transform: translate(-50%, 18px);
    }

    .pwa-install.is-visible {
        transform: translate(-50%, 0);
    }
}