/* ============================================================
   FESTA FÁCIL — Estilos Globais (Área Pública)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary:       #F97316;
    --primary-dark:  #EA580C;
    --secondary:     #FBBF24;
    --accent:        #38BDF8;
    --success:       #22C55E;
    --danger:        #EF4444;
    --white:         #FFFFFF;
    --gray-50:       #F9FAFB;
    --gray-100:      #F3F4F6;
    --gray-200:      #E5E7EB;
    --gray-300:      #D1D5DB;
    --gray-400:      #9CA3AF;
    --gray-500:      #6B7280;
    --gray-600:      #4B5563;
    --gray-700:      #374151;
    --gray-800:      #1F2937;
    --gray-900:      #111827;
    --font:          'Poppins', sans-serif;
    --radius:        12px;
    --radius-sm:     8px;
    --shadow:        0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg:     0 8px 30px rgba(0,0,0,0.15);
    --transition:    all 0.2s ease;
}

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

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

body {
    font-family: var(--font);
    background: var(--gray-50);
    color: var(--gray-800);
    font-size: 14px;
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

img { max-width: 100%; height: auto; }

/* ——— Buttons ——— */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary {
    background: var(--success);
    color: var(--white);
}
.btn-primary:hover { background: #16A34A; transform: translateY(-1px); }
.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 1.5px solid var(--gray-300);
}
.btn-secondary:hover { background: var(--gray-100); }
.btn-orange {
    background: var(--primary);
    color: var(--white);
}
.btn-orange:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ——— Header do Cardápio ——— */
/* Banner recolhível ao rolar */
.establishment-banner,
.establishment-banner-placeholder {
    transition: max-height 0.35s ease, opacity 0.35s ease;
    overflow: hidden;
    max-height: 400px; /* valor inicial — banner visível */
    opacity: 1;
}

.menu-header.scrolled .establishment-banner,
.menu-header.scrolled .establishment-banner-placeholder {
    max-height: 0;
    opacity: 0;
}
.menu-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}
.establishment-banner {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    display: block;
    background: var(--gray-100);
}
.establishment-banner-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.establishment-info {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.establishment-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--white);
    box-shadow: var(--shadow);
    flex-shrink: 0;
}
.establishment-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}
.establishment-meta {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* ——— Categorias (scroll horizontal) ——— */
.categories-nav {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0 20px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.categories-nav::-webkit-scrollbar { display: none; }
.category-pill {
    display: inline-block;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}
.category-pill:hover,
.category-pill.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ——— Conteúdo principal ——— */
.main-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px 16px 100px;
}

/* ——— Section title ——— */
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 24px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

/* ——— Grid de produtos ——— */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* ——— Card de produto ——— */
.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.product-card-img {
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
    background: var(--gray-100);
}
.product-card-img-placeholder {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
}
.product-card-body {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-card-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--gray-900);
    margin-bottom: 4px;
}
.product-card-desc {
    font-size: 12px;
    color: var(--gray-500);
    flex: 1;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}
.product-unit {
    font-size: 11px;
    color: var(--gray-400);
}
.featured-badge {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ——— Modal de produto ——— */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: flex-end;
    justify-content: center;
}
.modal-overlay.active { display: flex; }

@media (min-width: 600px) {
    .modal-overlay { align-items: center; }
}

.modal-box {
    background: var(--white);
    width: 100%;
    max-width: 520px;
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}
@media (min-width: 600px) {
    .modal-box { border-radius: var(--radius); }
}
@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.modal-img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    background: var(--gray-100);
}
.modal-body { padding: 20px; }
.modal-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}
.modal-desc {
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.7;
}
.modal-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.modal-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}
.qty-control {
    display: flex;
    align-items: center;
    gap: 12px;
}
.qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--gray-300);
    background: var(--white);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.qty-btn:hover { border-color: var(--primary); color: var(--primary); }
.qty-value {
    font-size: 18px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.4);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* ——— Floating Cart Button ——— */
.cart-fab {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: var(--white);
    padding: 14px 28px;
    border-radius: 50px;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 6px 24px rgba(249,115,22,0.5);
    cursor: pointer;
    border: none;
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 200;
    transition: var(--transition);
    white-space: nowrap;
}
.cart-fab:hover { background: var(--primary-dark); transform: translateX(-50%) translateY(-2px); }
.cart-fab.visible { display: flex; }
.cart-fab-badge {
    background: var(--white);
    color: var(--primary);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ——— Checkout Steps ——— */
.steps-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: var(--white);
    box-shadow: var(--shadow);
    gap: 4px;
    overflow-x: auto;
}
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}
.step.active .step-circle {
    background: var(--primary);
    color: var(--white);
}
.step.done .step-circle {
    background: var(--success);
    color: var(--white);
}
.step-label {
    font-size: 10px;
    color: var(--gray-500);
    font-weight: 500;
}
.step.active .step-label { color: var(--primary); }
.step-line {
    flex: 1;
    height: 2px;
    background: var(--gray-200);
    max-width: 40px;
    margin-bottom: 18px;
    flex-shrink: 0;
}

/* ——— Checkout Card ——— */
.checkout-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.checkout-card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

/* ——— Form ——— */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.form-label.required::after {
    content: ' *';
    color: var(--danger);
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    color: var(--gray-800);
    background: var(--white);
    transition: var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56,189,248,0.15);
}
.form-control.is-invalid { border-color: var(--danger); }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 480px) {
    .form-row { grid-template-columns: 1fr; }
}
.form-hint {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 4px;
}
.invalid-feedback {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
}

/* ——— Cart Items ——— */
.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--gray-100);
}
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 14px; color: var(--gray-900); }
.cart-item-unit { font-size: 12px; color: var(--gray-400); }
.cart-item-price { font-weight: 700; color: var(--primary); font-size: 15px; }
.cart-item-controls { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.cart-remove { color: var(--danger); cursor: pointer; font-size: 13px; background: none; border: none; font-family: var(--font); }

/* ——— Totals ——— */
.totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: var(--gray-700);
}
.totals-row.total {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    border-top: 2px solid var(--gray-200);
    margin-top: 8px;
    padding-top: 12px;
}

/* ——— Payment Options ——— */
.payment-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-bottom: 10px;
    transition: var(--transition);
}
.payment-option:hover { border-color: var(--primary); }
.payment-option.selected {
    border-color: var(--primary);
    background: rgba(249,115,22,0.04);
}
.payment-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.payment-option.selected .payment-radio {
    border-color: var(--primary);
    background: var(--primary);
}
.payment-option.selected .payment-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--white);
}
.payment-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.payment-name { font-weight: 600; color: var(--gray-800); font-size: 14px; }
.payment-desc { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.pix-key-box {
    background: var(--gray-50);
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-top: 8px;
    display: none;
}
.pix-key-box.visible { display: block; }
.pix-key-label { font-size: 12px; color: var(--gray-500); }
.pix-key-value { font-size: 15px; font-weight: 600; color: var(--gray-800); margin-top: 2px; }

/* ——— Success ——— */
.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success), #16A34A);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
    color: var(--white);
}
.order-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--gray-100);
}
.order-detail-row:last-child { border-bottom: none; }
.order-detail-label { color: var(--gray-500); }
.order-detail-value { font-weight: 500; color: var(--gray-800); text-align: right; }

/* ——— Empty state ——— */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-text { font-size: 16px; font-weight: 500; }
.empty-state-hint { font-size: 13px; margin-top: 6px; }

/* ——— Toast ——— */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--gray-900);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
    white-space: nowrap;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ——— Responsive ——— */
@media (max-width: 600px) {
    .main-content { padding: 16px 12px 100px; }
    .products-grid { grid-template-columns: 1fr; }
    .establishment-banner-placeholder { height: 150px; }
}