/* ========================================
   CORREÇÃO ESPECÍFICA PARA CARDS DE PRODUTOS
   Solução para quebras de texto em cards de produtos
   ======================================== */

/* Correção para nomes dos produtos - remover limitação de linhas */
.product-name,
.product-title {
    display: block !important;
    -webkit-line-clamp: none !important;
    -webkit-box-orient: initial !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    word-break: normal !important;
    hyphens: none !important;
    overflow-wrap: normal !important;
    max-height: none !important;
    min-height: auto !important;
    line-height: 1.3 !important;
    /* Prevenir quebras em palavras compostas */
    -webkit-hyphens: none !important;
    -moz-hyphens: none !important;
    -ms-hyphens: none !important;
    -webkit-word-break: normal !important;
    -moz-word-break: normal !important;
    -ms-word-break: normal !important;
}

/* Correção para descrições dos produtos */
.product-description {
    display: block !important;
    -webkit-line-clamp: none !important;
    -webkit-box-orient: initial !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    word-break: normal !important;
    hyphens: none !important;
    overflow-wrap: normal !important;
    max-height: none !important;
    min-height: auto !important;
    line-height: 1.4 !important;
    /* Prevenir quebras em palavras compostas */
    -webkit-hyphens: none !important;
    -moz-hyphens: none !important;
    -ms-hyphens: none !important;
    -webkit-word-break: normal !important;
    -moz-word-break: normal !important;
    -ms-word-break: normal !important;
}

/* Override das classes line-clamp */
.line-clamp-1,
.line-clamp-2 {
    display: block !important;
    -webkit-line-clamp: none !important;
    -webkit-box-orient: initial !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    word-break: normal !important;
    hyphens: none !important;
    overflow-wrap: normal !important;
    max-height: none !important;
    min-height: auto !important;
    /* Prevenir quebras em palavras compostas */
    -webkit-hyphens: none !important;
    -moz-hyphens: none !important;
    -ms-hyphens: none !important;
    -webkit-word-break: normal !important;
    -moz-word-break: normal !important;
    -ms-word-break: normal !important;
}

/* Ajustar altura dos cards para acomodar texto completo */
.product-card {
    min-height: auto !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
}

.product-info {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

/* Garantir que os cards se ajustem ao conteúdo */
.grid-layout .product-item {
    height: auto !important;
    min-height: auto !important;
}

/* Responsividade para mobile */
@media (max-width: 768px) {
    .product-name {
        font-size: 0.9rem !important;
        line-height: 1.2 !important;
    }
    
    .product-description {
        font-size: 0.8rem !important;
        line-height: 1.3 !important;
    }
    
    .product-info {
        padding: 0.75rem !important;
    }
}

@media (max-width: 480px) {
    .product-name {
        font-size: 0.85rem !important;
        line-height: 1.2 !important;
    }
    
    .product-description {
        font-size: 0.75rem !important;
        line-height: 1.3 !important;
    }
    
    .product-info {
        padding: 0.5rem !important;
    }
}

/* Garantir que não haja overflow horizontal */
.product-card {
    overflow: visible !important;
    word-wrap: normal !important;
}

/* Estados de hover mantidos */
.product-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

/* Melhorias de acessibilidade */
.product-card:focus-within {
    outline: 2px solid #3b82f6 !important;
    outline-offset: 2px !important;
}

/* Garantir que preços não quebrem */
.product-price {
    white-space: nowrap !important;
    word-break: keep-all !important;
}

/* Garantir que badges não quebrem */
.badge,
.package-badge,
.unit-badge,
.min-quantity-badge {
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow: visible !important;
    text-overflow: clip !important;
    display: inline-block !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    /* Forçar texto em linha única */
    -webkit-hyphens: none !important;
    -moz-hyphens: none !important;
    -ms-hyphens: none !important;
    hyphens: none !important;
    -webkit-word-break: normal !important;
    -moz-word-break: normal !important;
    -ms-word-break: normal !important;
    word-break: normal !important;
}

/* Badge de quantidade mínima - garantir que caiba */
.min-quantity-badge {
    font-size: 0.7rem !important;
    padding: 0.375rem 0.625rem !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

/* Correção específica para badges de pacote - Fonte responsiva */
.package-badge {
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: inline-block !important;
    font-size: 0.75rem !important;
    padding: 0.25rem 0.5rem !important;
    /* Garantir que não quebre */
    -webkit-hyphens: none !important;
    -moz-hyphens: none !important;
    -ms-hyphens: none !important;
    hyphens: none !important;
    -webkit-word-break: normal !important;
    -moz-word-break: normal !important;
    -ms-word-break: normal !important;
    word-break: normal !important;
}

/* Responsividade progressiva para badges - Fonte se reduz conforme a tela diminui */
@media (max-width: 640px) {
    .package-badge,
    .unit-badge,
    .min-quantity-badge {
        font-size: 0.7rem !important;
        padding: 0.375rem 0.625rem !important;
    }
}

@media (max-width: 480px) {
    .package-badge,
    .unit-badge,
    .min-quantity-badge {
        font-size: 0.65rem !important;
        padding: 0.35rem 0.55rem !important;
    }
}

@media (max-width: 400px) {
    .package-badge,
    .unit-badge,
    .min-quantity-badge {
        font-size: 0.6rem !important;
        padding: 0.3rem 0.5rem !important;
    }
}

@media (max-width: 360px) {
    .package-badge,
    .unit-badge,
    .min-quantity-badge {
        font-size: 0.55rem !important;
        padding: 0.25rem 0.45rem !important;
    }
}

@media (max-width: 320px) {
    .package-badge,
    .unit-badge,
    .min-quantity-badge {
        font-size: 0.5rem !important;
        padding: 0.2rem 0.4rem !important;
    }
}

/* Garantir que o container do badge não corte o conteúdo */
.product-card .mb-3 {
    overflow: visible !important;
    width: 100% !important;
}

.product-card .mb-3 > span {
    max-width: calc(100% - 0.5rem) !important;
    box-sizing: border-box !important;
}
