:root {
    --mkb-bg-light: #f9f9f9;
    --mkb-border: #e2e2e2;
    --mkb-text: #333;
}

/* Container Geral */
.mkb-wrapper-cols {
    display: flex;
    gap: 30px;
    font-family: inherit;
    background: #e6e6e6;
    padding: 30px;
    border-radius: 10px;
    align-items: flex-start;
}

/* Coluna Esquerda */
.mkb-col-left {
    flex: 3;
    background: transparent;
    border-radius: 10px;
    padding-bottom: 20px;
    min-width: 0; /* FIX MOBILE: Ajuda a impedir estouro */
}

/* Cabeçalho */
.mkb-header-bar {
    background: var(--mkb-primary);
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.mkb-header-bar h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
}

.mkb-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mkb-skip-link {
    color: #fff;
    background: rgba(255,255,255,0.2);
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none !important;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    border: none;
}

.mkb-skip-link:hover {
    background: rgba(255,255,255,0.3);
    color: #fff;
    text-decoration: none !important;
}

/* Botão Whatsapp */
.mkb-share-btn {
    background-color: #25D366;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s;
    border: none;
}

.mkb-share-btn:hover {
    background-color: #1ebe57;
    color: #fff;
    text-decoration: none !important;
}

.mkb-share-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Abas */
.mkb-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.mkb-tab-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.mkb-tab-btn:hover {
    background: #e9e9e9;
    color: #333;
}

.mkb-tab-btn.active {
    background: var(--mkb-primary);
    color: #fff;
    border-color: var(--mkb-primary);
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Grid de Produtos */
.mkb-grid-products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.mkb-card {
    background: #fff;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    position: relative;
    transition: all 0.2s;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    cursor: pointer;
    user-select: none;
}

.mkb-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.mkb-card img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 8px;
}

.mkb-card-footer {
    padding: 8px 10px;
    border-radius: 0 0 15px 15px;
}

/* ==================================================================
   CARD ATIVO
   ================================================================== */
.mkb-card.active {
    border-color: var(--mkb-primary);
    cursor: default;
    overflow: hidden;
    padding-bottom: 0;
}

/* Lixeira */
.mkb-card-trash {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #000;
    color: #fff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}

.mkb-card-trash:hover {
    background: #ff4757;
}

.mkb-card-trash.hidden {
    display: none;
}

/* Rodapé Rosa Ativo com Respiro Inferior */
.mkb-card.active .mkb-card-footer {
    background: var(--mkb-primary);
    color: #fff;
    margin: 0 -15px -15px -15px;
    padding: 15px 15px 25px 15px;
}

/* Título e Preço brancos para contraste */
.mkb-card.active h3,
.mkb-card.active .mkb-price {
    color: #fff !important;
}

/* Área de Ações e Controle de Quantidade */
.mkb-actions {
    position: relative;
    z-index: 2;
    margin-top: 15px; 
    margin-bottom: 5px; 
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Pílula de Quantidade Branca no rodapé Rosa */
.mkb-qty-control {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #fff;
    padding: 5px 10px;
    border-radius: 50px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.mkb-qty-control.hidden {
    display: none !important;
}

/* Botões - e + Pretos na pílula branca */
.mkb-qty-minus,
.mkb-qty-plus {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #333 !important;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0 !important;
}

.mkb-qty-val {
    font-weight: bold;
    color: #333;
    padding: 0 5px;
    min-width: 20px;
    text-align: center;
}

/* Overlay de Clique */
.mkb-click-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ==================================================================
   TÍTULO E PREÇO
   ================================================================== */
body #mkb-grid-container .mkb-card h3,
.mkb-card h3 { 
    font-size: 13px !important; 
    font-weight: 600 !important;
    text-transform: none !important;
    margin: 5px 0 !important; 
    line-height: 1.3 !important; 
    min-height: 34px; 
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0 !important;
    color: #333;
}

.mkb-price { 
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 13px;
    line-height: 1.2;
    min-height: 16px; 
}

.mkb-price * {
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block;
    line-height: 1;
}

.mkb-price del {
    opacity: 0.7;
    margin-right: 5px !important;
    font-size: 0.9em;
}

/* Sidebar */
.mkb-col-right {
    flex: 1;
    min-width: 300px;
}

.mkb-sidebar-sticky {
    background: #e9e9e9;
    border: 2px solid #ccc;
    border-radius: 15px;
    padding: 20px;
    position: sticky;
    top: 20px;
}

.mkb-sidebar-header h2 {
    font-size: 20px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mkb-count-badge {
    background: var(--mkb-primary);
    color: #fff;
    font-size: 14px;
    padding: 2px 8px;
    border-radius: 10px;
}

.mkb-discount-msg {
    font-size: 14px;
    margin-bottom: 15px;
}

.mkb-economy-bar {
    background: var(--mkb-primary);
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 15px;
}

/* Seção de Brindes */
.mkb-gift-section-wrapper {
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Caixa Trancada */
.mkb-gift-box-locked {
    background: var(--mkb-primary);
    color: #fff;
    border: 2px solid #000;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 0 rgba(0,0,0,0.1);
}

.mkb-gift-box-locked p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
}

.mkb-gift-icon-locked {
    display: block;
    font-size: 30px;
    margin-top: 10px;
}

/* Caixa Desbloqueada */
.mkb-gift-box-unlocked {
    background: #fff;
    border: 2px solid #000;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: mkbFadeIn 0.5s ease-in-out;
}

@keyframes mkbFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Ícone Topo */
.mkb-gift-icon-top {
    font-size: 30px;
    line-height: 1;
    margin-bottom: 5px;
    display: block;
    text-align: center;
}

/* Texto de Parabéns */
.mkb-gift-congrats {
    font-size: 15px;
    color: #333;
    margin-bottom: 15px;
    display: block;
    font-weight: 600;
    text-align: center;
}

/* Link da Imagem e Centralização */
.mkb-gift-link-wrapper {
    display: flex; 
    justify-content: center; 
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
    cursor: pointer;
    text-align: center;
}

.mkb-gift-thumb {
    width: auto;
    max-width: 80%;
    height: auto;
    object-fit: contain;
    border: none;
    display: block;
    margin: 0 auto;
}

#mkb-gift-link-name {
    text-decoration: none;
    display: block;
    text-align: center;
}

#mkb-gift-name {
    color: var(--mkb-primary);
    font-weight: 800;
    font-size: 15px !important;
    line-height: 1.2;
    text-transform: uppercase;
    display: block;
    margin: 0 auto;
}

/* Slots e Rodapé da Sidebar */
.mkb-items-selected-text {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.mkb-slots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    margin-bottom: 15px;
    width: 100%;
}

.mkb-slot-circle {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px dashed #999;
    background: #ccc;
    position: relative;
    overflow: hidden;
    width: 100%;
    height: auto;
}

.mkb-slot-circle.filled {
    border: 2px solid var(--mkb-primary);
    background: #fff;
}

.mkb-slot-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mkb-btn-secondary {
    width: 100%;
    background: #ccc;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 15px;
    font-weight: bold;
}

.mkb-btn-primary {
    width: 100%;
    background: #000;
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    text-transform: uppercase;
    transition: opacity 0.2s;
}

.mkb-btn-primary:hover {
    opacity: 0.9;
}

.mkb-btn-primary:disabled { 
    background: #999; 
    cursor: not-allowed; 
    opacity: 1; 
}

.mkb-financial-summary {
    margin-bottom: 20px;
    font-size: 14px;
}

.mkb-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.total-line {
    font-size: 18px;
    margin-top: 10px;
}

.mkb-prices-box {
    text-align: right;
}

.mkb-highlight-discount {
    color: #2ecc71;
    font-weight: bold;
}

/* ==================================================================
   MODAL DE VARIAÇÕES
   ================================================================== */
.mkb-modal-overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0,0,0,0.6); 
    z-index: 999999 !important; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    backdrop-filter: blur(3px);
}

.mkb-modal-box {
    background: #fff; 
    border-radius: 12px; 
    width: 90%; 
    max-width: 450px;
    padding: 25px; 
    position: relative; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: mkbModalFadeIn 0.3s ease;
}

@keyframes mkbModalFadeIn { 
    from { opacity: 0; transform: translateY(-20px) scale(0.95); } 
    to { opacity: 1; transform: translateY(0) scale(1); } 
}

.mkb-modal-close {
    position: absolute; 
    top: 15px; 
    right: 15px; 
    background: none; 
    border: none;
    font-size: 28px; 
    line-height: 1; 
    cursor: pointer; 
    color: #999; 
    transition: color 0.2s;
}

.mkb-modal-close:hover { 
    color: #e74c3c; 
}

.mkb-modal-body {
    display: flex; 
    gap: 20px;
    margin-top: 10px;
}

.mkb-modal-image {
    flex: 0 0 120px;
}

.mkb-modal-image img {
    width: 100%; 
    height: auto; 
    border-radius: 8px; 
    border: 1px solid #eee;
}

.mkb-modal-info {
    flex: 1;
}

.mkb-modal-info h3 {
    margin: 0 0 5px 0 !important; 
    font-size: 16px !important; 
    color: #333; 
    line-height: 1.3 !important;
}

.mkb-var-selectors {
    margin-top: 15px;
}

.mkb-var-selectors label {
    display: block; 
    font-size: 11px; 
    font-weight: bold; 
    margin-bottom: 5px; 
    color: #777; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mkb-var-selectors select {
    width: 100%; 
    padding: 10px 12px; 
    margin-bottom: 12px; 
    border: 1px solid #ddd;
    border-radius: 6px; 
    font-size: 14px; 
    background: #fdfdfd; 
    color: #333;
    transition: border-color 0.2s;
    outline: none;
}

.mkb-var-selectors select:focus {
    border-color: var(--mkb-primary);
}

/* ==================================================================
   MEDIA QUERIES (RESPONSIVO E EFEITO SWIPE BLINDADO)
   ================================================================== */
@media (max-width: 768px) {
    /* TRAVAS DE LARGURA PARA PREVENIR ESTOURO (BLOWOUT) */
    .mkb-wrapper-cols { 
        flex-direction: column; 
        padding: 15px; 
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .mkb-col-left, .mkb-col-right {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    
    .mkb-header-bar { 
        flex-direction: column; 
        text-align: center; 
        width: 100%;
        box-sizing: border-box;
    }
    
    .mkb-grid-products { 
        grid-template-columns: repeat(2, 1fr); 
    }
    
    .mkb-slots-grid { 
        grid-template-columns: repeat(5, 1fr); 
        gap: 5px; 
    } 
    
    /* Configuração Blindada de Arrasto (Swipe) */
    .mkb-category-tabs { 
        display: flex;
        flex-wrap: nowrap; 
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch; 
        padding-bottom: 10px; 
        justify-content: flex-start;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Barra de rolagem minimalista */
    .mkb-category-tabs::-webkit-scrollbar {
        height: 4px; 
    }
    
    .mkb-category-tabs::-webkit-scrollbar-thumb {
        background-color: #ccc;
        border-radius: 4px;
    }
    
    .mkb-tab-btn { 
        white-space: nowrap; 
        flex-shrink: 0; /* Impede que o botão encolha */
        flex: 0 0 auto;
    }
}

@media (max-width: 480px) {
    .mkb-modal-body { 
        flex-direction: column; 
        align-items: center; 
        text-align: center; 
    }
    
    .mkb-modal-image { 
        flex: 0 0 auto; 
        width: 140px; 
        margin-bottom: 15px; 
    }
    
    .mkb-var-selectors label { 
        text-align: left; 
    }
}