/* Reset básico */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif; }
body { background-color: #f8f8f8; padding-bottom: 100px; }

/* --- 1. CABEÇALHO SUPERIOR (Banner e Info) --- */
.header-container {
    background: white;
    padding-bottom: 0;
    border-bottom: 1px solid #e0e0e0;
}

.banner {
    width: 100%;
    height: 140px;
    background-color: #006eff;
    background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('https://images.unsplash.com/photo-1510812431401-41d2bd2722f3?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&h=300&q=80');
    background-size: cover;
    background-position: center;
}

.store-info {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: white;
}

.store-logo {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    border: 3px solid white;
    background: linear-gradient(135deg, #006eff 0%, #4d94ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.store-details {
    margin-left: 15px;
    flex: 1;
}

.store-details h1 {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.store-status {
    color: #006eff;
    font-size: 13px;
    display: flex;
    align-items: center;
}

.store-status::before {
    content: "●";
    margin-right: 6px;
    font-size: 10px;
}

/* --- 2. BARRA DE ABAS COM CONTROLES --- */
.tabs-header {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.tabs-controls {
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: white;
    gap: 15px;
}

.control-btn {
    background: none;
    border: none;
    color: #006eff;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tabs-container {
    background: white;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.tabs-container::-webkit-scrollbar { 
    display: none; 
}

.tab-item {
    padding: 15px 0;
    margin-right: 25px;
    white-space: nowrap;
    text-decoration: none;
    color: #757575;
    font-weight: 600;
    font-size: 15px;
    position: relative;
    transition: color 0.2s;
    border: none;
    background: none;
    flex-shrink: 0;
    cursor: pointer;
}

.tab-item:last-child {
    margin-right: 20px;
}

.tab-item.active {
    color: #006eff;
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #006eff;
    border-radius: 3px 3px 0 0;
}

/* --- 3. MODAL DE BUSCA --- */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    padding-top: 100px;
}

.search-modal.active {
    display: flex;
}

.search-box {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.search-input-container {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 10px;
    padding: 12px 15px;
    margin-bottom: 20px;
}

.search-input-container input {
    flex: 1;
    border: none;
    background: none;
    font-size: 16px;
    outline: none;
    margin-left: 10px;
}

.search-results {
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.search-result-item:hover {
    background: #f9f9f9;
}

.search-result-item .material-icons {
    margin-right: 10px;
    color: #006eff;
}

/* --- 4. MODAL DAS SEÇÕES (3 BARRINHAS) --- */
.sections-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.sections-modal.active {
    display: flex;
}

.sections-box {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    max-height: 80vh;
    overflow-y: auto;
}

.sections-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #006eff;
}

.section-modal-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 16px;
    color: #333;
}

.section-modal-item:hover {
    background: #f9f9f9;
    color: #006eff;
}

.section-modal-item .material-icons {
    margin-right: 10px;
    color: #006eff;
}

/* --- 5. LAYOUT DOS PRODUTOS EM 2 COLUNAS COM IMAGEM À DIREITA --- */
.products-container {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.section-title {
    grid-column: 1 / -1; /* Ocupa todas as colunas */
    margin: 25px 0 15px 0;
    font-size: 20px;
    font-weight: 700;
    color: #333;
    scroll-margin-top: 80px;
}

.section-title:first-child {
    margin-top: 0;
}

/* CARD DE PRODUTO EM 2 COLUNAS COM IMAGEM À DIREITA - MESMO LAYOUT ORIGINAL */
.product-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center; /* Mantém alinhamento vertical */
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    position: relative;
    height: 100%;
    min-height: 140px;
}

/* MANTENDO O LAYOUT ORIGINAL: texto à esquerda, imagem à direita */
.product-info {
    flex: 1;
    padding-right: 90px; /* Espaço para a imagem à direita - MESMO DO ORIGINAL */
}

.product-info h4 {
    font-size: 15px;
    margin-bottom: 6px;
    color: #333;
    font-weight: 600;
    line-height: 1.3;
}

.product-info p {
    color: #006eff;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
}

.product-info .unit {
    color: #757575;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.3;
}

/* Container da imagem com botão minimalista - À DIREITA (MESMO DO ORIGINAL) */
.product-img-container {
    position: absolute; /* Mantém absolute como no original */
    right: 16px; /* Fixo à direita */
    top: 50%;
    transform: translateY(-50%);
    width: 70px;
    height: 70px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* BOTÃO MINIMALISTA NO CANTO INFERIOR DIREITO DA IMAGEM - CENTRALIZADO */
.add-button-minimal {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 26px;
    height: 26px;
    background-color: #006eff;
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    cursor: pointer;
    border: 2px solid white;
    z-index: 2;
    transition: all 0.2s;
}

.add-button-minimal:hover {
    background-color: #0059d6;
    transform: scale(1.1);
}

.add-button-minimal:active {
    transform: scale(0.95);
}

/* BADGE DE QUANTIDADE QUADRADO COM BORDAS ARREDONDADAS */
.quantity-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    min-width: 28px;
    height: 28px;
    background-color: #006eff;
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    cursor: pointer;
    border: 2px solid white;
    z-index: 2;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    user-select: none;
    padding: 0 6px;
}

.quantity-badge:hover {
    background-color: #0059d6;
    transform: scale(1.05);
}

.quantity-badge:active {
    transform: scale(0.95);
}

/* Animação de pulso */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.pulse-animation {
    animation: pulse 0.3s ease;
}

/* Animação de rotação */
@keyframes rotate {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

.rotate-animation {
    animation: rotate 0.5s ease;
}

/* Animação de número mudando */
@keyframes numberChange {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.number-change {
    animation: numberChange 0.3s ease;
}

/* Animação de transformação de + para número */
@keyframes transformToNumber {
    0% { 
        border-radius: 8px;
        width: 26px;
        min-width: 26px;
    }
    50% { 
        border-radius: 10px;
        width: 32px;
        min-width: 32px;
    }
    100% { 
        border-radius: 8px;
        min-width: 28px;
        width: auto;
    }
}

.transform-to-number {
    animation: transformToNumber 0.4s ease forwards;
}

/* Espaçador */
.spacer { 
    height: 30px; 
    grid-column: 1 / -1;
}

/* --- RESPONSIVIDADE --- */
@media (max-width: 768px) {
    .products-container {
        gap: 12px;
        padding: 15px;
    }
    
    .product-card {
        padding: 12px;
        min-height: 130px;
    }
    
    .product-info {
        padding-right: 80px; /* Ajuste proporcional */
    }
    
    .product-info h4 {
        font-size: 14px;
    }
    
    .product-info p {
        font-size: 15px;
    }
    
    .product-info .unit {
        font-size: 11px;
    }
    
    .product-img-container {
        width: 65px;
        height: 65px;
        right: 12px;
    }
}

@media (max-width: 640px) {
    .products-container {
        grid-template-columns: 1fr; /* 1 coluna em telas muito pequenas */
        gap: 10px;
    }
    
    .product-card {
        min-height: 140px;
    }
    
    .product-info {
        padding-right: 90px;
    }
    
    .product-img-container {
        width: 70px;
        height: 70px;
        right: 16px;
    }
}

@media (max-width: 480px) {
    .product-card {
        min-height: 130px;
    }
    
    .product-info {
        padding-right: 80px;
    }
    
    .product-img-container {
        width: 65px;
        height: 65px;
    }
    
    .add-button-minimal {
        width: 24px;
        height: 24px;
        font-size: 16px;
    }
    
    .quantity-badge {
        height: 24px;
        min-width: 24px;
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .product-info {
        padding-right: 70px;
    }
    
    .product-img-container {
        width: 60px;
        height: 60px;
    }
}

/* RESUMO DE PEDIDO FIXO NO RODAPÉ */
.order-summary {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 15px 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: space-between;
    border-top: 2px solid #006eff;
}

.order-summary.show {
    display: flex;
}

.summary-left {
    flex: 1;
}

.summary-quantity {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    margin-bottom: 4px;
}

.summary-price {
    color: #006eff;
    font-weight: bold;
    font-size: 18px;
}

.summary-right {
    margin-left: 20px;
}

.view-order-btn {
    background: #006eff;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-order-btn:hover {
    background-color: #0059d6;
}

/* Estilo para números maiores no badge */
.quantity-badge.double-digit {
    min-width: 34px;
    font-size: 13px;
}

.quantity-badge.triple-digit {
    min-width: 40px;
    font-size: 12px;
}

/* MODAL DO PEDIDO */
#orderModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

#orderModal.active {
    display: flex;
}

/* --- CHECKOUT MODAL STYLES --- */
.checkout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1100;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.checkout-container {
    background: white;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #006eff;
    color: white;
}

.checkout-header h2 {
    margin: 0;
    font-size: 22px;
}

.close-checkout {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkout-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.section-card {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.section-card h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #006eff;
}

.section-card h4 {
    margin: 15px 0 10px 0;
    color: #555;
    font-size: 16px;
}

.info-line {
    margin-bottom: 15px;
    padding: 10px;
    background: #e9f5ff;
    border-radius: 6px;
    color: #006eff;
}

/* Formulário */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* CEP Input Group */
.cep-input-group {
    display: flex;
    gap: 10px;
}

.cep-input-group input {
    flex: 1;
}

.cep-input-group button {
    background: #006eff;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    cursor: pointer;
    font-weight: 500;
}

.cep-input-group button:hover {
    background: #0059d6;
}

/* Botões */
.btn-salvar {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 500;
    width: 100%;
    margin-top: 10px;
}

.btn-salvar:hover {
    background: #218838;
}

.btn-finalizar {
    background: #006eff;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin-top: 20px;
}

.btn-finalizar:hover {
    background: #0059d6;
}

.btn-alterar {
    background: transparent;
    color: #006eff;
    border: 1px solid #006eff;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
}

/* Lista de produtos no checkout */
.products-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.product-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.product-name {
    font-size: 14px;
    color: #333;
}

.product-quantity {
    text-align: center;
    font-weight: 500;
    color: #666;
}

.product-price {
    text-align: right;
    font-weight: bold;
    color: #006eff;
}

/* Total section */
.total-section {
    border-top: 2px solid #006eff;
    padding-top: 15px;
    margin-top: 15px;
}

.subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.contato-info {
    flex: 1;
}

.contato-info strong {
    display: block;
    margin-bottom: 2px;
}

/* Responsividade */
@media (max-width: 768px) {
    .checkout-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .checkout-container {
        max-height: 95vh;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Estilos para o modal do pedido */
.order-item {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
    border: 1px solid #e0e0e0;
}

.order-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.order-item-name {
    font-weight: 600;
    color: #333;
    font-size: 15px;
    line-height: 1.3;
    flex: 1;
    padding-right: 10px;
}

.order-item-price {
    font-weight: bold;
    color: #006eff;
    font-size: 16px;
    white-space: nowrap;
}

.order-item-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-unit-price {
    color: #757575;
    font-size: 13px;
    font-weight: 500;
}

.order-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border-radius: 8px;
    padding: 4px;
    border: 1px solid #ddd;
}

.order-btn-minus, .order-btn-plus {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.order-btn-minus {
    color: #ff4444;
}

.order-btn-minus:hover {
    background: rgba(255, 68, 68, 0.1);
}

.order-btn-plus {
    color: #006eff;
}

.order-btn-plus:hover {
    background: rgba(0, 110, 255, 0.1);
}

.order-item-quantity {
    min-width: 30px;
    text-align: center;
    font-weight: bold;
    font-size: 15px;
    color: #333;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 6px;
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
    background: #f9f9f9;
    border-radius: 10px;
    border: 2px dashed #ddd;
}

/* Efeitos de hover para botões do modal */
#checkoutBtn:hover {
    background: #0059d6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 110, 255, 0.3);
}

#clearCartBtn:hover {
    background: rgba(0, 110, 255, 0.1);
    transform: translateY(-2px);
}