/* Layout moderno e-commerce - MSS-Catálogo */
:root {
    --catalog-title-bar-height: 52px;
    --categories-bar-height: 52px;
    --catalog-fixed-header-offset: calc(var(--catalog-title-bar-height) + var(--categories-bar-height));
    --card-radius: 0.5rem;
    --shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-hover: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

body.has-categories-bar,
body {
    padding-top: var(--catalog-fixed-header-offset);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding-bottom: 7rem; /* espaço para o box Total do Pedido no celular */
}

/* Cabeçalho fixo: nome/logo do catálogo + barra de categorias */
.catalog-fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1020;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.catalog-title-bar {
    flex: 0 0 var(--catalog-title-bar-height);
    height: var(--catalog-title-bar-height);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-bottom: 1px solid #e8e2d9;
}

.catalog-header-logo {
    min-height: 0;
    line-height: 1.2;
}

.catalog-header-logo-link:hover .section-logo-fallback {
    color: #0d6efd;
}

/* Barra de categorias - botões em formato pílula */
.categories-bar {
    flex: 0 0 var(--categories-bar-height);
    height: var(--categories-bar-height);
    background: #82929f;
    border-bottom: 1px solid #e8e2d9;
    display: flex;
    align-items: center;
}

.categories-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.categories-buttons::-webkit-scrollbar {
    height: 4px;
}

.category-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    background: #ffffff;
    color: #363636;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid #cc8f16;
    border-radius: 9999px;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.category-btn:hover {
    background: #e7a96b;
    border-color: #d0ccc4;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    color: #2a2a2a;
}

.category-btn:active,
.category-btn.active {
    background: #d4a036;
    border-color: #d0ccc4;
    box-shadow: none;
    color: #363636;
}

.category-btn.active:hover {
    background: #e6ab35;
    color: #363636;
}

/* Quando não há barra de categorias (ex: página sem categorias) */
body:not(.has-categories-bar) {
    padding-top: var(--navbar-height);
}

/* Banner */
.banner-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.section-title {
    font-weight: 700;
    font-size: 1.25rem;
    color: #212529;
}

/* Logo no lugar de "Produtos em destaque" */
.section-logo {
    min-height: 2.5rem;
}

.section-logo-img {
    max-height: 48px;
    width: auto;
    object-fit: contain;
}

.catalog-title-bar .section-logo-img {
    max-height: 40px;
    vertical-align: middle;
}

.section-logo-fallback {
    display: none;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
}

.catalog-title-bar .section-logo-fallback {
    font-size: 1.125rem;
    line-height: 1.2;
}

/* Cards de produto - layout horizontal, pouco espaçamento entre itens */
.products-section .row.product-list-row,
.product-list-row {
    --card-gap: 0.25rem;
    gap: var(--card-gap);
}

.product-card {
    border: 1px solid #eee;
    border-radius: var(--card-radius);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
    overflow: hidden;
    background: #fff;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover) !important;
    border-color: #dee2e6;
}

/* Card em linha: imagem à esquerda, informações à direita */
.product-card-horizontal {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 100px;
}

.product-card-horizontal .product-card-link {
    display: flex;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.product-card-horizontal .card-img-wrapper {
    width: 100px;
    min-width: 100px;
    flex-shrink: 0;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f8f9fa;
}

@media (min-width: 768px) {
    .product-card-horizontal .card-img-wrapper {
        width: 120px;
        min-width: 120px;
    }
}

.product-card-horizontal .card-img-top {
    object-fit: contain;
    height: 100%;
    width: 100%;
    padding: 0.4rem;
}

.product-card-horizontal .no-image {
    height: 100%;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 2rem;
}

.product-card-horizontal .product-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.85rem 1rem;
    min-width: 0;
}

.product-card-horizontal .card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #1a1a1a;
}

.product-card-horizontal .card-text.text-primary {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0d6efd !important;
}

.product-card-horizontal .product-card-qty {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 0.6rem 0.75rem;
    background: #e8f4fc;
    border-left: 1px solid #eee;
}

/* Página do produto */
.product-main-image {
    aspect-ratio: 1;
    max-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-main-image .no-image.large {
    width: 100%;
    min-height: 300px;
}

.product-gallery {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.gallery-thumb {
    width: 60px;
    height: 60px;
    padding: 0;
    border: 2px solid #dee2e6;
    border-radius: 0.35rem;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.gallery-thumb:hover,
.gallery-thumb.active {
    border-color: #0d6efd;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.9rem;
}

/* Seletor de quantidade no card (cardápio) - fácil de tocar no celular */
.quantity-row,
.product-card-qty .quantity-selector {
    background: transparent !important;
}

.product-card-qty .quantity-selector {
    margin: 0;
}

.quantity-selector .btn {
    min-width: 36px;
    min-height: 36px;
    padding: 0.35rem;
    font-size: 1.1rem;
}

.quantity-selector .qty-value {
    min-width: 2rem;
    text-align: center;
    font-size: 1rem;
}

/* Total do Pedido - valor em destaque amarelo */
.order-total-box {
    position: fixed;
    bottom: 0.95rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1030;
    width: calc(100% - 2rem);
    max-width: 330px;
    background: #0d6efd;
    color: #fff;
    padding: 0.4rem 0.75rem 0.45rem;
    border-radius: 0.4rem;
    box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.18);
    text-align: center;
}

.order-total-label {
    font-size: 1rem;
    opacity: 0.95;
    color: #fff;
    line-height: 1.2;
}

.order-total-value {
    font-size: 1.9rem;
    font-weight: 800;
    margin: 0.05rem 0;
    line-height: 1.15;
    color: #ffc107;
    text-shadow: 0 0 1px rgba(0,0,0,0.3);
}

.order-total-hint {
    font-size: 0.8rem;
    opacity: 0.9;
    line-height: 1.15;
    margin-top: 0.1rem;
    color: rgba(255,255,255,0.95);
}

/* Footer */
footer {
    margin-top: auto;
}

/* Paginação */
.pagination .page-link {
    border-radius: 0.25rem;
    margin: 0 1px;
}
