:root {
    --primary-color: #dc3545;
    --secondary-color: #212529;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 12px;
    --box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: var(--secondary-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Install Banner */
.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 9998;
    padding: 12px 16px;
}

.install-content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.install-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.install-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.install-text strong {
    font-size: 16px;
}

.install-text span {
    font-size: 13px;
    color: #666;
}

.btn-install {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
}

.btn-close-install {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 4px;
}

/* Header */
.main-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    height: 60px;
}

.btn-menu {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-menu:hover {
    background: #f0f0f0;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    width: auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-cart, .btn-user {
    position: relative;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    text-decoration: none;
    transition: var(--transition);
}

.btn-cart:hover, .btn-user:hover {
    background: #f0f0f0;
}

.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary-color);
    color: white;
    font-size: 11px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: white;
    z-index: 200;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.side-menu.open {
    left: 0;
}

.menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.menu-header img {
    height: 40px;
}

#btn-close-menu {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.menu-content {
    padding: 16px 0;
}

.menu-list {
    list-style: none;
}

.menu-list li.divider {
    height: 1px;
    background: #eee;
    margin: 12px 20px;
}

.menu-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.menu-list a:hover {
    background: #f8f9fa;
    color: var(--primary-color);
}

.menu-list i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #c82333 100%);
    color: white;
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.hero-content h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-description {
    font-size: 18px;
    opacity: 0.95;
    margin-bottom: 24px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 24px;
}

.status-badge.open {
    background: rgba(40, 167, 69, 0.2);
    color: #d4edda;
}

.status-badge.closed {
    background: rgba(220, 53, 69, 0.3);
    color: #f8d7da;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-image {
    position: relative;
    z-index: 1;
}

.hero-image img {
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

/* Sections */
section {
    padding: 60px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 700;
}

.section-header p {
    color: #666;
    margin-top: 4px;
}

.btn-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 12px;
    background: white;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--secondary-color);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

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

.category-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color), #c82333);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.category-name {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
}

.badge-promo, .badge-novo, .badge-top {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: white;
}

.badge-promo { background: #dc3545; }
.badge-novo { background: #17a2b8; }
.badge-top { background: #ffc107; color: #333; }

.product-image {
    display: block;
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 16px;
}

.product-category {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--secondary-color);
    text-decoration: none;
    margin: 6px 0;
    line-height: 1.4;
}

.product-name:hover {
    color: var(--primary-color);
}

.product-volume {
    font-size: 12px;
    color: #666;
}

.product-price {
    margin: 10px 0;
}

.price-old {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    margin-right: 8px;
}

.price-current {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.product-actions {
    margin-top: 12px;
}

.btn-add-cart {
    width: 100%;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add-cart:hover {
    background: #c82333;
}

.btn-add-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* How It Works */
.how-it-works {
    background: white;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.step-card {
    text-align: center;
    padding: 40px 24px;
    position: relative;
}

.step-card i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.step-number {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.step-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.step-card p {
    color: #666;
}

/* QR Code Section */
.qrcode-section {
    background: var(--light-color);
}

.qrcode-content h2 {
    font-size: 32px;
    margin-bottom: 16px;
}

.qrcode-content p {
    color: #666;
    margin-bottom: 24px;
}

.feature-list {
    list-style: none;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.feature-list i {
    color: var(--success-color);
    font-size: 18px;
}

.qrcode-wrapper {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: inline-block;
}

.qrcode-img {
    width: 250px;
    height: 250px;
}

/* Footer */
.main-footer {
    background: var(--secondary-color);
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    font-size: 18px;
    margin-bottom: 20px;
    color: white;
}

.footer-section p, .footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    line-height: 2;
}

.footer-section a:hover {
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-social {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 14px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    padding: 16px 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left-color: var(--primary-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Cart Page */
.cart-section {
    padding: 40px 0;
}

.cart-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    box-shadow: var(--box-shadow);
}

.cart-item-image {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 18px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.quantity-control button {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.quantity-control button:hover {
    background: #f0f0f0;
}

.quantity-control span {
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.cart-summary {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 80px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.summary-row.total {
    border-bottom: none;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    padding-top: 16px;
    border-top: 2px solid #eee;
    margin-top: 10px;
}

/* Checkout */
.checkout-section {
    padding: 40px 0;
}

.checkout-card {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
}

.checkout-card h3 {
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.payment-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.payment-option {
    border: 2px solid #eee;
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

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

.payment-option.selected {
    border-color: var(--primary-color);
    background: rgba(220, 53, 69, 0.05);
}

.payment-option i {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.delivery-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.delivery-option {
    border: 2px solid #eee;
    border-radius: var(--border-radius);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.delivery-option.selected {
    border-color: var(--primary-color);
    background: rgba(220, 53, 69, 0.05);
}

/* Login & Register */
.auth-section {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 420px;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 8px;
}

.auth-card p {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.btn-auth {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-auth:hover {
    background: #c82333;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 32px;
    }
    
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-image {
        display: none;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .category-card {
        padding: 16px 8px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .cart-item {
        flex-direction: column;
    }
    
    .cart-item-image {
        width: 100%;
        height: 200px;
    }
    
    .delivery-options {
        grid-template-columns: 1fr;
    }
    
    .payment-options {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .product-image {
        height: 150px;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-name {
        font-size: 13px;
    }
    
    .price-current {
        font-size: 16px;
    }
    
    .btn-add-cart {
        padding: 8px;
        font-size: 13px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}
