/* =======================================
   GLOBAL RESET & BASE
   ======================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    background:
        radial-gradient(circle at top left, #1d2436 0, #020617 40%, #000000 80%);
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
}

/* Links */
a {
    color: #111827;
    text-decoration: none;
    transition: color 0.15s ease, opacity 0.15s ease;
}

a:hover {
    text-decoration: underline;
    opacity: 0.85;
}

/* =======================================
   LAYOUT WRAPPER
   ======================================= */

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 20px 14px;
}

.page {
    position: relative;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 22px;
    padding: 22px 22px 26px;
    min-height: calc(100vh - 40px);
    box-shadow:
        0 22px 50px rgba(15, 23, 42, 0.40),
        0 0 0 1px rgba(148, 163, 184, 0.15);
    backdrop-filter: blur(24px);
}

/* Decorative glow */
.page::before {
    content: "";
    position: absolute;
    inset: -40px -40px auto auto;
    background: radial-gradient(circle at top, rgba(59, 130, 246, 0.18), transparent 60%);
    opacity: 0.8;
    pointer-events: none;
}

/* =======================================
   HEADER / HERO
   ======================================= */

header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.header-left h1 {
    font-size: 1.7rem;
    margin: 6px 0 4px;
    letter-spacing: -0.03em;
    color: #020617;
}

.header-left p {
    margin: 2px 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    background: linear-gradient(135deg, #eef2ff, #e0f2fe);
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 600;
    box-shadow:
        0 2px 4px rgba(148, 163, 184, 0.4),
        0 0 0 1px rgba(191, 219, 254, 0.8);
}

.header-right {
    text-align: right;
    font-size: 0.84rem;
    color: #6b7280;
}

.header-right strong {
    color: #111827;
}

/* tiny status dot */
.header-right::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #22c55e;
    margin-right: 6px;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.22);
    vertical-align: middle;
}

/* =======================================
   CATEGORY NAVIGATION
   ======================================= */

.category-nav {
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(255, 255, 255, 0.98);
    padding: 10px 0 8px;
    margin-top: 10px;
    border-bottom: 1px solid #e5e7eb;
    backdrop-filter: blur(12px);
}

.category-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.category-scroll::-webkit-scrollbar {
    height: 6px;
}
.category-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.category-scroll::-webkit-scrollbar-thumb {
    background: #cbd5f5;
    border-radius: 999px;
}

.category-pill {
    border: none;
    padding: 7px 15px;
    border-radius: 999px;
    background: #f3f4f6;
    font-size: 0.86rem;
    cursor: pointer;
    white-space: nowrap;
    color: #374151;
    font-weight: 500;
    transition:
        background 0.12s ease,
        color 0.12s ease,
        transform 0.09s ease,
        box-shadow 0.12s ease;
}

.category-pill:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.16);
}

.category-pill.active {
    background: radial-gradient(circle at top left, #111827, #020617);
    color: #f9fafb;
    transform: translateY(-1px);
    box-shadow:
        0 3px 8px rgba(15, 23, 42, 0.45),
        0 0 0 1px rgba(15, 23, 42, 0.85);
}

/* =======================================
   MENU + FORM LAYOUT
   ======================================= */

.menu-and-form {
    display: grid;
    grid-template-columns: minmax(0, 2fr);
    gap: 26px;
    margin-top: 20px;
}

.menu-section-title {
    font-size: 1.02rem;
    margin: 20px 0 10px;
    letter-spacing: -0.01em;
    color: #111827;
}

/* =======================================
   PRODUCT CARDS
   ======================================= */

.product-card {
    display: grid;
    grid-template-columns: 126px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.product-card:last-child {
    border-bottom: none;
}

.product-card-image {
    width: 126px;
    height: 92px;
    border-radius: 16px;
    background: radial-gradient(circle at top, #f3f4f6, #e5e7eb);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.01);
    transition: transform 0.3s ease, filter 0.3s ease;
}

.product-card:hover .product-card-image img {
    transform: scale(1.04);
    filter: brightness(1.03);
}

.product-card-placeholder {
    font-size: 0.7rem;
    color: #9ca3af;
    text-align: center;
    padding: 6px;
}

/* subtle gradient over image bottom */
.product-card-image::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 32px;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.32), transparent);
    opacity: 0.65;
    pointer-events: none;
}

/* remove overlay if no image */
.product-card-image:has(.product-card-placeholder)::after {
    display: none;
}

.product-card-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.product-name {
    font-weight: 600;
    font-size: 0.98rem;
    color: #0f172a;
}

.product-desc {
    font-size: 0.82rem;
    color: #6b7280;
    margin: 4px 0 6px;
    line-height: 1.45;
}

.product-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.product-price {
    font-weight: 600;
    font-size: 0.93rem;
    color: #111827;
}

/* Offer badge */
.badge-offer {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 0.72rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #fef3c7, #fffbeb);
    color: #92400e;
    white-space: nowrap;
    border: 1px solid #fde68a;
}

/* =======================================
   QUANTITY CONTROLS
   ======================================= */

.qty-controls {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #f3f4f6;
    padding: 3px;
    gap: 4px;
    box-shadow: inset 0 0 0 1px rgba(209, 213, 219, 0.5);
}

.qty-btn {
    border-radius: 999px;
    border: none;
    width: 26px;
    height: 26px;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111827;
    color: #ffffff;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition:
        background 0.12s ease,
        transform 0.08s ease,
        box-shadow 0.12s ease;
}

.qty-btn.minus {
    background: #e5e7eb;
    color: #111827;
}

.qty-btn:hover {
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.35);
    transform: translateY(-1px);
}

.qty-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.qty-input-field {
    width: 44px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 0.9rem;
    outline: none;
}

/* Remove arrows in number inputs */
.qty-input-field::-webkit-outer-spin-button,
.qty-input-field::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* =======================================
   FORM CARD (CUSTOMER DATA)
   ======================================= */

.form-card {
    border-radius: 16px;
    background: linear-gradient(145deg, #f9fafb, #ffffff);
    padding: 14px 14px 18px;
    border: 1px solid #e5e7eb;
    margin-top: 26px;
    box-shadow: 0 10px 30px rgba(148, 163, 184, 0.25);
}

.form-card h3 {
    margin-top: 0;
    font-size: 1.0rem;
    margin-bottom: 6px;
    color: #111827;
}

label {
    display: block;
    margin: 6px 0;
    font-size: 0.85rem;
    color: #374151;
}

input[type="text"],
input[type="tel"],
input[type="password"],
textarea {
    width: 100%;
    padding: 7px 9px;
    margin-top: 2px;
    border-radius: 9px;
    border: 1px solid #d1d5db;
    font-size: 0.88rem;
    font-family: inherit;
    transition:
        border-color 0.12s ease,
        box-shadow 0.12s ease,
        background 0.12s ease,
        transform 0.07s ease;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow:
        0 0 0 1px rgba(79, 70, 229, 0.4),
        0 10px 20px rgba(129, 140, 248, 0.25);
    background: #f9fafb;
    transform: translateY(-0.5px);
}

/* Buttons */
button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border: none;
    background: radial-gradient(circle at top left, #111827, #020617);
    color: #ffffff;
    cursor: pointer;
    border-radius: 999px;
    font-size: 0.9rem;
    text-decoration: none;
    gap: 6px;
    font-weight: 500;
    transition:
        transform 0.08s ease,
        box-shadow 0.14s ease,
        background 0.14s ease,
        opacity 0.12s ease;
}

button:hover,
.btn:hover {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.45);
    transform: translateY(-1px);
}

button:active,
.btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.45);
}

button.secondary {
    background: #f3f4f6;
    color: #111827;
}

button.secondary:hover {
    background: #e5e7eb;
    box-shadow: 0 5px 14px rgba(148, 163, 184, 0.4);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.footer-note {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 8px;
}

/* =======================================
   TABLES (ADMIN & INVOICE)
   ======================================= */

.table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.table th,
.table td {
    padding: 7px 8px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    font-size: 0.86rem;
}

.table th {
    font-weight: 600;
    background: #f9fafb;
    color: #111827;
}

/* Status badges */
.badge-status-new,
.badge-status-preparing,
.badge-status-on_the_way,
.badge-status-completed,
.badge-status-cancelled {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-status-new {
    background: #dbeafe;
    color: #1d4ed8;
}
.badge-status-preparing {
    background: #fef3c7;
    color: #92400e;
}
.badge-status-on_the_way {
    background: #dcfce7;
    color: #166534;
}
.badge-status-completed {
    background: #e5e7eb;
    color: #374151;
}
.badge-status-cancelled {
    background: #fee2e2;
    color: #b91c1c;
}

/* =======================================
   INVOICE BLOCK (order.php)
   ======================================= */

.invoice {
    border: 1px solid #e5e7eb;
    padding: 16px;
    border-radius: 14px;
    margin-top: 18px;
    background: linear-gradient(150deg, #f9fafb, #ffffff);
    box-shadow: 0 12px 24px rgba(148, 163, 184, 0.25);
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
}

.invoice-qr img {
    max-width: 200px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.35);
}

/* =======================================
   NOTICES / ALERTS
   ======================================= */

.notice {
    padding: 10px 12px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 10px;
    margin: 12px 0;
    font-size: 0.85rem;
    color: #92400e;
}

/* =======================================
   ADMIN SPECIFICS
   ======================================= */

select {
    font-family: inherit;
    font-size: 0.85rem;
    padding: 4px 7px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #ffffff;
}

/* =======================================
   RESPONSIVE
   ======================================= */

@media (max-width: 860px) {
    .menu-and-form {
        grid-template-columns: minmax(0, 1fr);
    }
    .header-right {
        text-align: left;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 12px;
    }

    .page {
        padding: 16px 14px 20px;
        border-radius: 16px;
    }

    header {
        flex-direction: column;
    }

    .product-card {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto;
    }

    .product-card-image {
        width: 100%;
        height: 180px;
    }
}
