:root {
    --bg: #f7f7f7;
    --primary: #ea1d2c; 
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    padding-bottom: 0;
    -webkit-tap-highlight-color: transparent;
}

/* CONTAINER PADRÃO */
.container-1024 {
    max-width: 1024px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
}

.cover-area {
    height: 160px;
    background-color: #333;
    background-size: cover;
    background-position: center;
    position: relative;
    transition: height 0.3s ease;
}

@media (min-width: 768px) {
    .cover-area { height: 500px; }
}

.back-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    z-index: 10;
    font-size: 18px;
    transition: transform 0.2s;
}

.back-btn:hover { transform: scale(1.1); }

.my-orders-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: white;
    padding: 8px 14px;
    border-radius: 20px;
    text-decoration: none;
    color: var(--primary);
    font-weight: bold;
    font-size: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* NOVO CABEÇALHO PREMIUM */
.rest-header-container {
    max-width: 1024px;
    margin: -100px auto 0 auto;
    padding: 0 15px;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    z-index: 20;
}

.rest-logo-wrapper {
    width: 110px;
    height: 110px;
    background: white;
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    flex-shrink: 0;
    margin-bottom: 20px;
}

.rest-logo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.rest-card-info {
    flex: 1;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    padding: 30px;
    margin-bottom: 20px;
}

.rest-main-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
}

.rest-text-details {
    flex: 1;
}

.rest-title-name {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.5px;
}

.rest-meta-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.meta-item {
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rest-description-text {
    margin: 5px 0;
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
}

.rest-status-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.status-text-open { color: #10b981; }
.status-text-closed { color: #ef4444; }
.status-divider { color: #cbd5e1; }
.status-time { color: #94a3b8; }

.rest-badges-side {
    display: flex;
    gap: 15px;
    flex-shrink: 0;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.badge-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
}

.badge-pill {
    background: white;
    border: 1px solid #f1f5f9;
    padding: 8px 15px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.badge-pill i { color: #64748b; }

@media (max-width: 768px) {
    .rest-header-container { flex-direction: column; align-items: center; text-align: center; margin-top: -60px; }
    .rest-logo-wrapper { margin-bottom: -40px; z-index: 25; width: 90px; height: 90px; }
    .rest-card-info { padding: 50px 20px 25px 20px; width: 100%; box-sizing: border-box; }
    .rest-main-content { flex-direction: column; align-items: center; gap: 20px; }
    .rest-meta-info { align-items: center; }
    .rest-status-footer { justify-content: center; }
    .rest-badges-side { width: 100%; justify-content: center; border-top: 1px solid #f8fafc; padding-top: 15px; margin-top: 10px; }
}

/* BUSCA E NAVEGAÇÃO */
.search-container {
    background: white;
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 15px;
    margin: 10px auto 0 auto;
    max-width: 1024px;
    width: 100%;
    box-sizing: border-box;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.search-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 15px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-box input {
    background: transparent;
    border: none;
    width: 100%;
    outline: none;
    font-size: 14px;
    color: #1e293b;
}

.cat-nav {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 15px;
    background: #f7f7f7;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    max-width: 1024px;
    margin: 0 auto;
    position: sticky;
    top: 68px; /* Altura aproximada do search-container */
    z-index: 45;
}

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

.cat-btn {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 10px 20px;
    border-radius: 12px;
    text-decoration: none;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    transition: 0.3s;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
}

.cat-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* LISTAGEM */
.menu-list {
    padding: 20px 15px;
    max-width: 1024px;
    margin: 0 auto;
}

.cat-section { margin-bottom: 40px; }
.cat-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 15px;
    color: #1e293b;
    padding-left: 5px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.prod-card {
    background: white;
    border-radius: 12px;
    margin-bottom: 5px;
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.prod-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.08);
    border-color: #e2e8f0;
}

.prod-info {
    padding: 12px 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.prod-name {
    font-weight: 700;
    font-size: 17px;
    margin-bottom: 6px;
    color: #0f172a;
}

.prod-desc {
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.prod-price {
    color: var(--primary);
    font-weight: 800;
    font-size: 18px;
    margin-top: auto;
}

.prod-img {
    width: calc(100% - 16px);
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: white;
    border-radius: 10px;
    margin: 8px 8px 0 8px;
    display: block;
}

.prod-img-placeholder {
    width: calc(100% - 16px);
    aspect-ratio: 4 / 3;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 32px;
    border-radius: 10px;
    margin: 8px 8px 0 8px;
}

.btn-add-card {
    background: var(--primary);
    color: white;
    padding: 12px;
    margin: 0 15px 15px 15px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
}

.prod-card:hover .btn-add-card {
    filter: brightness(1.1);
}


.closed-store .prod-card { opacity: 0.6; filter: grayscale(0.5); }
.closed-store .btn-add-card { display: none; }

/* MODAIS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-content {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 100%);
    width: 100%;
    max-width: 600px;
    background: white;
    border-radius: 24px 24px 0 0;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1001;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
    visibility: hidden;
}

.modal-open .modal-overlay { display: block; opacity: 1; }
.modal-open .modal-content { transform: translate(-50%, 0); visibility: visible; }

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 10;
    color: #1e293b;
    cursor: pointer;
}

.modal-header-img { 
    width: 100%; 
    height: 280px; 
    object-fit: cover; 
    display: block;
    border-radius: 24px 24px 0 0;
}
.modal-body { padding: 25px; padding-bottom: 120px; }
.modal-title { font-size: 22px; font-weight: 800; color: #0f172a; margin-bottom: 8px; }
.modal-price { font-size: 20px; font-weight: 800; color: #15803d; margin-bottom: 25px; }

.extra-group-title {
    background: #f8fafc;
    padding: 10px 15px;
    font-size: 12px;
    font-weight: 900;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 25px 0 10px 0;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.extra-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f8fafc;
    transition: background 0.2s;
    border-radius: 12px;
    margin-bottom: 2px;
}

.extra-row:hover { background: #fdf2f3; }

.extra-info { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.extra-name { font-size: 14px; font-weight: 600; color: #334155; }
.extra-price { font-size: 13px; color: #15803d; font-weight: 700; }

.extra-qty-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    padding: 6px 12px;
}

.extra-btn { color: var(--primary); font-size: 18px; cursor: pointer; user-select: none; }
.extra-qty { font-weight: 700; font-size: 14px; min-width: 15px; text-align: center; }

.obs-box {
    width: 100%;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-top: 15px;
    resize: none;
    font-size: 14px;
    background: #f8fafc;
    box-sizing: border-box;
}

.modal-footer {
    position: sticky;
    bottom: 0;
    width: 100%;
    background: white;
    padding: 20px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 15px;
    align-items: center;
    box-sizing: border-box;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 18px;
    background: #f1f5f9;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 800;
}

.qty-btn { font-size: 24px; color: var(--primary); cursor: pointer; }

.btn-add-modal {
    flex: 1;
    background: var(--primary);
    color: white;
    padding: 14px 20px;
    border-radius: 14px;
    font-weight: 800;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border: none;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* BARRA DE CARRINHO */
.cart-bar {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    background: var(--primary);
    color: white;
    padding: 14px 25px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 900;
    box-sizing: border-box;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { transform: translate(-50%, 100px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

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

.cart-left { display: flex; align-items: center; gap: 15px; }
.cart-icon-bg {
    background: rgba(255,255,255,0.2);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 18px;
}

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

.store-footer {
    text-align: center;
    padding: 40px 15px;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    border-top: 1px solid #ddd;
    margin-top: 40px;
}
