/* ==========================================================================
   1. SELECTOR DE VARIAÇÕES (PÁGINA DO PRODUTO - PDP)
   ========================================================================== */

/* Container Principal */
.maxscalla-group-variations-hierarchical {
    margin: 15px 0;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 0;
}

/* --- Botões Simples (.variation-item) --- */
.maxscalla-group-variations-hierarchical .variation-item {
    display: inline-block;
    padding: 6px 14px;
    background: #ffffff;
    color: #4a5568;
    border: 1px solid #cbd5e0;
    border-radius: 0;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.maxscalla-group-variations-hierarchical .variation-item.active {
    background: #111111;
    color: #ffffff;
    border-color: #111111;
    font-weight: bold;
}

.maxscalla-group-variations-hierarchical .variation-item.disabled,
.maxscalla-group-variations-hierarchical .variation-item.out-of-stock {
    background: #edf2f7;
    color: #a0aec0;
    border: 1px dashed #cbd5e0;
    text-decoration: line-through;
    opacity: 0.65;
}

/* --- Carrossel de Cards (Imagens Maiores 75px e Badge Numérica) --- */
.maxscalla-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    margin-top: 8px;
}

.maxscalla-carousel-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 2px;
    scrollbar-width: none;
}

.maxscalla-carousel-container::-webkit-scrollbar {
    display: none;
}

/* Setas de Navegação Minimalistas */
.maxscalla-carousel-nav {
    background: transparent;
    border: none;
    width: 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    font-size: 20px;
    font-weight: bold;
    color: #111111;
    user-select: none;
    flex-shrink: 0;
    padding: 0;
}

.maxscalla-carousel-nav.prev { margin-right: 2px; }
.maxscalla-carousel-nav.next { margin-left: 2px; }

/* Card Base de Variação (75px x 75px) */
.maxscalla-variation-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 75px;
    height: 75px;
    background: #f4f4f4;
    border: 1px solid #e2e8f0;
    border-radius: 0;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.maxscalla-variation-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

/* Card Ativo / Selecionado (Borda Preta Destaque) */
.maxscalla-variation-card.active {
    border: 2px solid #111111;
    background: #ffffff;
}

/* Item Sem Estoque (Fundo Escuro + Linha Transversal Branca) */
.maxscalla-variation-card.disabled,
.maxscalla-variation-card.out-of-stock {
    background: #a3a3a3;
    border-color: #a3a3a3;
}

.maxscalla-variation-card.disabled img,
.maxscalla-variation-card.out-of-stock img {
    opacity: 0.75;
    filter: grayscale(10%);
}

.maxscalla-variation-card.disabled::after,
.maxscalla-variation-card.out-of-stock::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(
        to top right,
        transparent calc(50% - 1.5px),
        #ffffff 50%,
        transparent calc(50% + 1.5px)
    );
}

/* Badge de Desconto Numérica Preta (-11%) */
.maxscalla-discount-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    min-width: 34px;
    text-align: center;
    background: #111111;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 0;
    line-height: 1;
    z-index: 5;
    pointer-events: none;
}

/* Badge no Dropdown com Imagem */
.maxscalla-select-discount {
    background: #111111;
    color: #ffffff;
    font-size: 10px;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 0;
    margin-left: 4px;
    display: inline-block;
}

/* Ajuste de cor no item do dropdown ativo */
.maxscalla-option-item.active .maxscalla-select-discount {
    background: #ffffff;
    color: #111111;
}

/* Badge nos Botões Simples */
.maxscalla-btn-discount {
    display: inline-block;
    margin-left: 5px;
    background: #e53e3e;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 0;
    line-height: 1;
}

.variation-item.active .maxscalla-btn-discount {
    background: #ffffff;
    color: #111111;
}

/* --- Custom Select / Dropdown com Imagem --- */
.maxscalla-custom-select {
    position: relative;
    width: 100%;
    max-width: 280px;
    font-size: 13px;
    color: #2d3748;
    user-select: none;
}

.maxscalla-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: #ffffff;
    border: 1px solid #cbd5e0;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.maxscalla-select-trigger:hover {
    border-color: #a0aec0;
}

.maxscalla-select-content {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.maxscalla-select-content img {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 0;
}

.maxscalla-select-arrow {
    font-size: 10px;
    color: #718096;
    margin-left: 8px;
}

.maxscalla-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #cbd5e0;
    border-radius: 0;
    margin-top: 4px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none;
}

.maxscalla-select-options.open {
    display: block;
}

.maxscalla-option-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    text-decoration: none;
    color: #2d3748;
    transition: background 0.15s ease;
}

.maxscalla-option-item:hover {
    background: #edf2f7;
}

.maxscalla-option-item.active {
    background: #f4f4f4;
    font-weight: bold;
    color: #111111;
}

.maxscalla-option-item.disabled,
.maxscalla-option-item.out-of-stock {
    opacity: 0.5;
    background: #f7fafc;
    text-decoration: line-through;
}

.maxscalla-option-item img {
    width: 26px;
    height: 26px;
    object-fit: cover;
    border-radius: 0;
}


/* ==========================================================================
   2. COMPONENTES DE VITRINE / LISTAGEM DE PRODUTOS
   ========================================================================== */

/* Preço "A partir de" */
.maxscalla-starting-price {
    margin: 6px 0;
    clear: both;
}

.maxscalla-starting-price span:first-child {
    font-size: 10px;
    font-weight: 600;
    color: #777777;
    display: block;
    text-transform: uppercase;
}

.maxscalla-starting-price span:last-child {
    font-size: 16px;
    font-weight: 700;
    color: #111111;
}

/* Swatches Horizontais da Vitrine */
.maxscalla-swatches-container {
    display: flex;
    gap: 5px;
    margin: 8px 0;
    clear: both;
    overflow-x: auto;
    padding: 2px 0;
    z-index: 15;
    position: relative;
}

.maxscalla-swatch-item {
    border: 1px solid #dddddd;
    border-radius: 0;
    display: inline-block;
    width: 32px;
    height: 32px;
    overflow: hidden;
    flex-shrink: 0;
    background: #ffffff;
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.maxscalla-swatch-item:hover {
    border-color: #111111;
}