/* ===== VARIÁVEIS E RESET ===== */
:root {
    --primary: #d32f2f;
    --primary-dark: #b71c1c;
    --secondary: #2e7d32;
    --accent: #ffd700;
    --text: #333333;
    --text-light: #666666;
    --background: #ffffff;
    --surface: #f8f9fa;
    --border: #e0e0e0;
    --success: #4caf50;
    --warning: #ffa726;
    --error: #f44336;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: var(--text);
    line-height: 1.6;
}

/* ===== LAYOUT PRINCIPAL ===== */
.app-container {
    max-width: 100%;
    min-height: 100vh;
    background: var(--background);
    position: relative;
}

/* ===== CABEÇALHO ===== */
.store-header {
    background: var(--primary);
    position: relative;
}

.store-cover {
    height: 200px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

.cover-content h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.cover-content p {
    opacity: 0.9;
    font-size: 1rem;
}

.store-profile {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background: var(--background);
    gap: 1rem;
}

.profile-avatar {
    flex-shrink: 0;
}

.avatar-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--accent), #ffab00);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 4px solid var(--background);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.store-details {
    flex: 1;
}

.store-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.store-description {
    color: var(--text);
    font-size: 0.95rem;
}

/* ===== BARRA DE INFORMAÇÕES ===== */
.info-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.countdown {
    padding: 1rem;
    text-align: center;
    background: var(--accent);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.95rem;
}

.promo-banner {
    padding: 0.75rem 1rem;
    text-align: center;
    background: var(--secondary);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===== PESQUISA ===== */
.search-section {
    padding: 1rem;
    background: var(--background);
    border-bottom: 1px solid var(--border);
}

.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border);
    border-radius: 50px;
    font-size: 1rem;
    background: var(--surface);
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--background);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

/* ===== CATEGORIAS ===== */
.categories-nav {
    background: var(--background);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.categories-nav::-webkit-scrollbar {
    display: none;
}

.categories-scroll {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    min-width: max-content;
}

.category-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 80px;
    white-space: nowrap;
}

.category-tab:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.category-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: scale(1.05);
}

.tab-icon {
    font-size: 1.5rem;
}

.tab-label {
    font-size: 0.8rem;
    font-weight: 500;
}

/* ===== PRODUTOS ===== */
.products-main {
    padding: 1rem;
    background: var(--surface);
    min-height: 50vh;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.product-card {
    background: var(--background);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-image {
    position: relative;
    height: 160px;
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.product-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--warning);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.product-content {
    padding: 1.25rem;
}

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

.product-description {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.product-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border-radius: 25px;
    padding: 0.5rem;
}

.quantity-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.quantity-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.quantity-display {
    font-size: 1rem;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
    color: var(--text);
}

/* ===== ESTADO VAZIO ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    display: none;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.reset-filters {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.reset-filters:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ===== CARRINHO FLUTUANTE ===== */
.cart-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.floating-cart {
    background: var(--background);
    padding: 1rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    display: none;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
}

.floating-cart.active {
    display: flex;
}

.cart-preview {
    display: flex;
    flex-direction: column;
}

.cart-count {
    font-size: 0.9rem;
    color: var(--text-light);
}

.cart-total {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

.cart-toggle {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.cart-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* ===== PAINEL DO CARRINHO ===== */
.cart-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: var(--background);
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    transition: right 0.3s ease;
    z-index: 1100;
    display: flex;
    flex-direction: column;
}

.cart-panel.active {
    right: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.panel-header h3 {
    color: var(--primary);
    margin: 0;
}

.panel-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s;
}

.panel-close:hover {
    background: var(--surface);
    color: var(--text);
}

.panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-items {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
    border-bottom: none;
}

/* ===== SEÇÃO DE CUPOM ===== */
.coupon-section {
    padding: 1rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.coupon-input {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.coupon-input input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 0.9rem;
}

.coupon-input button {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.coupon-input button:hover {
    background: #1b5e20;
}

.coupon-feedback {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    padding: 0.5rem;
    border-radius: 5px;
}

.coupon-feedback.success {
    background: #e8f5e9;
    color: var(--success);
}

.coupon-feedback.error {
    background: #ffebee;
    color: var(--error);
}

/* ===== RESUMO DO CARRINHO ===== */
.cart-summary {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.summary-row.discount {
    color: var(--success);
    display: none;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 2px solid var(--border);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

.checkout-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1rem;
}

.checkout-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ===== MODAL DE CHECKOUT ===== */
.checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 1rem;
}

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

.modal-content {
    background: var(--background);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--background);
    z-index: 1;
}

.modal-header h3 {
    color: var(--primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--surface);
    color: var(--text);
}

/* ===== FORMULÁRIO ===== */
.checkout-form {
    padding: 1.5rem;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h4 {
    margin-bottom: 1rem;
    color: var(--text);
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
    background: var(--surface);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--background);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

/* ===== MÉTODOS DE PAGAMENTO ===== */
.payment-methods {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.payment-option {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-option:hover {
    border-color: var(--primary);
}

.payment-option input[type="radio"] {
    margin-right: 1rem;
}

.payment-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.payment-icon {
    font-size: 1.25rem;
}

.submit-order {
    width: 100%;
    background: var(--success);
    color: white;
    border: none;
    padding: 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1rem;
}

.submit-order:hover {
    background: #45a049;
    transform: translateY(-2px);
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-scroll {
        padding: 0.75rem;
    }
    
    .category-tab {
        min-width: 70px;
        padding: 0.5rem 0.75rem;
    }
    
    .tab-icon {
        font-size: 1.25rem;
    }
    
    .tab-label {
        font-size: 0.75rem;
    }
}

@media (min-width: 1024px) {
    .app-container {
        max-width: 1200px;
        margin: 0 auto;
        box-shadow: 0 0 30px rgba(0,0,0,0.1);
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* ===== UTILITÁRIOS ===== */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}