/**
 * CSS FORÇADO PARA GRID DO SHORTCODE
 * Este arquivo força o grid do shortcode a funcionar em qualquer situação
 */

/* FORÇA GRID COM MÁXIMA ESPECIFICIDADE */
html body .paw-shortcode-container .paw-products-grid,
html body .paw-shortcode-grid,
html body div.paw-shortcode-container div.paw-products-grid,
html body div.paw-shortcode-container div.paw-shortcode-grid,
body .paw-shortcode-container .paw-products-grid,
body .paw-shortcode-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    margin: 20px 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    align-items: start !important;
    min-height: auto !important;
    flex-direction: unset !important;
    flex-wrap: unset !important;
    flex: none !important;
    float: none !important;
    position: static !important;
}

/* FORÇA 1 COLUNA EM MOBILE - MÁXIMA PRIORIDADE */
@media screen and (max-width: 768px) {
    html body .paw-shortcode-container .paw-products-grid,
    html body .paw-shortcode-grid,
    html body div.paw-shortcode-container div.paw-products-grid,
    html body div.paw-shortcode-container div.paw-shortcode-grid,
    body .paw-shortcode-container .paw-products-grid,
    body .paw-shortcode-grid,
    .paw-shortcode-container .paw-products-grid,
    .paw-shortcode-grid,
    .paw-shortcode-container[data-colunas="1"] .paw-products-grid,
    .paw-shortcode-container[data-colunas="2"] .paw-products-grid,
    .paw-shortcode-container[data-colunas="3"] .paw-products-grid,
    .paw-shortcode-container[data-colunas="4"] .paw-products-grid,
    .paw-shortcode-container[data-colunas="5"] .paw-products-grid,
    .paw-shortcode-container[data-colunas="6"] .paw-products-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}

/* FORÇA GRID POR NÚMERO DE COLUNAS */
html body .paw-shortcode-container[data-colunas="1"] .paw-products-grid,
html body .paw-shortcode-container[data-colunas="1"] .paw-shortcode-grid {
    grid-template-columns: 1fr !important;
}

html body .paw-shortcode-container[data-colunas="2"] .paw-products-grid,
html body .paw-shortcode-container[data-colunas="2"] .paw-shortcode-grid {
    grid-template-columns: repeat(2, 1fr) !important;
}

html body .paw-shortcode-container[data-colunas="3"] .paw-products-grid,
html body .paw-shortcode-container[data-colunas="3"] .paw-shortcode-grid {
    grid-template-columns: repeat(3, 1fr) !important;
}

html body .paw-shortcode-container[data-colunas="4"] .paw-products-grid,
html body .paw-shortcode-container[data-colunas="4"] .paw-shortcode-grid {
    grid-template-columns: repeat(4, 1fr) !important;
}

html body .paw-shortcode-container[data-colunas="5"] .paw-products-grid,
html body .paw-shortcode-container[data-colunas="5"] .paw-shortcode-grid {
    grid-template-columns: repeat(5, 1fr) !important;
}

html body .paw-shortcode-container[data-colunas="6"] .paw-products-grid,
html body .paw-shortcode-container[data-colunas="6"] .paw-shortcode-grid {
    grid-template-columns: repeat(6, 1fr) !important;
}

/* PRODUTOS DO SHORTCODE */
html body .paw-shortcode-container .paw-product-item,
html body div.paw-shortcode-container div.paw-product-item {
    background: #fff !important;
    border: 1px solid #c3c4c7 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    box-sizing: border-box !important;
    min-height: 280px !important;
    flex: none !important;
    width: auto !important;
    max-width: none !important;
    float: none !important;
    margin: 0 !important;
}

/* REMOVE CONFLITOS COMUNS */
html body .paw-shortcode-container .paw-products-grid *:not(.paw-product-item) {
    flex: none !important;
}

html body .paw-shortcode-container .paw-products-grid:not(.paw-carousel-page):not(.paw-carousel-slide) {
    transform: none !important;
}

/* RESPONSIVIDADE FORÇADA */
@media (max-width: 1200px) {
    html body .paw-shortcode-container[data-colunas="4"] .paw-products-grid,
    html body .paw-shortcode-container[data-colunas="5"] .paw-products-grid,
    html body .paw-shortcode-container[data-colunas="6"] .paw-products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    html body .paw-shortcode-container .paw-products-grid,
    html body .paw-shortcode-container .paw-shortcode-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}

@media (max-width: 480px) {
    html body .paw-shortcode-container .paw-products-grid,
    html body .paw-shortcode-container .paw-shortcode-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}

/* FORÇA BOTÕES DE QUANTIDADE VISÍVEIS */
html body .paw-shortcode-container .paw-quantity-controls {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin: 10px 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

html body .paw-shortcode-container .paw-quantity-btn {
    background: #007cba !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    font-size: 16px !important;
    font-weight: bold !important;
    line-height: 1 !important;
    transition: all 0.2s ease !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 10 !important;
}

html body .paw-shortcode-container .paw-quantity-plus {
    background: #27ae60 !important;
}

html body .paw-shortcode-container .paw-quantity-btn:hover {
    background: #005a87 !important;
    transform: scale(1.05) !important;
}

html body .paw-shortcode-container .paw-quantity-plus:hover {
    background: #229954 !important;
}

html body .paw-shortcode-container .paw-quantity-input {
    width: 60px !important;
    text-align: center !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    padding: 6px !important;
    font-size: 14px !important;
    height: 32px !important;
    box-sizing: border-box !important;
}

/* MOBILE - FORÇA 1 COLUNA */
@media (max-width: 768px) {
    html body .paw-shortcode-container .paw-products-grid,
    html body .paw-shortcode-container .paw-shortcode-grid,
    html body div.paw-shortcode-container div.paw-products-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    html body .paw-shortcode-container .paw-product-item {
        max-width: 400px !important;
        margin: 0 auto !important;
    }
}

/* DEBUG - VISUAL PARA TESTE */
.paw-debug-shortcode .paw-products-grid {
    border: 3px solid red !important;
    background: rgba(255, 0, 0, 0.1) !important;
}

.paw-debug-shortcode .paw-product-item {
    border: 2px solid blue !important;
    background: rgba(0, 0, 255, 0.1) !important;
} 