/* ==========================================================
   TIKTOK GIFTS CATALOG ? MODERN UI 2026
   Responsive ? Premium ? Clean ? Mobile First
   Compatible con la estructura HTML actual
   ========================================================== */
/* ==========================================================
   TIKTOK GIFTS CATALOG � MODERN UI 2026 (CORREGIDO)
   ========================================================== */
/* ==========================================================
   TIKTOK GIFTS CATALOG � MODERN UI 2026 (MINI VERSION)
   ========================================================== */

:root {
    --gift-bg: #f5f6fa;
    --gift-surface: #ffffff;
    --gift-surface-soft: #f8f9fc;
    --gift-text: #171923;
    --gift-muted: #777e8d;
    --gift-border: #e9ebf1;
    --gift-primary: #fe2c55;
    --gift-primary-dark: #df1742;
    --gift-radius: 12px;
    --gift-shadow: 0 2px 8px rgba(20, 25, 45, 0.04);
    --gift-shadow-hover: 0 6px 16px rgba(20, 25, 45, 0.08);
    --gift-transition: 0.22s ease;
}

/* RESET SEGURO */
*, *::before, *::after {
    box-sizing: border-box;
}

.flex-page {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: clamp(8px, 1.5vw, 20px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
    gap: 16px;
    color: var(--gift-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 12px; /* Letra general m�s peque�a */
    line-height: 1.4;
}

.left-side {
    min-width: 0;
    width: 100%;
}

.right-side {
    min-width: 0;
    width: 100%;
    position: sticky;
    top: 16px;
}

/* ==========================
   CAT�LOGO DE REGALOS (MINI)
   ========================== */
.gifts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); /* Contenedores m�s compactos */
    gap: 8px;
    width: 100%;
    align-items: stretch;
}

.gift {
    position: relative;
    min-width: 0;
    min-height: auto;
    padding: 6px; /* Contenedores de unos 6 pixeles */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
    background: var(--gift-surface);
    border: 1px solid var(--gift-border);
    border-radius: var(--gift-radius);
    box-shadow: var(--gift-shadow);
    text-align: center;
    transition: transform var(--gift-transition), box-shadow var(--gift-transition), border-color var(--gift-transition);

    > img:first-child {
        position: relative;
        z-index: 1;
        display: block;
        width: 48px;  /* Imagen de tama�o miniatura equilibrado (aprox 3rem) */
        height: 48px;
        object-fit: contain;
        margin: 0 auto;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
    }

    &:hover {
        transform: translateY(-3px);
        border-color: rgba(254, 44, 85, 0.28);
        box-shadow: var(--gift-shadow-hover);
        z-index: 2;
    }
}

.gift-name {
    position: relative;
    z-index: 1;
    width: 100%;
    margin: 0;
    color: var(--gift-text);
    font-size: 10px; /* Letra del nombre muy peque�a */
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-height: 24px;
}

.gift-price {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin: 0;
    padding: 2px 6px; /* Padding ultra compacto */
    color: var(--gift-primary-dark, #c51d43);
    background: #fff0f3;
    border: 1px solid rgba(254, 44, 85, 0.09);
    border-radius: 20px;
    font-size: 9px; /* Letra del precio m�s peque�a */
    font-weight: 750;

    img {
        width: 10px !important;
        height: 10px !important;
        object-fit: contain;
    }
}

/* ==========================
   PANEL LATERAL Y FILTROS
   ========================== */
.live-board-panel {
    width: 100%;
    padding: 16px;
    background: var(--gift-surface);
    border: 1px solid var(--gift-border);
    border-radius: 16px;
    box-shadow: var(--gift-shadow);
}

.gifts-filter-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.gifts-filter-dropdown {
    position: relative;
    width: 100%;
    min-width: 0;
}

.gifts-filter-trigger {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--gift-surface-soft);
    border: 1px solid var(--gift-border);
    border-radius: 10px;
    color: var(--gift-text);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--gift-transition), background var(--gift-transition);

    &:hover {
        background: var(--gift-surface);
        border-color: rgba(254, 44, 85, 0.45);
    }
}

.gifts-filter-trigger-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.gifts-filter-trigger-label {
    color: var(--gift-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.gifts-filter-trigger-value {
    color: var(--gift-text);
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gifts-filter-caret {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--gift-muted);
    transition: transform var(--gift-transition);
}

/* ESTADO ABIENTO DEL DROPDOWN */
.gifts-filter-dropdown.is-open .gifts-filter-panel {
    display: block;
    animation: fadeInScale 0.2s ease forwards;
}

.gifts-filter-dropdown.is-open .gifts-filter-caret {
    transform: rotate(180deg);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* PANEL DESPLEGABLE */
.gifts-filter-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    max-height: min(320px, 50vh);
    padding: 12px;
    overflow-y: auto;
    background: var(--gift-surface);
    border: 1px solid var(--gift-border);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);

    h3 {
        margin: 0 0 10px;
        color: var(--gift-text);
        font-size: 12px;
        font-weight: 750;
    }
}

/* ==========================
   OPCIONES Y B�SQUEDA
   ========================== */
.info-panel {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
}

.cost, .regions-list .region a {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 34px;
    padding: 6px 8px;
    color: var(--gift-text);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 550;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--gift-transition);

    &:hover, &.active-link {
        color: var(--gift-primary);
        background: rgba(254, 44, 85, 0.08);
        border-color: rgba(254, 44, 85, 0.2);
        font-weight: 700;
    }
}

.region-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 8px;
    padding: 0 10px;
    min-height: 36px;
    background: var(--gift-surface-soft);
    border: 1px solid var(--gift-border);
    border-radius: 8px;

    &:focus-within {
        border-color: #1b1d26;
        background: var(--gift-surface);
    }

    svg {
        width: 14px;
        height: 14px;
        color: var(--gift-muted);
        flex-shrink: 0;
    }

    input {
        width: 100%;
        height: 32px;
        background: transparent;
        border: none;
        outline: none;
        color: #1b1d26!important;
        font-family: inherit;
        font-size: 11px;
        font-weight: 500;

        &::placeholder {
            color: #1b1d26!important;
          
        }
    }
}

.regions-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gifts-empty, .regions-empty {
    padding: 12px;
    color: var(--gift-muted);
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    background: var(--gift-surface-soft);
    border-radius: 8px;
    margin-top: 6px;

    &[hidden] {
        display: none !important;
    }
}

/* RESPONSIVE LAYOUT */
@media (max-width: 800px) {
    .flex-page {
        grid-template-columns: minmax(0, 1fr);
    }
    .right-side {
        position: relative;
        top: auto;
        order: -1;
    }
    .gifts-filter-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .gifts-filter-row {
        grid-template-columns: 1fr;
    }
    .gifts-container {
        grid-template-columns: repeat(4, minmax(0, 1fr)); /* M�s columnas para aprovechar el dise�o mini */
        gap: 6px;
    }
}




/* MODO OSCURO */
@media (prefers-color-scheme: dark) {
    :root {
        --gift-bg: #111218;
        --gift-surface: #1b1d26;
        --gift-surface-soft: #232530;
        --gift-text: #f3f4f8;
        --gift-muted: #a0a5b3;
        --gift-border: #30333f;
        --gift-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
    }
}