/* ============================================================
   WC Custom Search Tabs — Refined 2-Tab Design
   Optimised for dark header backgrounds (WoodMart / WHB)
   Single-column sequential dropdown (Marca → Modelo)
   ============================================================ */

/* -------- Container principal -------- */
#wcst-container {
    width: 100%;
    position: relative;
    box-sizing: border-box;
    font-family: inherit;
}

/* ============================================================
   TABS — designed for dark/black header background
   ============================================================ */
.wcst-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
}

.wcst-tab {
    flex: 1;
    padding: 8px 16px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.45);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    user-select: none;
    letter-spacing: 0.3px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wcst-tab:hover {
    background: rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.25);
}

.wcst-tab.active {
    background: #ffffff;
    color: #111111;
    border-color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Tab completa (passo já concluído, e.g. Marca após seleção) */
.wcst-tab.completed {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
    border-color: transparent;
    font-weight: 400;
    cursor: default;
}

/* Tab oculta (ex: Modelo antes de selecionar Marca) */
.wcst-tab.hidden {
    display: none;
}

/* ============================================================
   DROPDOWN — wrapper absoluto no desktop, relativo no mobile
   ============================================================ */
#wcst-columns {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    z-index: 99999;
    pointer-events: none;  /* deixa "passar" cliques para fora */
}

/* -------- Cada coluna (dropdown card) -------- */
.wcst-col {
    display: none;
    border: none;
    border-radius: 10px;
    background: #ffffff;
    max-height: 280px;
    overflow-y: auto;
    pointer-events: auto;   /* recebe cliques mesmo com pai pointer-events:none */
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.20),
        0 4px 12px rgba(0, 0, 0, 0.08);
}

.wcst-col.open {
    display: block;
    animation: wcstFadeIn 0.2s ease-out;
}

/* Empilhamento vertical: se duas colunas estiverem abertas (raro) */
.wcst-col.open + .wcst-col.open {
    margin-top: 6px;
}

/* -------- Itens da lista -------- */
.wcst-col a {
    display: block;
    padding: 10px 16px;
    font-size: 13px;
    color: #333333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.12s ease;
    cursor: pointer;
}

.wcst-col a:last-child {
    border-bottom: none;
}

.wcst-col a:hover {
    background: #f5f7fa;
    color: #111111;
}

.wcst-col a.selected {
    background: #e8eaed;
    color: #111111;
    font-weight: 600;
}

/* -------- Loading / empty states -------- */
.wcst-loading,
.wcst-empty {
    padding: 28px 16px;
    font-size: 13px;
    color: #999999;
    text-align: center;
}

/* -------- Animação -------- */
@keyframes wcstFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* -------- Scrollbar personalizada -------- */
.wcst-col::-webkit-scrollbar {
    width: 5px;
}
.wcst-col::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 0 10px 10px 0;
}
.wcst-col::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 10px;
}
.wcst-col::-webkit-scrollbar-thumb:hover {
    background: #aaaaaa;
}

/* ============================================================
   MOBILE / TABLET (<= 1024 px)
   ============================================================ */
@media (max-width: 1024px) {

    /* ---- Dropdown flui com o conteúdo ---- */
    #wcst-columns {
        position: relative;
        top: auto;
        left: auto;
        width: auto;
        margin-top: 6px;
        pointer-events: auto;
    }

    .wcst-tabs {
        gap: 6px;
    }

    .wcst-tab {
        padding: 10px 12px;
        font-size: 12px;
    }

    .wcst-col {
        max-height: 55vh;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        box-shadow:
            0 4px 20px rgba(0, 0, 0, 0.12),
            0 2px 6px rgba(0, 0, 0, 0.05);
    }

    .wcst-col a {
        padding: 12px 16px;
        font-size: 14px;
    }
}
