:root {
    --ifood-red: #ea1d2c;
    --ifood-bg: #ffffff;
    --ifood-gray-bg: #f2f2f2;
    --ifood-text: #3e3e3e;
    --ifood-text-muted: #717171;
    --ifood-success: #008947;
    --ifood-border: #e8e8e8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: #fdfdfd;
    color: var(--ifood-text);
    overflow-x: hidden;
    display: flex;
    justify-content: center;
}

#app {
    width: 100%;
    max-width: 440px;
    min-height: 100vh;
    background: white;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.02);
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: white;
    display: none;
    flex-direction: column;
    overflow-y: auto;
}

.screen.active {
    display: flex;
}

/* Header Component */
.app-header {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--ifood-border);
    position: sticky;
    top: 0;
    background: white;
    z-index: 100;
}

.btn-back {
    border: none;
    background: none;
    font-size: 1.5rem;
    color: var(--ifood-red);
    margin-right: 15px;
    cursor: pointer;
}

.header-title {
    font-size: 1rem;
    font-weight: 600;
}

/* Splash Screen */
#screen-splash {
    justify-content: center;
    align-items: center;
    background: var(--ifood-red);
    color: white;
}

.splash-logo-container {
    text-align: center;
}

.logo-white {
    width: 180px;
    margin-bottom: 20px;
}

/* Store Menu */
.store-banner-wrapper {
    position: relative;
}

.store-banner {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.store-info-overlay {
    padding: 0 20px;
    margin-top: -30px;
    display: flex;
    align-items: flex-start;
}

.store-logo-img {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background: white;
    padding: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.store-text-box {
    margin-left: 15px;
    padding-top: 35px; /* Offset to align with logo when it overlaps banner */
    flex: 1;
}

.store-name {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 6px;
    color: var(--ifood-text);
}

.store-stats {
    font-size: 0.8rem;
    color: var(--ifood-text-muted);
    display: flex;
    flex-wrap: wrap; /* Allow wrapping if content is too wide */
    gap: 10px 6px;
    align-items: center;
}

.rating-badge {
    color: #fcbb00;
    font-weight: 700;
}

/* Product Cards (iFood Style) */
.category-section {
    padding: 20px;
}

.category-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.product-item {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid var(--ifood-border);
    cursor: pointer;
}

.product-item:last-child {
    border-bottom: none;
}

.product-details {
    flex: 1;
    padding-right: 12px;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.product-desc {
    font-size: 0.85rem;
    color: var(--ifood-text-muted);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    margin-bottom: 10px;
}

.product-price {
    font-weight: 600;
    color: #3e3e3e;
}

/* Reviews Styling */
.reviews-container {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 5px;
}
.reviews-container::-webkit-scrollbar { display: none; } /* Hide for clean look */

.review-card {
    min-width: 250px;
    background: #fafafa;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--ifood-border);
}

.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.reviewer-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.reviewer-info {
    display: flex;
    flex-direction: column;
}

.reviewer-info strong { font-size: 0.9rem; }
.review-stars { color: #fcbb00; font-size: 0.8rem; letter-spacing: 2px; }
.review-text { font-size: 0.85rem; color: var(--ifood-text-muted); line-height: 1.4; }

/* Modal Dynamic Options */
.opt-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    margin-bottom: 2px;
}
.opt-label:hover { background: #f9f9f9; }
.opt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.badge-opt {
    background: #3e3e3e;
    color: white;
    font-size: 0.6rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
}

.product-img-box {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
}

.product-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Footer Cart Bar */
.cart-footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 440px;
    background: white;
    padding: 15px 20px;
    border-top: 1px solid var(--ifood-border);
    z-index: 200;
}

.btn-primary {
    width: 100%;
    background: var(--ifood-red);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
}

/* Checkout Phases */
.checkout-content {
    padding: 20px;
    flex: 1;
}

.checkout-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.checkout-subtitle {
    font-size: 0.9rem;
    color: var(--ifood-text-muted);
    margin-bottom: 30px;
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.form-field input, .form-field select {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--ifood-border);
    border-radius: 8px;
    font-size: 1rem;
    background: #fafafa;
}

/* Success Screen */
.success-check {
    width: 80px;
    height: 80px;
    background: var(--ifood-success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 40px auto 20px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 500;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 440px;
    border-radius: 20px 20px 0 0;
    padding: 24px;
    animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
}

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

@keyframes toastSlide {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Payment Options */
.pay-card {
    border: 1px solid var(--ifood-border);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.pay-card.active {
    border-color: var(--ifood-red);
    background: #fff8f8;
}

.pay-card input {
    accent-color: var(--ifood-red);
}

.opt-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 16px 18px;
    border: 1px solid #f0f0f0;
    border-radius: 14px;
    margin-bottom: 10px;
}

.qty-selector-mini {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 100px;
    border: 1px solid #eee;
}

.btn-mini {
    background: white;
    border: 1px solid #ddd;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--ifood-red);
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    transition: all 0.2s;
}

.btn-mini:hover { border-color: var(--ifood-red); }
.btn-mini:active { transform: scale(0.9); }
.qty-val { font-weight: 800; color: #111; min-width: 20px; text-align: center; font-size: 1.1rem; }
