/* 
 * Catalog CSS - Caos Sereno
 * Baseado no design do site www.caossereno.com.br 
 */

:root {
    --primary-color: #667748;     /* Verde oliva (era Azul escuro) */
    --secondary-color: #667748;   /* Verde oliva (era Azul) */
    --accent-color: #e74c3c;      /* Vermelho */
    --light-gray: #f8f9fa;
    --text-color: #333;
    --header-height: 80px;
}

/* Base */
body {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-color);
    background-color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* Evita scroll horizontal */
}

a {
    text-decoration: none;
    color: var(--secondary-color);
}

/* Header */
.announcement-bar {
    background-color: var(--secondary-color);
    color: white;
    padding: 8px 0;
    text-align: center;
    font-size: 0.9rem;
    white-space: normal; /* Permite quebra de linha */
    line-height: 1.3;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--primary-color);
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--primary-color);
    transition: color 0.3s;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    color: var(--secondary-color);
}

.navbar-nav .dropdown-menu {
    border-radius: 0;
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.navbar-nav .dropdown-item:hover,
.navbar-nav .dropdown-item:focus {
    background-color: var(--light-gray);
    color: var(--secondary-color);
}

/* Banner Rotativo */
.main-banner {
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
    overflow: hidden;
}

.banner-image {
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f8f9fa;
    position: relative;
}

/* Banner Desktop: 1600x561px - Aumentando altura para melhor visualização */
.desktop-banner {
    height: 600px;
    max-height: 60vh;
    min-height: 450px;
}

/* Banner Mobile: 390x457px - Aumentando altura para melhor visualização */
.mobile-banner {
    height: 400px;
    max-height: 60vh;
    min-height: 300px;
}

/* Customização dos controles do carousel */
.main-banner .carousel-control-prev,
.main-banner .carousel-control-next {
    width: 5%;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.main-banner .carousel-control-prev:hover,
.main-banner .carousel-control-next:hover {
    opacity: 1;
}

.main-banner .carousel-control-prev-icon,
.main-banner .carousel-control-next-icon {
    background-size: 60%;
    filter: drop-shadow(0 0 3px rgba(0,0,0,0.5));
}

/* Indicadores customizados */
.main-banner .carousel-indicators {
    margin-bottom: 1rem;
}

.main-banner .carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 4px;
    background-color: rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.8);
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.3));
}

.main-banner .carousel-indicators .active {
    background-color: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 1);
}

/* Transições suaves */
.main-banner .carousel-item {
    transition: transform 0.6s ease-in-out;
}

/* Otimização para performance */
.main-banner .banner-image {
    will-change: transform;
    transform: translateZ(0);
}

/* Hero Section */
.hero-section {
    background-color: var(--primary-color);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.hero-section h1 {
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: calc(1.3rem + 1vw); /* Tamanho responsivo */
}

.hero-section p {
    font-size: 1rem;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Product List */
.product-list-item {
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 1.5rem;
}

.product-list-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.product-img-container {
    height: 100%;
    min-height: 180px;
    min-width: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #ffffff;
    transition: opacity 0.3s ease;
}

/* Adicionando novo wrapper para imagens */
.product-img-wrapper {
    height: 100%;
    min-height: 180px;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
}

@media (max-width: 767.98px) {
    .product-img-container {
        height: 200px;
        width: 100%;
    }
    
    .product-img-wrapper {
        height: 250px;
    }
}

/* Product Cards */
.product-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.product-img {
    height: 250px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.product-card .card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.product-price {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.product-discount {
    color: #6c757d;
    text-decoration: line-through;
    font-size: 0.9rem;
}

/* Filters */
.filter-section {
    background-color: var(--light-gray);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    position: sticky;
    top: 20px; /* Mantém o filtro visível ao rolar */
}

.filter-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.filter-section .form-check-label {
    cursor: pointer;
}

/* Pagination */
.pagination {
    margin-top: 2rem;
    flex-wrap: wrap; /* Permite quebra de linha na paginação */
    justify-content: center;
}

.page-link {
    color: var(--primary-color);
    border-color: #dee2e6;
    min-width: 40px; /* Tamanho mínimo para facilitar o toque */
    text-align: center;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    padding: 3rem 0 0 0;
    margin-top: auto;
}

footer h5 {
    font-weight: 600;
    margin-bottom: 1.5rem;
}

footer ul {
    list-style: none;
    padding-left: 0;
}

footer ul li {
    margin-bottom: 0.5rem;
}

footer a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: rgba(255,255,255,0.8);
    text-decoration: underline;
}

.copyright {
    background-color: rgba(0,0,0,0.2);
    padding: 1rem 0;
    margin-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
}

/* Buttons */
.btn-primary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #556339; /* Tom de verde mais escuro */
    border-color: #556339;
}

.btn-outline-primary {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* Product Detail Page */
.breadcrumb {
    background-color: transparent;
    padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
}

.product-detail-img {
    max-width: 100%;
    height: auto;
}

.product-variants .btn-check:checked + .btn {
    background-color: var(--primary-color);
    color: white;
}

/* Custom Classes */
.text-success {
    color: #28a745 !important;
}

.bg-success {
    background-color: #28a745 !important;
}

.text-primary {
    color: var(--secondary-color) !important;
}

.bg-primary {
    background-color: var(--secondary-color) !important;
}

/* Form controls para variantes */
.product-variant-form .form-group {
    margin-bottom: 0.5rem;
}

.product-variant-form .form-label {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.product-qty {
    min-width: 50px;
    max-width: 70px;
    text-align: center;
}

/* Ajuste para visualização mobile das variantes */
@media (max-width: 767.98px) {
    /* Banner responsivo para mobile */
    .main-banner {
        margin-bottom: 1rem;
    }
    
    .mobile-banner {
        height: 300px;
        max-height: 50vh;
        min-height: 250px;
    }
    
    .main-banner .carousel-control-prev,
    .main-banner .carousel-control-next {
        width: 8%;
    }
    
    .main-banner .carousel-control-prev-icon,
    .main-banner .carousel-control-next-icon {
        background-size: 50%;
    }
    
    .main-banner .carousel-indicators [data-bs-target] {
        width: 10px;
        height: 10px;
        margin: 0 3px;
    }

    .product-variant-form .row .col-md-3 {
        margin-bottom: 10px;
    }
    
    .product-img-container {
        height: 200px;
        background-size: contain;
        background-color: #ffffff;
    }
    
    .card-body {
        padding: 1rem;
    }

    /* Ajustes para o cabeçalho móvel */
    .navbar .container {
        flex-wrap: nowrap;
    }

    .navbar-brand img {
        max-width: 200px;
    }

    /* Melhorar exibição de produtos em mobile */
    .row.g-0 {
        flex-direction: column;
    }

    .col-md-9 {
        width: 100%;
    }

    .col-md-3 {
        width: 100%;
    }

    /* Garantir botões de tamanho adequado para toque */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        min-height: 44px;
    }

    .input-group .btn {
        min-height: 38px;
    }

    /* Melhorar carrinho em mobile */
    .cart-item .row {
        flex-direction: column;
    }

    .cart-item .col-md-6,
    .cart-item .col-md-2 {
        width: 100%;
        text-align: left;
        margin-bottom: 0.5rem;
    }

    .cart-item .input-group {
        margin: 0 !important;
    }

    /* Ajustar os espaçamentos */
    .my-5 {
        margin-top: 2rem !important;
        margin-bottom: 2rem !important;
    }

    .hero-section {
        padding: 2rem 0;
    }

    /* Imagem de produtos responsiva */
    .product-img-container {
        width: 100%;
        height: 250px;
    }
}

/* Ajustes específicos para tablets */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Banner responsivo para tablets */
    .desktop-banner {
        height: 400px;
        max-height: 45vh;
        min-height: 300px;
    }

    .product-variant-form .row > div {
        margin-bottom: 10px;
    }

    .hero-section h1 {
        font-size: calc(1.5rem + 0.5vw);
    }

    .navbar-brand img {
        max-width: 250px;
    }
}

/* Outros ajustes */
.add-to-cart-btn {
    min-width: 160px;
    background-color: #667748 !important;  /* Verde oliva */
    border-color: #667748 !important;
}

.add-to-cart-btn:hover,
.add-to-cart-btn:focus {
    background-color: #556339 !important; /* Verde oliva mais escuro */
    border-color: #556339 !important;
}

/* Melhorias no carrinho */
.cart-item {
    transition: background-color 0.2s;
}

.cart-item:hover {
    background-color: rgba(0,0,0,0.02);
}

.cart-item-remove {
    border: none;
    background: none;
}

/* Acessibilidade para botões e links */
a, button, .btn, input[type="button"], input[type="submit"] {
    transition: all 0.2s ease;
}

a:focus, button:focus, .btn:focus, input[type="button"]:focus, input[type="submit"]:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Melhorias em modais e overlays */
#loading-overlay {
    z-index: 9999;
}

/* Melhorias para dispositivos de toque */
@media (hover: none) {
    .product-list-item:hover {
        transform: none;
    }
    
    .product-card:hover {
        transform: none;
    }
    
    /* Aumentar área de toque para elementos interativos */
    .form-check-label {
        padding: 8px 0;
    }
    
    /* Facilitar a seleção de dropdown em mobile */
    select.form-select {
        font-size: 16px; /* Evita zoom em dispositivos iOS */
        padding: 10px;
    }
}

/* Melhorias para diferentes proporções de tela */
@media (orientation: portrait) {
    .hero-section {
        padding: 2rem 0;
    }
}

@media (max-width: 575.98px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .product-title {
        font-size: 1rem;
    }
    
    .product-price {
        font-size: 1.1rem;
    }
    
    /* Ajustar o layout do rodapé */
    footer h5 {
        margin-top: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .copyright {
        font-size: 0.8rem;
    }
    
    /* Ajustes para formulários */
    .input-group {
        flex-wrap: nowrap;
    }
}

/* Melhorias adicionais de responsividade */
@media (max-width: 576px) {
    /* Banner para telas muito pequenas */
    .mobile-banner {
        height: 280px;
        max-height: 45vh;
        min-height: 220px;
    }
    
    .main-banner .carousel-indicators {
        margin-bottom: 0.5rem;
    }

    /* Melhorar legibilidade de textos em telas pequenas */
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    /* Garantir que botões sejam fáceis de tocar em mobile */
    .btn {
        padding: 0.5rem;
        min-height: 44px;
        font-size: 0.9rem;
    }
    
    /* Ajustar tamanho das imagens em listas */
    .product-img-container {
        height: 220px;
        background-size: contain;
        background-color: #ffffff;
    }
    
    .product-img-wrapper {
        height: 220px;
    }
    
    /* Melhorar visualização do carrinho em mobile */
    #mobile-cart-items .card {
        border-radius: 6px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        margin-bottom: 12px;
    }
    
    /* Fazer formulários mais amigáveis para toque */
    input, select, textarea {
        font-size: 16px !important; /* Evita zoom automático em iOS */
    }

    /* Ajustes gerais do carrinho */
    #mobile-cart-items .card {
        border-radius: 6px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        margin-bottom: 12px;
    }

    /* Título do produto */
    .cart-item-title {
        font-size: 15px !important;
        font-weight: 600 !important;
        line-height: 1.3;
        color: #333;
    }

    /* Botão de remoção */
    .cart-item-remove {
        color: #999 !important;
        background: transparent;
        border: none;
        padding: 8px !important;
    }
    
    .cart-item-remove i {
        font-size: 16px;
    }

    /* Detalhes de variantes */
    .cart-item-variant {
        font-size: 12px !important;
        color: #666 !important;
    }

    /* Controles de quantidade no carrinho */
    .cart-item .input-group {
        border: 1px solid #ddd;
        border-radius: 4px;
        overflow: hidden;
    }

    .cart-item .input-group-sm .btn {
        border: none;
        background-color: #f8f8f8;
        color: #666;
        min-width: 30px;
        padding: 0;
    }

    .cart-item .input-group-sm .form-control {
        border: none;
        border-left: 1px solid #eee;
        border-right: 1px solid #eee;
        font-size: 14px;
    }

    /* Preço e subtotal */
    .cart-item-price {
        font-size: 15px !important;
    }

    /* Botão de finalizar compra mais proeminente */
    #checkout-button-mobile {
        font-weight: 600;
        font-size: 16px !important;
        padding: 12px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        margin-top: 8px;
    }
}

/* Garantir boa visualização em dispositivos de tamanho médio */
@media (min-width: 577px) and (max-width: 991px) {
    .container {
        max-width: 95%;
    }
    
    .product-variant-form .row {
        margin: 0 -5px;
    }
    
    .product-variant-form .row > div {
        padding: 0 5px;
    }
}

/* Melhorias para suporte a dispositivos com tela grande */
@media (min-width: 1400px) {
    /* Banner para telas grandes */
    .desktop-banner {
        height: 600px;
        max-height: 55vh;
        min-height: 450px;
    }

    .container {
        max-width: 1320px;
    }
    
    .product-img-container {
        height: 300px;
        background-size: contain;
        background-color: #ffffff;
    }
    
    .product-img-wrapper {
        height: 300px;
    }
}

/* Ajustes para orientação paisagem em dispositivos móveis */
@media (orientation: landscape) and (max-height: 576px) {
    /* Banner em landscape para mobile */
    .mobile-banner {
        height: 250px;
        max-height: 70vh;
        min-height: 200px;
    }
    
    .main-banner {
        margin-bottom: 1rem;
    }

    .hero-section {
        padding: 1rem 0;
    }
}

/* Otimizações para dispositivos de toque */
@media (pointer: coarse) {
    .form-check {
        margin-bottom: 0.75rem;
    }
    
    .form-check-label {
        padding: 0.5rem 0;
    }
    
    .product-list-item:hover, 
    .product-card:hover {
        transform: none; /* Evita problemas de hover em dispositivos de toque */
    }
}

/* Melhorias para acessibilidade e foco */
:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

button:focus, a:focus, input:focus, select:focus {
    box-shadow: 0 0 0 3px rgba(102, 119, 72, 0.25);
}

/* Ajustes para dark mode */
@media (prefers-color-scheme: dark) {
    .filter-section, 
    .card,
    .form-control,
    .form-select {
        background-color: #222;
        border-color: #444;
        color: #eee;
    }
    
    .text-muted {
        color: #aaa !important;
    }
    
    .hero-section {
        background-color: #333;
    }
} 