:root {
    --bg: #fff7eb;
    --primary: #b13a24;
    --primary-dark: #8d2c19;
    --accent: #f4a261;
    --text: #2f241d;
    --muted: #6f5b4c;
    --card: #ffffff;
}

/* Utility hidden class used by JS to toggle sections */
.hidden { display: none !important; }

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: var(--text);
    background: linear-gradient(rgba(255, 247, 235, 0.9), rgba(255, 247, 235, 0.95)), url('images/header_pizza.jpg') center/cover fixed;
    zoom: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    min-height: 100vh;

}

.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #d95b2b 100%);
    color: white;
    padding: 3rem 1.5rem 4rem;
    text-align: center;
}

.hero-content {
    max-width: 760px;
    margin: 0 auto;
}

.eyebrow {
    letter-spacing: 0.25rem;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

.hero h1 {
    font-size: 2.8rem;
    margin: 0.2rem 0 0.5rem;
}

.hero-text {
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0;
}

.page {
    max-width: 1240px;
    margin: -2rem auto 3rem;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 1.5rem;
    align-items: start;
}

main.page {
    flex: 1 0 auto;
}

.menu-section,
.order-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(47, 36, 29, 0.12);
}

.menu-section {
    padding: 2rem;
}

.section-heading {
    margin-bottom: 1.5rem;
}

.section-heading h2,
.order-panel h2 {
    margin: 0 0 0.3rem;
    color: var(--primary-dark);
}

.section-heading p,
.empty-note {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.menu-card {
    border: 1px solid #f0e1d1;
    border-radius: 16px;
    overflow: hidden;
    background: var(--card);
}

.food-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    background: #f5e2be;
}

.card-body {
    padding: 1rem;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.card-top h3 {
    margin: 0;
}

.price {
    color: var(--primary);
    font-weight: 700;
}

.card-body p {
    color: var(--muted);
    line-height: 1.5;
    margin-top: 0;
}

.card-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 0.8rem 0;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

input, select, textarea {
    width: 100%;
    margin-top: 0.3rem;
    padding: 0.7rem;
    border: 1px solid #e0d0bc;
    border-radius: 8px;
    font-size: 1rem;
}

textarea {
    min-height: 80px;
}

.add-btn,
.submit-btn {
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.add-btn {
    background: var(--accent);
    color: #fff;
}

.add-btn:hover,
.submit-btn:hover {
    transform: translateY(-1px);
}

.order-panel {
    padding: 1.25rem;
    position: sticky;
    top: 1rem;
    align-self: start;
}

.order-panel-inner {
    position: relative;
}

.summary-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0e1d1;
}

.summary-item p {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    font-size: 1.05rem;
    border-top: 2px solid #f0e1d1;
    margin-top: 0.4rem;
}

.order-form {
    margin-top: 1rem;
}

.order-form label {
    margin-top: 0.8rem;
}

.submit-btn {
    margin-top: 1rem;
    background: var(--primary);
    color: white;
}

.confirmation-box {
    background: white;
    padding: 1rem 1.2rem;
    border-radius: 16px;
    margin-top: 1rem;
}

.confirmation-box ul {
    padding-left: 1rem;
}

.confirmation-box .total {
    font-size: 1.05rem;
    font-weight: 700;
}

.customer-order-status {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    border: 1px solid #e0d0bc;
    background: #fffaf2;
}

.customer-order-status .status-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.customer-order-status p {
    margin: 0.45rem 0 0;
    color: var(--muted);
    line-height: 1.4;
}

.customer-order-status small {
    display: block;
    margin-top: 0.4rem;
    color: var(--muted);
}

.customer-order-status.status-ready {
    border-color: #6ca66a;
    background: #f2fbf0;
}

.customer-order-status.status-ready strong {
    color: #2f7d32;
}

.customer-order-status.status-pending strong {
    color: var(--primary-dark);
}

.customer-order-status.status-delivered {
    border-color: #6ca66a;
    background: #f6fcf4;
}

.customer-order-status.status-delivered strong {
    color: #2f7d32;
}

@media (max-width: 900px) {
    .page {
        grid-template-columns: 1fr;
    }

    .order-panel-inner {
        position: static;
    }
}

@media (max-width: 640px) {
    .menu-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 2.2rem 1rem 3rem;
    }

    .hero h1 {
        font-size: 2.2rem;
    }
}

footer {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
}

/* Admin toggle and modal */
.admin-toggle {
    position: fixed;
    right: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--primary-dark);
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    z-index: 1200;
    line-height: 1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.admin-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: calc(18px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1100;
}

.admin-modal-content {
    width: 920px;
    max-width: 100%;
    background: white;
    padding: 20px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-height: calc(100vh - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow: auto;
    margin: auto 0;
}

.admin-modal-content.admin-login-only {
    width: 380px;
}

.admin-close {
    position: absolute;
    right: 12px;
    top: 12px;
    border: none;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
}

.admin-section h2 { margin-top: 0; }
.admin-block { margin-top: 12px; }
.admin-section input { margin-bottom: 8px; }
.admin-hint {
    color: #6f5b4c;
    font-size: 0.9rem;
    margin-top: 0.4rem;
}

.admin-pizza-item {
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.delete-pizza-btn {
    border: none;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    background: #8d2c19;
    color: white;
    cursor: pointer;
    font-weight: 700;
}

.order-item-admin { border-bottom: 1px solid #eee; padding: 10px 0; display:flex; justify-content:space-between; align-items:flex-start; }
.order-item-admin button { margin-left: 8px; margin-top: 6px; }
.order-item-admin .mark-status { padding: 0.55rem 0.75rem; font-size: 0.9rem; margin-left: 0; margin-top: 6px; }

/* prevent background scroll when modal open */
.modal-open { overflow: hidden; }

@media (max-width: 640px) {
    .admin-modal {
        padding: calc(12px + env(safe-area-inset-top)) 10px calc(12px + env(safe-area-inset-bottom));
    }

    .admin-modal-content,
    .admin-modal-content.admin-login-only {
        width: 100%;
        max-height: calc(100vh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        padding: 18px;
        margin: 0;
    }

    .order-item-admin {
        display: block;
    }

    .order-item-admin > div:last-child {
        margin-top: 8px;
        text-align: left !important;
    }

    .order-item-admin button {
        margin-left: 0;
    }
}
