/* =========================================================
   BASE.CSS
   ========================================================= */

/* Tipografía y contenedor app (móvil) */
body {
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

header {
    position: relative;
    z-index: 1000;
}

.app {
    max-width: 420px;
    margin-inline: auto;
    padding: 1rem 0.75rem 4rem;
}

/* =========================================================
   HEADER iOS STYLE
   ========================================================= */

.global-header-ios {
    width: 100%;
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0.75rem 1.5rem;
    background-color: var(--fondo-principal);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(6px);
}

.global-header-ios .greeting {
    display: flex;
    flex-direction: column;
}

.global-header-ios .small-title {
    font-weight: 600;
    font-size: 1.6rem;
    margin: 0;
    color: var(--texto-principal);
}

/* Botones tipo iOS */
.badge-ios {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: var(--comp-principal);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
    text-decoration: none;
    color: var(--azul-principal);
    font-size: 1.3rem;
}

.badge-ios:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.badge-ios img.icon {
    width: 1.5rem;
    height: 1.5rem;
}

/* Premium específico */
.badge-ios.premium {
    background: var(--plan-premium);
    color: #fff;
}

/* Home específico */
.badge-ios.home {
    background-color: var(--comp-principal);
    color: var(--azul-principal);
}

/* Perfil específico */
.badge-ios.profile {
    background-color: var(--comp-principal);
    color: var(--azul-principal);
}

/* Ajuste responsive para móviles */
@media (max-width: 768px) {
    .global-header-ios {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 1rem;
        gap: 1rem;
        border-radius: 12px;
    }

    .global-header-ios .buttons-container {
        margin-top: 0.75rem;
        width: 100%;
        display: flex;
        justify-content: flex-start;
        gap: 0.75rem;
        flex-wrap: wrap;
    }
}

/* =========================================================
   TABS
   ========================================================= */
.tabs {
    border-bottom: 1px solid var(--outline);
}

.tab-btn {
    background: transparent;
    color: #b9c0c7;
    border: none;
    font-weight: 600;
    font-size: 1.2rem;
    padding: 0.5rem 0.25rem;
    transition: color 0.2s ease;
}

.tab-btn.active {
    color: var(--accent);
}

.tab-btn:hover {
    color: var(--accent-200);
}

.tab-sep {
    color: #3d434a;
    font-weight: 600;
    margin: 0 0.5rem;
}

/* =========================================================
   CONTADOR
   ========================================================= */
.counter {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.counter .sep {
    color: #8f949a;
    font-weight: 500;
}

/* =========================================================
   TOGGLE
   ========================================================= */
.toggle-pill {
    --h: 40px;
    height: var(--h);
    min-width: 96px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    user-select: none;
    border: 1px solid var(--outline);
    background: #1e2023;
    font-weight: 700;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.toggle-pill span {
    font-size: 0.95rem;
    margin-left: 0.25rem;
    color: var(--muted);
    transition: color 0.2s ease, transform 0.25s ease;
}

.toggle-pill .dot {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #fff;
    margin-left: auto;
    transition: transform 0.2s ease, background 0.25s ease;
}

.toggle-pill.on {
    background: rgba(39, 200, 64, 0.15);
    border-color: rgba(39, 200, 64, 0.25);
}

.toggle-pill.on .dot {
    background: #eafff3;
    transform: translateX(-52px);
}

.toggle-pill.on span {
    color: #dfffe9;
    transform: translateX(48px);
}

/* =========================================================
   HELPERS
   ========================================================= */
.rounded-apple {
    border-radius: var(--radio-apple);
}

/* =========================================================
   MEDIA QUERIES (ajustes para pantallas mayores)
   ========================================================= */
@media (min-width: 768px) {
    .app {
        max-width: 700px;
    }

    .small-title {
        font-size: 2.1rem;
    }

    .search-card .card-body {
        padding: 1.25rem;
    }
}

/* Otras clases */
.cursor-pointer{
    cursor: pointer;
}

/* Botones tipo píldora */
.btn-pill {
    width: auto;
    min-width: 160px;
    max-width: 100%;
    padding-inline: 1.25rem;
    white-space: nowrap; /* evita cortes feos */
}

/* Botón para ir arriba */
#backToTop {
    position: fixed;
    bottom: 40px;
    right: 40px;
    display: none;
    z-index: 100;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    justify-content: center;
    align-items: center;
}

/* En móviles pequeños */
@media (max-width: 480px) {
    /* Hacer que el botón tipo pill ocupe todo el ancho disponible */
    .btn-pill {
        width: 100%;
        text-align: center;
    }

    /* Esquinar más el botón de ir arriba */
    #backToTop {
        bottom: 10px;
        right: 10px;
    }
}