/* =============================================== */
/*   TEMPLATE 2 - Premium con Sidebar              */
/*   Sidebar oscuro + contenido cálido y vibrante  */
/* =============================================== */

:root {
    --font-head: 'Poppins', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;

    --bg: #fff7f4;
    --surface: #ffffff;
    --surface-alt: #fbeff0;
    --border: rgba(60, 20, 50, 0.09);
    --text: #231433;
    --text-muted: #75657f;
    --price: #231433;

    --accent: #e8456b;
    --accent-gradient: linear-gradient(135deg, #ff6b35 0%, #ec4899 100%);
    --accent-soft: rgba(236, 72, 153, 0.12);
    --accent-shadow: rgba(236, 72, 153, 0.3);

    --side-bg: #1b1030;
    --side-text: rgba(255, 255, 255, 0.92);
    --side-muted: rgba(255, 255, 255, 0.55);

    --radius: 18px;
    --radius-lg: 24px;
    --shadow-sm: 0 2px 12px rgba(60, 20, 50, 0.06);
    --shadow-md: 0 16px 34px rgba(60, 20, 50, 0.14);
    --sidebar-w: 264px;

    --header-bg: rgba(255, 247, 244, 0.88);
    --success: #16a34a;
    --danger: #dc2626;
}

/* ---------- Modo oscuro: ciruela suave con acentos cálidos ---------- */
:root[data-theme="dark"] {
    color-scheme: dark;

    --bg: #170f24;
    --surface: #221832;
    --surface-alt: #2c2140;
    --border: rgba(255, 220, 240, 0.1);
    --text: #f7eefb;
    --text-muted: #b8a6c6;
    --price: #ffffff;

    --accent: #ff7aa8;
    --accent-soft: rgba(255, 122, 168, 0.15);
    --accent-shadow: rgba(236, 72, 153, 0.35);

    --side-bg: #110a1c;

    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 16px 34px rgba(0, 0, 0, 0.45);

    --header-bg: rgba(23, 15, 36, 0.85);
    --success: #4ade80;
    --danger: #f87171;
}

:root[data-theme="dark"] .banner {
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}

html {
    scroll-padding-top: 80px;
}

/* ---------- Barra de anuncios ---------- */
.ticker {
    overflow: hidden;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.ticker-track {
    display: inline-flex;
    gap: 2.5rem;
    padding: 7px 0;
    animation: ticker 35s linear infinite;
}

@keyframes ticker {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ---------- Estructura ---------- */
.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 1100;
}

.sidebar-backdrop {
    display: none;
}

.sidebar-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 1rem;
    background:
        radial-gradient(circle at 0% 0%, rgba(236, 72, 153, 0.25), transparent 45%),
        radial-gradient(circle at 100% 100%, rgba(255, 107, 53, 0.18), transparent 40%),
        var(--side-bg);
    color: var(--side-text);
    overflow-y: auto;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.35rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.brand-logo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    color: #fff;
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}

.brand-text strong {
    font-family: var(--font-head);
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-text small {
    color: var(--side-muted);
    font-size: 0.75rem;
}

.sidebar-close {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.side-label {
    display: block;
    margin: 0.75rem 0.6rem 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--side-muted);
}

.side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--side-text);
    font-size: 0.92rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

.side-link:hover {
    background: rgba(255, 255, 255, 0.08);
}

.side-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.side-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.side-count {
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 22px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--side-muted);
    text-align: center;
}

.side-link.active {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 8px 18px rgba(236, 72, 153, 0.35);
}

.side-link.active .side-icon,
.side-link.active .side-count {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.side-link-hot .side-icon {
    color: #fb923c;
}

.side-help {
    margin-top: auto;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.side-help p {
    margin: 4px 0 10px;
    font-size: 0.83rem;
    color: var(--side-muted);
}

.side-help .btn {
    width: 100%;
}

/* ---------- Topbar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.topbar.scrolled {
    border-bottom-color: var(--border);
    box-shadow: 0 4px 18px rgba(60, 20, 50, 0.06);
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 28px;
}

.menu-btn,
.brand-mobile {
    display: none;
}

.brand-mobile strong {
    font-family: var(--font-head);
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-mobile .brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.topbar-search {
    max-width: 560px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* ---------- Contenido ---------- */
.main-inner {
    padding: 8px 28px 0;
    max-width: 1320px;
}

.banner {
    position: relative;
    padding: 1.75rem 2rem;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.25), transparent 35%),
        linear-gradient(120deg, #ff6b35 0%, #ec4899 55%, #8b5cf6 100%);
    color: #fff;
    overflow: hidden;
    box-shadow: 0 16px 36px rgba(236, 72, 153, 0.28);
}

.banner::after {
    content: '';
    position: absolute;
    right: -60px;
    bottom: -80px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.banner-text {
    position: relative;
    z-index: 1;
    max-width: 640px;
}

.banner-kicker {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.65rem;
}

.banner-title {
    font-size: clamp(1.45rem, 3vw, 2.1rem);
    font-weight: 800;
}

.banner-title span {
    color: #fff3c4;
}

.banner-desc {
    margin: 0.5rem 0 1.1rem;
    opacity: 0.92;
    font-size: 0.97rem;
}

.banner .how-to-buy {
    position: relative;
    z-index: 1;
}

.banner .how-to-buy li {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.9);
}

.banner .how-to-buy strong {
    color: #fff;
}

.banner .step-icon {
    background: #fff;
    color: var(--accent);
}

.mobile-chips {
    display: none;
    margin-top: 1rem;
}

.site-footer {
    margin-top: 0.5rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .app {
        /* minmax(0, …) evita que las filas con scroll horizontal ensanchen la página */
        grid-template-columns: minmax(0, 1fr);
    }

    /* Sidebar como menú lateral deslizable */
    .sidebar {
        position: fixed;
        inset: 0;
        height: auto;
        z-index: 5200;
        visibility: hidden;
        pointer-events: none;
    }

    .sidebar.open {
        visibility: visible;
        pointer-events: auto;
    }

    .sidebar-backdrop {
        display: block;
        position: absolute;
        inset: 0;
        background: rgba(15, 10, 30, 0.55);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar.open .sidebar-backdrop {
        opacity: 1;
    }

    .sidebar-panel {
        position: relative;
        width: 290px;
        max-width: 85%;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.open .sidebar-panel {
        transform: none;
    }

    .sidebar-close {
        display: block;
    }

    .menu-btn,
    .brand-mobile {
        display: flex;
    }

    .brand-mobile {
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    .topbar-inner {
        flex-wrap: wrap;
        padding: 10px 20px;
    }

    .topbar-search {
        order: 10;
        flex: 1 1 100%;
        max-width: none;
    }

    .main-inner {
        padding: 8px 20px 0;
    }

    .mobile-chips {
        display: flex;
    }

    html {
        scroll-padding-top: 130px;
    }
}

@media (max-width: 720px) {
    .hide-mobile {
        display: none;
    }

    .icon-btn {
        padding: 0;
        width: 42px;
    }
}

@media (max-width: 560px) {
    .topbar-inner {
        padding: 8px 14px;
        gap: 8px;
    }

    .main-inner {
        padding: 6px 14px 0;
    }

    .banner {
        padding: 1.25rem;
        border-radius: 20px;
    }

    .banner-desc {
        font-size: 0.9rem;
        margin-bottom: 0.9rem;
    }

    .step-icon {
        width: 26px;
        height: 26px;
        font-size: 0.72rem;
    }

    .search-box input {
        height: 42px;
    }

    .chip {
        height: 34px;
        font-size: 0.82rem;
    }

    .ticker {
        font-size: 0.72rem;
    }
}

.main {
    min-width: 0;
}
