/* ==========================================================
   WC Tile Selector — tiles.css
   ========================================================== */

/* Wrapper gerado pelo JS */
.wcts-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 4px 0;
}

/* Tile individual */
.wcts-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    white-space: nowrap;
    line-height: 1.2;
    box-sizing: border-box;
    transition: background-color 0.18s ease,
                color           0.18s ease,
                border-color    0.18s ease,
                opacity         0.18s ease,
                transform       0.12s ease;

    /* Evita highlight azul no iOS ao tocar */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;

    /* Tamanho mínimo de toque recomendado por Apple (44×44pt) */
    min-height: 44px;
}

/* Estado: ativo */
.wcts-tile.wcts-active {
    font-weight: 600;
}

/* Estado: indisponível */
.wcts-tile.wcts-unavailable {
    cursor: not-allowed;
    text-decoration: line-through;
    pointer-events: none;
}

/* Feedback de toque/hover */
@media (hover: hover) {
    .wcts-tile:not(.wcts-unavailable):hover {
        filter: brightness(0.9);
        transform: translateY(-1px);
    }
}

/* Pressionar em mobile */
.wcts-tile:not(.wcts-unavailable):active {
    transform: scale(0.94);
    filter: brightness(0.85);
}

/* Esconde o <select> original mas mantém no DOM
   para o WooCommerce continuar funcionando */
.wcts-hidden-select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Ícone de check no tile ativo (opcional via data-attr) */
.wcts-tile.wcts-active::after {
    content: attr(data-check);
    display: inline-block;
    margin-left: 4px;
    font-size: 0.75em;
    line-height: 1;
    vertical-align: middle;
}

/* Responsivo — telas muito pequenas */
@media (max-width: 360px) {
    .wcts-wrapper {
        gap: 5px;
    }
}

/* Suporte a modo escuro do sistema */
@media (prefers-color-scheme: dark) {
    .wcts-tile:not(.wcts-active):not(.wcts-unavailable) {
        /* as cores vêm via inline style do JS — aqui apenas
           garantimos contraste caso o tema force dark */
    }
}
