/* CSS Específico para Cards - Layout Correto */

/* Container principal dos cards */
.cards-container {
    display: grid;
    gap: 20px;
    margin-top: 40px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

/* Layout Desktop - 3x2 com 6 cards (sem cards de largura total) */
@media (min-width: 769px) {
    .cards-container {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        grid-template-rows: auto auto !important;
        gap: 20px !important;
        max-width: 1300px !important;
        padding: 0 20px !important;
        grid-auto-flow: dense !important;
        align-items: start !important;
        justify-items: stretch !important;
    }

    /* Garantir que apenas os 6 cards visíveis ocupem o grid */
    .cards-container > .luxury-product-card:not(.card-position-1):not(.card-position-2):not(.card-position-9) {
        display: block !important;
    }
}

/* Layout Mobile - 2 colunas com cards grandes e pequenos */
@media (max-width: 768px) {
    .cards-container {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto auto auto auto auto;
    }
}

/* Posicionamento específico dos cards - Desktop 3x2 (apenas 6 cards) */
@media (min-width: 769px) {
    /* Reorganizar cards para ocupar o grid 3x2 sem espaços vazios */
    .card-position-3 {
        grid-column: 1 / 2;
        grid-row: 1;
        order: 1;
    }

    .card-position-4 {
        grid-column: 2 / 3;
        grid-row: 1;
        order: 2;
    }

    .card-position-5 {
        grid-column: 3 / 4;
        grid-row: 1;
        order: 3;
    }

    .card-position-6 {
        grid-column: 1 / 2;
        grid-row: 2;
        order: 4;
    }

    .card-position-7 {
        grid-column: 2 / 3;
        grid-row: 2;
        order: 5;
    }

    .card-position-8 {
        grid-column: 3 / 4;
        grid-row: 2;
        order: 6;
    }

    /* Remover completamente cards 1, 2 e 9+ do DOM visual */
    .card-position-1,
    .card-position-2,
    .card-position-9 {
        display: none !important;
        position: absolute !important;
        left: -9999px !important;
        top: -9999px !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    /* Garantir que cards grandes não apareçam no desktop */
    .card-large {
        display: none !important;
        position: absolute !important;
        left: -9999px !important;
        top: -9999px !important;
    }

    /* Garantir que apenas cards pequenos sejam visíveis */
    .card-small {
        display: block !important;
    }

    /* Forçar grid a ignorar cards escondidos */
    .cards-container {
        grid-auto-flow: dense !important;
    }
}

/* Posicionamento específico dos cards - Mobile (layout original) */
@media (max-width: 768px) {
    .card-position-1 {
        grid-column: 1 / 3;
        grid-row: 1;
    }

    .card-position-3 {
        grid-column: 1 / 2;
        grid-row: 2;
    }

    .card-position-4 {
        grid-column: 2 / 3;
        grid-row: 2;
    }

    .card-position-5 {
        grid-column: 1 / 2;
        grid-row: 3;
    }

    .card-position-6 {
        grid-column: 2 / 3;
        grid-row: 3;
    }

    .card-position-7 {
        grid-column: 1 / 2;
        grid-row: 4;
    }

    .card-position-8 {
        grid-column: 2 / 3;
        grid-row: 4;
    }

    .card-position-2 {
        grid-column: 1 / 3;
        grid-row: 5;
    }
}

/* Estilos dos cards - Desktop: todos com fotos grandes */
@media (min-width: 769px) {
    .luxury-product-card {
        height: auto !important;
        min-height: 520px !important;
        max-height: none !important;
        display: flex !important;
        flex-direction: column !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        box-shadow: 0 8px 25px rgba(0,0,0,0.12) !important;
        transition: all 0.3s ease !important;
        background: white !important;
    }

    .luxury-product-card:hover {
        transform: translateY(-3px) !important;
        box-shadow: 0 15px 35px rgba(0,0,0,0.18) !important;
    }

    .luxury-product-card .product-image-container {
        height: 340px !important;
        flex: 0 0 340px !important;
        width: 100% !important;
        position: relative !important;
        overflow: hidden !important;
        border-radius: 12px 12px 0 0 !important;
        background: #f8f9fa !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .luxury-product-card .product-image-container img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
        transition: transform 0.3s ease !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .luxury-product-card:hover .product-image-container img {
        transform: scale(1.03) !important;
    }

    .luxury-product-card .product-info {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        padding: 18px 16px 16px 16px !important;
        background: white !important;
        min-height: 200px !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    /* Container para conteúdo superior dos cards */
    .luxury-product-card .product-content {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* Otimização do conteúdo no desktop */
    .luxury-product-card .product-category {
        font-size: 0.8rem !important;
        margin-bottom: 8px !important;
        color: #D4AF37 !important;
        font-weight: 600 !important;
        text-transform: uppercase !important;
        letter-spacing: 1px !important;
    }

    .luxury-product-card .product-name {
        font-size: 1.1rem !important;
        font-weight: 600 !important;
        margin-bottom: 12px !important;
        line-height: 1.4 !important;
        color: #1C1C1E !important;
        overflow: visible !important;
        text-overflow: none !important;
        display: block !important;
        -webkit-line-clamp: none !important;
        -webkit-box-orient: none !important;
        min-height: auto !important;
        word-wrap: break-word !important;
        hyphens: auto !important;
    }

    .luxury-product-card .product-price {
        font-size: 1.4rem !important;
        font-weight: 700 !important;
        color: #D4AF37 !important;
        margin-bottom: 0 !important;
    }

    .luxury-product-card .product-actions {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 12px !important;
        margin-top: auto !important;
        padding-top: 15px !important;
        flex-shrink: 0 !important;
        height: auto !important;
        min-height: 88px !important;
    }

    .luxury-product-card .quantity-control {
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        flex: 0 0 auto !important;
        height: 36px !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 8px !important;
        background: white !important;
        padding: 2px !important;
    }

    .luxury-product-card .quantity-btn {
        width: 32px !important;
        height: 32px !important;
        border: none !important;
        background: transparent !important;
        color: #D4AF37 !important;
        border-radius: 6px !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
    }

    .luxury-product-card .quantity-btn:hover {
        background: #D4AF37 !important;
        color: white !important;
    }

    .luxury-product-card .quantity-input {
        width: 36px !important;
        height: 32px !important;
        border: none !important;
        border-radius: 4px !important;
        text-align: center !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        background: transparent !important;
        outline: none !important;
    }

    .luxury-product-card .add-to-cart-btn {
        width: 100% !important;
        height: 44px !important;
        background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%) !important;
        border: none !important;
        color: white !important;
        border-radius: 8px !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 120px !important;
        padding: 0 12px !important;
    }

    .luxury-product-card .add-to-cart-btn:hover {
        background: linear-gradient(135deg, #B8860B 0%, #996F00 100%) !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3) !important;
    }

    .luxury-product-card .add-to-cart-btn span {
        font-size: 0.8rem !important;
    }

    .luxury-product-card .add-to-cart-btn i {
        font-size: 0.7rem !important;
        margin-right: 4px !important;
    }
}

/* Estilos dos cards - Mobile: manter layout original */
@media (max-width: 768px) {
    .card-large {
        height: 120px !important;
        min-height: 120px !important;
        max-height: 120px !important;
    }

    .card-large .product-image-container {
        height: 120px; /* Altura mais baixa para cards grandes */
    }

    .card-small .product-image-container {
        height: 350px;
    }
}

/* Controle de visibilidade dos layouts */
@media (min-width: 769px) {
    /* Desktop: mostrar layout vertical, esconder horizontal */
    .card-horizontal-layout {
        display: none !important;
    }
    
    .desktop-vertical-layout {
        display: block !important;
    }
}

@media (max-width: 768px) {
    /* Mobile: mostrar layout horizontal para cards grandes, esconder vertical */
    .card-large .card-horizontal-layout {
        display: flex !important;
    }
    
    .card-large .desktop-vertical-layout {
        display: none !important;
    }
    
    .card-small .desktop-vertical-layout {
        display: block !important;
    }
}

/* Layout horizontal para cards grandes (mobile) */
.card-large .card-horizontal-layout {
    display: flex;
    height: 100% !important;
    min-height: 400px;
    border-radius: 12px;
    overflow: hidden !important;
}

.card-large .card-image-section {
    flex: 1;
    min-width: 50%;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: stretch !important;
}

.card-large .card-content-section {
    flex: 1;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 30px;
    background: white;
    height: auto; /* Altura automática baseada no conteúdo */
    min-height: 400px; /* Altura mínima para manter proporção */
    box-sizing: border-box; /* Incluir padding no cálculo da altura */
}

.card-large .card-image-section .product-image-container {
    width: 100% !important;
    height: 100% !important;
    flex: 1 !important;
    border-radius: 12px 0 0 12px;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.card-large .card-image-section .product-image-container img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: transform 0.3s ease !important;
}

.card-large:hover .card-image-section .product-image-container img {
    transform: scale(1.05) !important;
}

.card-large .card-content-section .product-info {
    width: 100% !important;
    padding: 0 !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 100% !important;
}

.card-large .product-content {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.card-large .product-name {
    font-size: 1.8rem !important;
    margin-bottom: 15px !important;
    font-weight: 300 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    width: 100% !important;
}

.card-large .product-price {
    font-size: 2rem !important;
    margin-bottom: 15px !important;
    color: var(--luxury-gold) !important;
    font-weight: 500 !important;
    text-align: center !important;
    width: 100% !important;
}

.card-large .product-category {
    font-size: 1rem !important;
    margin-bottom: 10px !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    font-weight: 600 !important;
    text-align: center !important;
    width: 100% !important;
}

.card-large .product-description {
    font-size: 1rem !important;
    color: #666 !important;
    margin-bottom: 15px !important;
    line-height: 1.4 !important;
    font-style: italic !important;
    text-align: center !important;
    width: 100% !important;
}

    .card-large .product-actions {
        justify-content: space-between !important;
        gap: 12px !important;
        margin-top: 0 !important;
        padding-top: 15px !important;
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        height: 48px !important;
        min-height: 48px !important;
        flex-shrink: 0 !important;
    }

.card-large .quantity-control {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex: 0 0 auto !important;
    height: 36px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    background: white !important;
    padding: 2px !important;
}

.card-large .quantity-btn {
    width: 32px !important;
    height: 32px !important;
    border: none !important;
    background: transparent !important;
    color: #D4AF37 !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.card-large .quantity-btn:hover {
    background: #D4AF37 !important;
    color: white !important;
}

.card-large .quantity-input {
    width: 36px !important;
    height: 32px !important;
    border: none !important;
    border-radius: 4px !important;
    text-align: center !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    background: transparent !important;
    outline: none !important;
}

    .card-large .add-to-cart-btn {
        flex: 1 !important;
        height: 44px !important;
        background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%) !important;
        border: none !important;
        color: white !important;
        border-radius: 8px !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 120px !important;
        padding: 0 12px !important;
    }

/* Garantir que o form também esteja centralizado */
.card-large form {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

/* Forçar centralização completa */
.card-large .card-content-section > * {
    text-align: center !important;
}

.card-large .product-info > * {
    text-align: center !important;
}

/* Forçar altura específica para cards grandes */
.card-position-1,
.card-position-2 {
    height: auto !important;
    min-height: 400px !important;
    max-height: none !important;
    overflow: visible !important;
}


/* Responsividade */
@media (max-width: 1200px) {
    .cards-container {
        gap: 20px;
        padding: 0 15px;
    }
    
    .card-large,
    .card-position-1,
    .card-position-2 {
        height: auto !important;
        min-height: 320px !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    .card-large .card-horizontal-layout {
        height: 100% !important;
        min-height: 320px;
        overflow: hidden !important;
    }
    
    .card-large .card-content-section {
        padding: 15px;
        justify-content: center !important;
        align-items: center !important;
        height: auto !important;
        min-height: 320px !important;
        box-sizing: border-box !important;
    }
    
    .card-large .card-content-section .product-info {
        text-align: center !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .card-large .product-actions {
        justify-content: center !important;
    }
    
    .card-large .card-content-section > *,
    .card-large .product-info > * {
        text-align: center !important;
    }
    
    .card-large .product-name {
        font-size: 1rem;
    }
    
    .card-large .product-price {
        font-size: 1.2rem;
    }
    
    .card-small .product-image-container {
        height: 280px;
    }
}

/* Media query específica para resolução entre 1198px e 770px */
@media (max-width: 1198px) and (min-width: 770px) {
    .card-large .product-category {
        font-size: 0.8rem !important;
        margin-bottom: 8px !important;
        letter-spacing: 1.5px !important;
    }
    
    .card-large .product-name {
        font-size: 1.3rem !important;
        margin-bottom: 10px !important;
        line-height: 1.1 !important;
    }
    
    .card-large .product-price {
        font-size: 1.5rem !important;
        margin-bottom: 10px !important;
    }
    
    .card-large .product-description {
        font-size: 0.85rem !important;
        margin-bottom: 12px !important;
        line-height: 1.3 !important;
    }
    
    .card-large .card-content-section {
        padding: 20px !important;
    }
    
    .card-large .product-actions {
        margin-top: 10px !important;
        gap: 12px !important;
    }
    
    .card-large .add-to-cart-btn {
        padding: 10px 18px !important;
        font-size: 0.9rem !important;
    }
    
    .card-large .quantity-btn {
        width: 35px !important;
        height: 35px !important;
        font-size: 0.9rem !important;
    }
    
    .card-large .quantity-input {
        width: 45px !important;
        height: 35px !important;
        font-size: 0.9rem !important;
    }
}

@media (max-width: 768px) {
    .cards-container {
        gap: 15px;
        padding: 0 15px;
    }
    
    .card-large,
    .card-position-1,
    .card-position-2 {
        height: auto !important;
        min-height: 280px !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    /* Layout horizontal mantido em mobile */
    .card-large .card-horizontal-layout {
        height: 100% !important;
        min-height: 280px;
        flex-direction: row; /* Manter horizontal em mobile */
        overflow: hidden !important;
    }
    
    /* Ajustar seções em mobile - manter horizontal */
    .card-large .card-image-section {
        min-width: 40%; /* Reduzir largura da imagem */
        width: 40%;
        height: 100% !important;
        flex: none;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        display: flex !important;
        align-items: stretch !important;
    }

    .card-large .card-image-section .product-image-container {
        width: 100% !important;
        height: 100% !important;
        flex: 1 !important;
        border-radius: 12px 0 0 12px !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .card-large .card-image-section .product-image-container img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .card-large .card-content-section {
        flex: 1;
        width: 60%; /* Mais espaço para conteúdo */
        height: auto;
        min-height: 280px;
        padding: 10px;
        justify-content: center !important;
        align-items: center !important;
    }
    
    .card-large .card-content-section .product-info {
        text-align: center !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .card-large .product-actions {
        justify-content: center !important;
    }
    
    .card-large .card-content-section > *,
    .card-large .product-info > * {
        text-align: center !important;
    }
    
    .card-large .product-name {
        font-size: 1rem !important;
        margin-bottom: 6px !important;
    }
    
    .card-large .product-price {
        font-size: 1.2rem !important;
        margin-bottom: 6px !important;
    }
    
    .card-large .product-category {
        font-size: 0.8rem !important;
        margin-bottom: 4px !important;
    }
    
    .card-large .product-description {
        font-size: 0.8rem !important;
        margin-bottom: 8px !important;
        line-height: 1.3 !important;
    }
    
    .card-large .product-actions {
        flex-direction: row; /* Manter horizontal */
        gap: 6px;
        margin-top: 6px;
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    .card-large .add-to-cart-btn {
        min-width: auto;
        padding: 6px 8px;
        font-size: 0.75rem;
        flex: 1;
    }
    
    .card-large .quantity-control {
        justify-content: center;
        gap: 4px;
        flex: none;
        min-width: 70px;
    }
    
    .card-large .quantity-btn {
        width: 20px !important;
        height: 20px !important;
        font-size: 0.7rem !important;
        padding: 0 !important;
    }
    
    .card-large .quantity-input {
        width: 30px !important;
        height: 20px !important;
        font-size: 0.75rem !important;
        padding: 2px !important;
        text-align: center !important;
    }
    
    .card-small .product-image-container {
        height: 260px;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 12px 12px 0 0 !important;
        overflow: hidden !important;
        position: relative !important;
    }

    .card-small .product-image-container img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        transition: transform 0.3s ease !important;
    }

    .card-small:hover .product-image-container img {
        transform: scale(1.05) !important;
    }
    
    .card-small .product-info {
        padding: 10px 10px;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        height: auto !important;
        min-height: 160px !important;
    }
    
    .card-small .product-content {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .card-small .product-name {
        font-size: 0.9rem;
    }
    
    .card-small .product-price {
        font-size: 1.2rem;
    }
    
    .card-small .product-actions {
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 10px !important;
        margin-top: auto !important;
        padding-top: 12px !important;
        height: auto !important;
        min-height: 78px !important;
        flex-shrink: 0 !important;
    }
    
    .card-small .quantity-control {
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        flex: 0 0 auto !important;
        height: 36px !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 8px !important;
        background: white !important;
        padding: 2px !important;
    }
    
    .card-small .quantity-btn {
        width: 32px !important;
        height: 32px !important;
        border: none !important;
        background: transparent !important;
        color: #D4AF37 !important;
        border-radius: 6px !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
    }
    
    .card-small .quantity-btn:hover {
        background: #D4AF37 !important;
        color: white !important;
    }
    
    .card-small .quantity-input {
        width: 36px !important;
        height: 32px !important;
        border: none !important;
        border-radius: 4px !important;
        text-align: center !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        background: transparent !important;
        outline: none !important;
    }
    
    .card-small .add-to-cart-btn {
        width: 100% !important;
        height: 42px !important;
        background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%) !important;
        border: none !important;
        color: white !important;
        border-radius: 8px !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 12px !important;
    }
    
    .card-small .add-to-cart-btn:hover {
        background: linear-gradient(135deg, #B8860B 0%, #996F00 100%) !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3) !important;
    }
}

@media (max-width: 576px) {
    .cards-container {
        gap: 12px;
        padding: 0 10px;
    }
    
    .card-large,
    .card-position-1,
    .card-position-2 {
        height: auto !important;
        min-height: 220px !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    /* Cards grandes em telas muito pequenas */
    .card-large .card-horizontal-layout {
        height: 100% !important;
        min-height: 220px;
        flex-direction: row; /* Manter horizontal em telas pequenas */
        overflow: hidden !important;
    }
    
    /* Ajustar seções em telas muito pequenas - manter horizontal */
    .card-large .card-image-section {
        min-width: 35%; /* Ainda menor em telas pequenas */
        width: 35%;
        height: 100% !important;
        flex: none;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        display: flex !important;
        align-items: stretch !important;
    }

    .card-large .card-image-section .product-image-container {
        width: 100% !important;
        height: 100% !important;
        flex: 1 !important;
        border-radius: 12px 0 0 12px !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .card-large .card-image-section .product-image-container img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .card-large .card-content-section {
        padding: 8px;
        justify-content: center !important;
        align-items: center !important;
        height: auto !important;
        min-height: 220px !important;
        box-sizing: border-box !important;
    }
    
    .card-large .card-content-section .product-info {
        text-align: center !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .card-large .product-actions {
        justify-content: center !important;
    }
    
    .card-large .card-content-section > *,
    .card-large .product-info > * {
        text-align: center !important;
    }
    
    .card-large .product-name {
        font-size: 1rem !important;
        margin-bottom: 5px !important;
    }
    
    .card-large .product-price {
        font-size: 1.2rem !important;
        margin-bottom: 8px !important;
    }
    
    .card-large .product-category {
        font-size: 0.8rem !important;
        margin-bottom: 4px !important;
    }
    
    .card-large .product-description {
        font-size: 0.75rem !important;
        margin-bottom: 8px !important;
    }
    
    .card-large .add-to-cart-btn {
        min-width: auto;
        padding: 4px 6px;
        font-size: 0.7rem;
        flex: 1;
    }
    
    .card-large .quantity-control {
        justify-content: center;
        gap: 3px;
        flex: none;
        min-width: 60px;
    }
    
    .card-large .quantity-btn {
        width: 18px !important;
        height: 18px !important;
        font-size: 0.65rem !important;
        padding: 0 !important;
    }
    
    .card-large .quantity-input {
        width: 25px !important;
        height: 18px !important;
        font-size: 0.7rem !important;
        padding: 1px !important;
        text-align: center !important;
    }
    
    .card-small .product-image-container {
        height: 200px;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 12px 12px 0 0 !important;
        overflow: hidden !important;
        position: relative !important;
    }

    .card-small .product-image-container img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        transition: transform 0.3s ease !important;
    }

    .card-small:hover .product-image-container img {
        transform: scale(1.05) !important;
    }
    
    .card-small .product-name {
        font-size: 0.8rem;
    }
    
    .card-small .product-price {
        font-size: 1.1rem;
    }
    
    .card-small .product-info {
        padding: 8px 8px;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        height: auto !important;
        min-height: 140px !important;
    }
    
    .card-small .product-content {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .card-small .product-actions {
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 6px !important;
        margin-top: auto !important;
        padding-top: 6px !important;
        height: auto !important;
        min-height: 68px !important;
        flex-shrink: 0 !important;
    }
    
    .card-small .quantity-control {
        display: flex !important;
        align-items: center !important;
        gap: 2px !important;
        flex: 0 0 auto !important;
        height: 28px !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 5px !important;
        background: white !important;
        padding: 1px !important;
    }
    
    .card-small .quantity-btn {
        width: 24px !important;
        height: 24px !important;
        border: none !important;
        background: transparent !important;
        color: #D4AF37 !important;
        border-radius: 3px !important;
        font-size: 10px !important;
        font-weight: 600 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
    }
    
    .card-small .quantity-btn:hover {
        background: #D4AF37 !important;
        color: white !important;
    }
    
    .card-small .quantity-input {
        width: 28px !important;
        height: 24px !important;
        border: none !important;
        border-radius: 2px !important;
        text-align: center !important;
        font-size: 10px !important;
        font-weight: 600 !important;
        background: transparent !important;
        outline: none !important;
    }
    
    .card-small .add-to-cart-btn {
        width: 100% !important;
        height: 36px !important;
        background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%) !important;
        border: none !important;
        color: white !important;
        border-radius: 6px !important;
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 8px !important;
    }
}

/* Loading state */
.cards-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    font-size: 1.2rem;
    color: #666;
}

.cards-loading i {
    animation: spin 1s linear infinite;
    margin-right: 10px;
    color: #D4AF37;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estilos para controles de quantidade no modal */
.quantity-section-modal {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.quantity-controls-modal {
    max-width: 200px;
    margin: 0 auto;
}

.quantity-btn-modal {
    width: 45px !important;
    height: 45px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.quantity-btn-modal:hover:not([style*="not-allowed"]) {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.quantity-input-modal {
    border: 2px solid #dee2e6 !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    background: white !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1) !important;
}

.quantity-input-modal:focus {
    border-color: #D4AF37 !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1) !important;
}

.modal-purchase-form .btn {
    font-weight: 600 !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
    font-size: 1.1rem !important;
}

.modal-purchase-form .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.modal-purchase-form .btn-dark {
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%) !important;
    border: none !important;
    color: white !important;
}

.modal-purchase-form .btn-dark:hover {
    background: linear-gradient(135deg, #B8860B 0%, #996F00 100%) !important;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
}

.modal-purchase-form .btn-outline-success {
    border: 2px solid #25D366 !important;
    color: #25D366 !important;
    background: transparent !important;
}

.modal-purchase-form .btn-outline-success:hover {
    background: #25D366 !important;
    color: white !important;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
}

/* Estilos para modal customizado (sem Bootstrap) */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1040; /* Abaixo do Bootstrap navbar (1050) */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.custom-modal.modal-show {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1040; /* Abaixo do Bootstrap navbar (1050) */
}

.modal-container {
    position: relative;
    width: 95vw;
    height: 90vh;
    max-width: 95vw;
    max-height: 90vh;
    background: white;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1041; /* Acima do backdrop mas abaixo do navbar */
}

.custom-modal.modal-show .modal-container {
    transform: scale(1) translateY(0);
}

.modal-header-custom {
    position: relative;
    height: 80px;
    background: linear-gradient(135deg, #1a1a1a 0%, #333333 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    flex-shrink: 0;
    border-bottom: 3px solid #D4AF37;
    z-index: 1042; /* Acima do container */
}

.modal-title-custom {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    text-align: center;
    flex: 1;
    color: white;
}

.modal-close-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1043; /* Acima do header */
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.modal-content-custom {
    flex: 1;
    display: flex;
    height: calc(90vh - 80px);
    overflow: hidden;
    background: white;
}

.modal-image-section {
    flex: 0 0 35%; /* Reduzido de 50% para 35% */
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px; /* Reduzido de 15px para 10px */
    max-height: 40vh; /* Reduzido de 60vh para 40vh */
}

.modal-product-image {
    max-width: 100%;
    max-height: 35vh; /* Reduzido de 50vh para 35vh */
    object-fit: contain;
    border-radius: 10px; /* Reduzido de 12px para 10px */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1); /* Reduzido shadow */
}

.modal-info-section {
    flex: 0 0 65%; /* Aumentado de 50% para 65% */
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px; /* Reduzido de 25px para 20px */
    overflow-y: hidden; /* Remover scroll principal */
    height: calc(100vh - 80px);
}

.product-info-custom {
    flex: 1;
    min-height: 0;
    max-height: calc(100vh - 280px); /* Limitar altura para deixar espaço pros botões */
    overflow-y: auto; /* Scroll apenas na seção de informações */
    padding-right: 8px; /* Reduzido para economizar espaço */
}

/* Scrollbar customizada para product-info */
.product-info-custom::-webkit-scrollbar {
    width: 4px;
}

.product-info-custom::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.product-info-custom::-webkit-scrollbar-thumb {
    background: #D4AF37;
    border-radius: 2px;
}

.product-info-custom::-webkit-scrollbar-thumb:hover {
    background: #B8860B;
}

.product-category-custom {
    color: #D4AF37;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.product-name-custom {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
    margin: 0 0 16px 0;
}

.product-price-custom {
    font-size: 2.5rem;
    font-weight: 800;
    color: #D4AF37;
    margin-bottom: 20px;
}

.product-description-custom {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 24px;
}

.product-features-custom {
    margin-bottom: 15px; /* Reduzido de 30px */
}

.product-features-custom h4 {
    color: #1a1a1a;
    font-weight: 600;
    margin-bottom: 12px; /* Reduzido de 16px */
    font-size: 1rem; /* Reduzido de 1.1rem */
}

.product-features-custom ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-features-custom li {
    display: flex;
    align-items: center;
    margin-bottom: 8px; /* Reduzido de 12px */
    font-size: 0.9rem; /* Reduzido de 1rem */
    color: #555;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.purchase-section-custom {
    flex-shrink: 0;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 20px 20px 0 0;
    margin: 10px -20px -20px -20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    min-height: 80px; /* Reduzido significativamente */
    max-height: 100px; /* Mais compacto */
    height: auto;
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
}

.quantity-section-custom {
    margin-bottom: 12px; /* Reduzido de 16px para 12px */
}

.quantity-label-custom {
    display: block;
    font-weight: 600;
    margin-bottom: 6px; /* Reduzido de 8px para 6px */
    color: #1a1a1a;
    font-size: 0.95rem; /* Reduzido de 1rem para 0.95rem */
}

.quantity-controls-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    max-width: 200px;
    margin: 0 auto;
}

.quantity-btn-custom {
    width: 45px;
    height: 45px;
    border: 2px solid #D4AF37;
    background: transparent;
    color: #D4AF37;
    border-radius: 12px;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.quantity-btn-custom:hover:not([style*="not-allowed"]) {
    background: #D4AF37;
    color: white;
    transform: scale(1.1);
}

.quantity-input-custom {
    width: 80px;
    height: 45px;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    background: white;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quantity-input-custom:focus {
    outline: none;
    border-color: #D4AF37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.action-buttons-custom {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Reduzido de 12px para 8px */
}

/* Nova estrutura horizontal para purchase controls */
.purchase-controls-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: nowrap;
}

.purchase-controls-custom .quantity-section-custom {
    margin-bottom: 0;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.purchase-controls-custom .quantity-label-custom {
    margin-bottom: 0;
    white-space: nowrap;
    font-size: 0.9rem;
}

.purchase-controls-custom .quantity-controls-custom {
    margin: 0;
    gap: 8px;
    max-width: 140px;
}

.purchase-controls-custom .quantity-btn-custom {
    width: 35px;
    height: 35px;
    font-size: 16px;
}

.purchase-controls-custom .quantity-input-custom {
    width: 60px;
    height: 35px;
    font-size: 1.1rem;
}

.btn-add-cart-custom {
    flex: 1;
    min-width: 180px;
    margin: 0 !important;
    height: 45px;
    font-size: 0.95rem;
}

.btn-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
}

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-primary-custom {
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, #B8860B 0%, #996F00 100%);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

.btn-whatsapp-custom {
    background: #25D366;
    color: white;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp-custom:hover {
    background: #20b358;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

/* Responsividade para modal customizado */
@media (max-width: 1024px) {
    .modal-content-custom {
        flex-direction: column;
    }
    
    .modal-image-section {
        flex: 0 0 30%; /* Reduzido de 45% para 30% */
    }
    
    .modal-info-section {
        flex: 0 0 70%; /* Aumentado de 55% para 70% */
        padding: 18px;
    }
    
    .product-name-custom {
        font-size: 1.6rem;
    }
    
    .product-price-custom {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .modal-content-custom {
        flex-direction: column !important; /* Layout vertical no mobile */
        height: 100vh !important;
    }
    
    .modal-image-section {
        flex: 0 0 40% !important; /* 40% da altura para imagem */
        max-height: 40vh !important;
        padding: 10px !important;
    }
    
    .modal-product-image {
        max-height: 35vh !important;
        border-radius: 8px !important;
    }
    
    .modal-info-section {
        flex: 0 0 60% !important; /* 60% da altura para conteúdo */
        padding: 15px !important;
        height: 60vh !important;
        overflow-y: hidden !important;
    }
    
    .product-info-custom {
        max-height: calc(60vh - 180px) !important; /* Espaço para botões no mobile */
        overflow-y: auto !important;
        padding-right: 5px !important;
    }
    
    .purchase-section-custom {
        margin: 10px -15px -15px -15px !important;
        padding: 12px !important;
        min-height: 70px !important;
        max-height: 80px !important;
    }
    
    .purchase-controls-custom {
        gap: 10px !important;
        flex-wrap: nowrap !important;
    }
    
    .purchase-controls-custom .quantity-label-custom {
        font-size: 0.8rem !important;
    }
    
    .purchase-controls-custom .quantity-controls-custom {
        gap: 6px !important;
        max-width: 120px !important;
    }
    
    .purchase-controls-custom .quantity-btn-custom {
        width: 30px !important;
        height: 30px !important;
        font-size: 14px !important;
    }
    
    .purchase-controls-custom .quantity-input-custom {
        width: 50px !important;
        height: 30px !important;
        font-size: 1rem !important;
    }
    
    .btn-add-cart-custom {
        min-width: 140px !important;
        height: 40px !important;
        font-size: 0.85rem !important;
        padding: 8px 12px !important;
    }
    
    .product-name-custom {
        font-size: 1.4rem !important;
        margin-bottom: 8px !important;
    }
    
    .product-price-custom {
        font-size: 1.8rem !important;
        margin-bottom: 12px !important;
    }
    
    .product-description-custom {
        font-size: 0.9rem !important;
        margin-bottom: 15px !important;
    }
    
    .product-features-custom {
        margin-bottom: 8px !important;
    }
    
    .product-features-custom h4 {
        font-size: 0.9rem !important;
        margin-bottom: 8px !important;
    }
    
    .product-features-custom li {
        font-size: 0.8rem !important;
        margin-bottom: 6px !important;
    }
    
    .quantity-section-custom {
        margin-bottom: 8px !important;
    }
    
    .quantity-label-custom {
        font-size: 0.9rem !important;
        margin-bottom: 4px !important;
    }
    
    .quantity-controls-custom {
        gap: 12px !important;
        max-width: 160px !important;
    }
    
    .quantity-btn-custom {
        width: 35px !important;
        height: 35px !important;
        font-size: 16px !important;
    }
    
    .quantity-input-custom {
        width: 60px !important;
        height: 35px !important;
        font-size: 1.1rem !important;
    }
    
    .action-buttons-custom {
        gap: 6px !important;
    }
    
    .btn-custom {
        padding: 12px 16px !important;
        font-size: 0.95rem !important;
        border-radius: 12px !important;
    }
}

@media (max-width: 576px) {
    .modal-title-custom {
        font-size: 1.2rem !important;
    }
    
    .modal-header-custom {
        height: 70px !important;
        padding: 0 15px !important;
    }
    
    .modal-content-custom {
        height: calc(100vh - 70px) !important;
    }
    
    .modal-image-section {
        flex: 0 0 35% !important;
        max-height: 35vh !important;
        padding: 8px !important;
    }
    
    .modal-product-image {
        max-height: 30vh !important;
        border-radius: 6px !important;
    }
    
    .modal-info-section {
        flex: 0 0 65% !important;
        height: 65vh !important;
        padding: 12px !important;
    }
    
    .product-info-custom {
        max-height: calc(65vh - 160px) !important;
        padding-right: 3px !important;
    }
    
    .purchase-section-custom {
        margin: 8px -12px -12px -12px !important;
        padding: 8px !important;
        min-height: 60px !important;
        max-height: 70px !important;
    }
    
    .purchase-controls-custom {
        gap: 8px !important;
        flex-wrap: nowrap !important;
    }
    
    .purchase-controls-custom .quantity-label-custom {
        font-size: 0.75rem !important;
    }
    
    .purchase-controls-custom .quantity-controls-custom {
        gap: 4px !important;
        max-width: 100px !important;
    }
    
    .purchase-controls-custom .quantity-btn-custom {
        width: 28px !important;
        height: 28px !important;
        font-size: 12px !important;
    }
    
    .purchase-controls-custom .quantity-input-custom {
        width: 40px !important;
        height: 28px !important;
        font-size: 0.9rem !important;
    }
    
    .btn-add-cart-custom {
        min-width: 120px !important;
        height: 35px !important;
        font-size: 0.8rem !important;
        padding: 6px 10px !important;
    }
    
    .product-name-custom {
        font-size: 1.2rem !important;
        margin-bottom: 6px !important;
    }
    
    .product-price-custom {
        font-size: 1.6rem !important;
        margin-bottom: 10px !important;
    }
    
    .product-description-custom {
        font-size: 0.85rem !important;
        margin-bottom: 12px !important;
        line-height: 1.4 !important;
    }
    
    .product-features-custom {
        margin-bottom: 6px !important;
    }
    
    .product-features-custom h4 {
        font-size: 0.85rem !important;
        margin-bottom: 6px !important;
    }
    
    .product-features-custom li {
        font-size: 0.75rem !important;
        margin-bottom: 4px !important;
    }
    
    .quantity-section-custom {
        margin-bottom: 6px !important;
    }
    
    .quantity-label-custom {
        font-size: 0.85rem !important;
        margin-bottom: 3px !important;
    }
    
    .quantity-controls-custom {
        gap: 10px !important;
        max-width: 140px !important;
    }
    
    .quantity-btn-custom {
        width: 32px !important;
        height: 32px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
    }
    
    .quantity-input-custom {
        width: 50px !important;
        height: 32px !important;
        font-size: 1rem !important;
        border-radius: 8px !important;
    }
    
    .action-buttons-custom {
        gap: 5px !important;
    }
    
    .btn-custom {
        padding: 10px 14px !important;
        font-size: 0.9rem !important;
        border-radius: 10px !important;
    }
}
