/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* iFood Color Scheme */
    --primary-red: #EA1D2C;
    --secondary-red: #C11424;
    --accent-orange: #FF6B35;
    --dark-gray: #2E2E2E;
    --medium-gray: #666666;
    --light-gray: #F5F5F5;
    --border-gray: #E0E0E0;
    --white: #FFFFFF;
    --success-green: #00D084;
    --warning-yellow: #FFC107;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Spacing */
    --container-max-width: 1200px;
    --container-padding: 20px;
    --section-padding: 40px 0;
    
    /* Border radius */
    --border-radius-sm: 6px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark-gray);
    background-color: var(--white);
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Modal Styles */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--white);
    padding: 32px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    margin-bottom: 24px;
}

.modal-header i {
    font-size: 48px;
    color: var(--primary-red);
    margin-bottom: 16px;
    display: block;
}

.modal-header h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--dark-gray);
}

.modal-body p {
    font-size: 16px;
    color: var(--medium-gray);
    margin-bottom: 24px;
}

.location-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-primary, .btn-secondary {
    padding: 14px 24px;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-red);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--secondary-red);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--medium-gray);
    border: 2px solid var(--border-gray);
}

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

/* Distance Bar */
.distance-bar {
    background: linear-gradient(135deg, var(--success-green), #00B874);
    color: var(--white);
    padding: 12px 0;
    text-align: center;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.distance-bar.hidden {
    display: none;
}

.distance-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 14px;
}

.distance-info i {
    font-size: 16px;
}

.delivery-time {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 12px;
}

/* Header */
.header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-gray);
    padding: 24px 0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 24px;
}

.restaurant-logo {
    background: linear-gradient(135deg, var(--primary-red), var(--secondary-red));
    color: var(--white);
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.logo-subtitle {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.9;
}

.restaurant-details {
    flex: 1;
}

.restaurant-details h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark-gray);
    margin-bottom: 8px;
}

.restaurant-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--medium-gray);
    flex-wrap: wrap;
}

.rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--warning-yellow);
    font-weight: 500;
}

.rating i {
    color: var(--warning-yellow);
}

.delivery-fee {
    color: var(--success-green);
    font-weight: 500;
}

.restaurant-image {
    width: 120px;
    height: 80px;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

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

/* Navigation */
.navigation {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-gray);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-tabs {
    display: flex;
    overflow-x: auto;
    padding: 16px 0;
    gap: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

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

.nav-tab {
    padding: 12px 20px;
    background-color: var(--light-gray);
    color: var(--medium-gray);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.nav-tab:hover,
.nav-tab.active {
    background-color: var(--primary-red);
    color: var(--white);
}

/* Main Content */
.main-content {
    padding: var(--section-padding);
    background-color: var(--light-gray);
}

.product-section {
    margin-bottom: 48px;
}

.product-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-gray);
    margin-bottom: 24px;
    padding-left: 4px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

/* Product Cards */
.product-card {
    background-color: var(--white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border-gray);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.product-card.featured {
    border: 2px solid var(--primary-red);
    position: relative;
}

.product-card.featured::before {
    content: '🔥 DESTAQUE';
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: var(--primary-red);
    color: var(--white);
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 10px;
    font-weight: 600;
    z-index: 10;
}

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.discount-badge,
.promo-badge,
.bonus-badge,
.new-badge,
.best-seller-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: var(--border-radius-md);
    font-size: 12px;
    font-weight: 600;
    color: var(--white);
    z-index: 10;
}

.discount-badge {
    background-color: var(--accent-orange);
}

.promo-badge {
    background-color: var(--warning-yellow);
    color: var(--dark-gray);
}

.bonus-badge {
    background-color: var(--success-green);
}

.new-badge {
    background-color: #7c3aed;
}

.best-seller-badge {
    background-color: #e91e63;
}

.product-info {
    padding: 20px;
}

.product-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 12px;
    line-height: 1.4;
}

.product-info p {
    font-size: 14px;
    color: var(--medium-gray);
    margin-bottom: 12px;
    line-height: 1.5;
}

.weight,
.serves,
.note {
    font-size: 12px;
    color: var(--medium-gray);
    font-style: italic;
    margin-bottom: 8px;
}

.serves {
    color: var(--success-green);
    font-weight: 500;
}

.highlight {
    font-size: 13px;
    color: var(--primary-red);
    font-weight: 500;
    font-style: italic;
    margin-bottom: 8px;
}

.limited {
    font-size: 12px;
    color: var(--accent-orange);
    font-weight: 600;
    margin-top: 8px;
    margin-bottom: 8px;
}

.price-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

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

.original-price {
    font-size: 16px;
    color: var(--medium-gray);
    text-decoration: line-through;
}

.btn-checkout {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-red);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-checkout:hover {
    background-color: var(--secondary-red);
    transform: translateY(-1px);
}

.btn-checkout:active {
    transform: translateY(0);
}

/* Reviews Section */
.reviews-section {
    background-color: var(--white);
    padding: var(--section-padding);
    border-top: 1px solid var(--border-gray);
}

.reviews-section h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
}

.reviews-summary {
    margin-bottom: 32px;
}

.rating-overview {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.rating-score {
    text-align: center;
}

.score {
    font-size: 48px;
    font-weight: 700;
    color: var(--dark-gray);
    display: block;
    line-height: 1;
}

.stars {
    margin: 8px 0;
    color: var(--warning-yellow);
}

.review-count {
    font-size: 14px;
    color: var(--medium-gray);
}

.rating-breakdown {
    flex: 1;
    max-width: 300px;
}

.rating-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 14px;
}

.rating-bar span:first-child {
    width: 12px;
    color: var(--medium-gray);
}

.bar {
    flex: 1;
    height: 8px;
    background-color: var(--border-gray);
    border-radius: 4px;
    overflow: hidden;
}

.fill {
    height: 100%;
    background-color: var(--warning-yellow);
    transition: width 0.3s ease;
}

.rating-bar span:last-child {
    width: 40px;
    text-align: right;
    color: var(--medium-gray);
    font-size: 12px;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.review-item {
    padding: 20px;
    background-color: var(--light-gray);
    border-radius: var(--border-radius-md);
}

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

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reviewer-avatar {
    width: 40px;
    height: 40px;
    background-color: var(--primary-red);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.reviewer-name {
    font-weight: 500;
    color: var(--dark-gray);
    display: block;
    margin-bottom: 4px;
}

.review-rating {
    color: var(--warning-yellow);
    font-size: 12px;
}

.review-date {
    font-size: 12px;
    color: var(--medium-gray);
}

.review-text {
    line-height: 1.6;
    color: var(--dark-gray);
}

/* Footer */
.footer {
    background-color: var(--dark-gray);
    color: var(--white);
    padding: 40px 0 20px;
}

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

.footer h3,
.footer h4 {
    margin-bottom: 16px;
    font-weight: 600;
}

.footer h3 {
    color: var(--primary-red);
    font-size: 20px;
}

.footer p {
    margin-bottom: 8px;
    font-size: 14px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer i {
    width: 16px;
    color: var(--primary-red);
}

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

.social-links a {
    width: 36px;
    height: 36px;
    background-color: var(--primary-red);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.social-links a:hover {
    transform: scale(1.1);
}

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

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --container-padding: 16px;
        --section-padding: 24px 0;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .restaurant-details h1 {
        font-size: 24px;
    }
    
    .restaurant-meta {
        justify-content: center;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .rating-overview {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
        text-align: center;
    }
    
    .modal-content {
        padding: 24px;
        margin: 20px;
    }
    
    .location-buttons {
        gap: 8px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 12px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .restaurant-logo {
        width: 60px;
        height: 60px;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .logo-subtitle {
        font-size: 10px;
    }
    
    .nav-tabs {
        padding: 12px 0;
        gap: 6px;
    }
    
    .nav-tab {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .product-info {
        padding: 16px;
    }
    
    .product-info h3 {
        font-size: 16px;
    }
    
    .current-price {
        font-size: 18px;
    }
    
    .btn-checkout {
        padding: 12px;
        font-size: 14px;
    }
}

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

.product-card {
    animation: fadeIn 0.6s ease-out;
}

.product-card:nth-child(2) {
    animation-delay: 0.1s;
}

.product-card:nth-child(3) {
    animation-delay: 0.2s;
}

.product-card:nth-child(4) {
    animation-delay: 0.3s;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Focus styles for accessibility */
.btn-primary:focus,
.btn-secondary:focus,
.btn-checkout:focus,
.nav-tab:focus {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-gray: #999999;
        --medium-gray: #333333;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}
