/* City Pizza — order.html: categories / products / delivery+cart+checkout */

.order-layout { display: flex; gap: 28px; align-items: flex-start; }

/* --- Category nav (left) --- */
.category-nav-wrap { flex: 0 0 210px; }
.category-nav { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 20px; }
.category-item {
    display: flex; align-items: center; gap: 10px;
    text-align: left; padding: 13px 16px; border-radius: 12px;
    border: 1px solid #eee; background: #fff; font-weight: 600; font-size: 14px; color: #0e1318;
    transition: all .2s ease; cursor: pointer;
}
.category-item:hover { border-color: #ff8e28; color: #ff8e28; }
.category-item.active { background: #ff8e28; color: #fff; border-color: #ff8e28; box-shadow: 0 10px 20px rgba(255,142,40,.25); }
.category-item .count {
    margin-left: auto; font-size: 11px; background: rgba(0,0,0,.08); border-radius: 20px; padding: 2px 8px;
}
.category-item.active .count { background: rgba(255,255,255,.25); }

/* Mittagsangebot / promo category — stands out from the regular list and
   gives a small periodic nudge to invite a tap, without shaking constantly. */
@keyframes cp-offer-wiggle {
    0%, 82%, 100% { transform: translateX(0); }
    85% { transform: translateX(-4px); }
    88% { transform: translateX(4px); }
    91% { transform: translateX(-3px); }
    94% { transform: translateX(3px); }
    97% { transform: translateX(0); }
}
.category-item-offer {
    background: linear-gradient(135deg, #ff8e28, #ff5f2e);
    border-color: transparent; color: #fff;
    animation: cp-offer-wiggle 3s ease-in-out infinite;
}
.category-item-offer:hover { color: #fff; border-color: transparent; filter: brightness(1.05); }
.category-item-offer .count { background: rgba(255,255,255,.25); }
.category-item-offer.active {
    background: linear-gradient(135deg, #ff8e28, #ff5f2e);
    box-shadow: 0 10px 24px rgba(255,95,46,.35);
    animation: none;
}
@media (prefers-reduced-motion: reduce) {
    .category-item-offer { animation: none; }
}

/* --- Product grid (center) --- */
.product-grid-wrap { flex: 1 1 auto; min-width: 0; }
.product-grid-heading { font-size: 20px; font-weight: 700; color: #0e1318; margin: 0 0 16px; }
.product-grid-note { display: block; font-size: 12.5px; font-weight: 500; color: #8a8f94; margin-top: 4px; }
.product-grid-offer-notice {
    background: #fdece5; color: #c0392b; border-radius: 10px; padding: 12px 16px;
    font-size: 13px; font-weight: 600; line-height: 1.5; margin-bottom: 16px;
}
.product-grid-offer-notice.shake { animation: cp-shake .4s ease-in-out; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.product-card {
    background: #fff; border-radius: 12px; overflow: hidden;
    box-shadow: 0 6px 18px rgba(14,19,24,.06); display: flex; flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease;
}
.product-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(14,19,24,.1); }
.product-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.product-card-top { display: flex; align-items: center; gap: 7px; }
.product-card h4 { margin: 0; font-size: 14px; font-weight: 700; color: #0e1318; line-height: 1.3; }
.product-card .subtitle { font-size: 11.5px; color: #8a8f94; margin-bottom: 1px; }
.product-allergens { font-size: 10.5px; color: #b0b4b8; margin-bottom: 2px; }
.product-allergens .open-allergen-modal {
    display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px;
    border-radius: 50%; background: #eee; color: #666; font-size: 9px; font-weight: 700; margin-left: 2px; text-decoration: none;
}
.product-card .price { margin-top: auto; font-weight: 700; color: #ff8e28; font-size: 15px; }

.veg-dot { flex: 0 0 auto; width: 11px; height: 11px; border-radius: 3px; border: 2px solid; }
.veg-dot.veg { border-color: #2e8b3d; }
.veg-dot.veg::after { content: ''; display: block; width: 5px; height: 5px; margin: 1px; border-radius: 50%; background: #2e8b3d; }
.veg-dot.nonveg { border-color: #c0392b; }
.veg-dot.nonveg::after { content: ''; display: block; width: 5px; height: 5px; margin: 1px; border-radius: 50%; background: #c0392b; }
.product-add-btn {
    margin-top: 8px; height: 36px; border-radius: 9px; background: #0e1318; color: #fff;
    border: none; font-weight: 700; font-size: 12.5px; display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: background .2s ease;
}
.product-add-btn:hover { background: #ff8e28; }
.product-add-btn .las { font-size: 15px; }

/* --- Right sidebar: delivery card + cart --- */
.order-sidebar { flex: 0 0 320px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 20px; }
.order-sidebar .default-btn { width: 100%; text-align: center; }

.cart-panel { background: #fff; border-radius: 16px; box-shadow: 0 15px 40px rgba(14,19,24,.08); padding: 22px; }
.cart-panel h4 { margin: 0 0 14px; font-size: 16px; font-weight: 700; color: #0e1318; }
.cart-empty { color: #8a8f94; font-size: 13px; text-align: center; padding: 24px 0; }
.cart-empty i { font-size: 26px; color: #d7dadd; display: block; margin-bottom: 8px; }

.cart-item-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.cart-item-row:last-child { border-bottom: none; }
.cart-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cart-item-row .name { font-size: 13.5px; font-weight: 600; color: #0e1318; }
.cart-item-details { font-size: 11px; color: #8a8f94; }
.cart-item-row .qty-controls { display: flex; align-items: center; gap: 6px; }
.cart-item-row .qty-controls button {
    width: 24px; height: 24px; border-radius: 50%; border: 1px solid #eee; background: #f5f6f7;
    font-weight: 700; line-height: 1; color: #0e1318; display: flex; align-items: center; justify-content: center;
}
.cart-item-row .qty-controls .qty-val { min-width: 16px; text-align: center; font-size: 13px; font-weight: 700; }
.cart-item-row .line-price { font-size: 13.5px; font-weight: 700; width: 62px; text-align: right; color: #0e1318; }

.cart-totals { margin-top: 14px; padding-top: 14px; border-top: 1px dashed #e0e0e0; display: flex; flex-direction: column; gap: 6px; }
.cart-totals .row { display: flex; justify-content: space-between; font-size: 13px; color: #666; }
.cart-totals .row.grand { font-size: 16.5px; font-weight: 700; color: #0e1318; margin-top: 6px; padding-top: 10px; border-top: 1px solid #eee; }

.cart-min-order-warning {
    margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #fff3e6; color: #c0392b;
    font-size: 12px; font-weight: 600; line-height: 1.5;
}
@keyframes cp-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}
.cart-min-order-warning.shake { animation: cp-shake .4s ease-in-out; }

.cart-checkout-btn {
    margin-top: 16px; width: 100%; height: 52px; border-radius: 12px; background: #ff8e28; color: #fff;
    font-weight: 700; font-size: 14.5px; border: none; transition: background .2s ease;
}
.cart-checkout-btn:hover { background: #e87c15; }

/* Stays fully clickable — this is a hint, not a disabled state (tapping it
   shows a red message and jumps to what's missing instead of doing nothing). */
.cart-checkout-btn.not-ready,
#mobileCartCheckoutBtn.not-ready {
    background: #fff; color: #ff8e28; border: 2px solid #ff8e28;
}

/* --- Mobile sticky cart bar --- */
.mobile-cart-bar {
    display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 999;
    background: #0e1318; color: #fff; padding: 14px 18px; align-items: center; justify-content: space-between;
    box-shadow: 0 -10px 30px rgba(0,0,0,.25);
}
.mobile-cart-bar .info { font-size: 13.5px; }
.mobile-cart-bar .info strong { display: block; font-size: 15px; }
.mobile-cart-bar button {
    background: #ff8e28; color: #fff; border: none; border-radius: 10px; padding: 12px 20px; font-weight: 700; font-size: 13.5px;
}

/* --- Product configurator modal (extends .order-modal-overlay/.order-modal-box) --- */
.configurator-modal-box { max-width: 480px; max-height: 88vh; overflow-y: auto; text-align: left; }
.configurator-header { display: flex; gap: 14px; margin-bottom: 18px; }
.configurator-header img { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; background: #f5f6f7; }
.configurator-header-info { min-width: 0; }
.configurator-header-info h3 { margin: 2px 0 4px; font-size: 17px; font-weight: 700; color: #0e1318; padding-right: 0; }
.configurator-veg-badge { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 2px solid; }
.configurator-veg-badge.veg { border-color: #2e8b3d; }
.configurator-veg-badge.veg::after { content: ''; display: block; width: 5px; height: 5px; margin: 1px; border-radius: 50%; background: #2e8b3d; }
.configurator-veg-badge.nonveg { border-color: #c0392b; }
.configurator-veg-badge.nonveg::after { content: ''; display: block; width: 5px; height: 5px; margin: 1px; border-radius: 50%; background: #c0392b; }
.configurator-description { font-size: 12.5px; color: #666; margin: 4px 0 0; line-height: 1.5; }
.configurator-allergens { font-size: 11px; color: #b0b4b8; margin: 4px 0 0; }
.configurator-allergens a { color: #ff8e28; text-decoration: none; }

.configurator-section { margin-bottom: 18px; }
.configurator-section-label { display: block; font-size: 11.5px; font-weight: 700; color: #8a8f94; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 8px; }

.configurator-size-options { display: flex; flex-direction: column; gap: 8px; }
.configurator-size-pill {
    display: flex; justify-content: space-between; align-items: center; width: 100%;
    border: 1px solid #eee; border-radius: 10px; padding: 12px 14px; background: #fff;
    font-size: 13.5px; font-weight: 600; color: #0e1318; transition: all .2s ease;
}
.configurator-size-pill .price { color: #ff8e28; font-weight: 700; }
.configurator-size-pill.active { border-color: #ff8e28; background: #fff3e6; }

.configurator-extras-options { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; }
.configurator-extra-row {
    display: flex; align-items: center; gap: 10px; padding: 8px 4px; font-size: 13px; color: #333; cursor: pointer;
    border-bottom: 1px solid #f5f6f7;
}
.configurator-extra-row:last-child { border-bottom: none; }
.configurator-extra-row input { flex: 0 0 auto; width: 16px; height: 16px; accent-color: #ff8e28; }
.configurator-extra-row .name { flex: 1; }
.configurator-extra-row .price { color: #8a8f94; font-weight: 600; }

.configurator-footer { display: flex; align-items: center; gap: 14px; padding-top: 14px; border-top: 1px dashed #e0e0e0; }
.configurator-qty { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.configurator-qty button {
    width: 32px; height: 32px; border-radius: 50%; border: 1px solid #eee; background: #f5f6f7;
    font-weight: 700; font-size: 16px; line-height: 1; color: #0e1318; display: flex; align-items: center; justify-content: center;
}
.configurator-qty span { min-width: 18px; text-align: center; font-weight: 700; font-size: 14px; }
.configurator-add-btn {
    flex: 1; height: 50px; border-radius: 12px; background: #ff8e28; color: #fff; border: none;
    font-weight: 700; font-size: 14px; transition: background .2s ease;
}
.configurator-add-btn:hover { background: #e87c15; }

/* --- Checkout modal (extends .order-modal-overlay/.order-modal-box) --- */
.checkout-modal-box { max-width: 560px; max-height: 88vh; overflow-y: auto; text-align: left; }
.checkout-mode-pill {
    display: inline-block; background: #fff3e6; color: #ff8e28; font-weight: 700; font-size: 12px;
    padding: 4px 12px; border-radius: 20px; margin-bottom: 14px;
}
.checkout-summary { background: #f5f6f7; border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; }
.checkout-summary-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; color: #333; }
.checkout-summary-totals { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #d7dadd; }
.checkout-summary-totals .row { display: flex; justify-content: space-between; font-size: 12.5px; color: #666; padding: 2px 0; }
.checkout-summary-totals .row.grand { font-size: 15px; font-weight: 700; color: #0e1318; margin-top: 4px; }

.checkout-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.checkout-form-grid .full-width { grid-column: 1 / -1; }
.checkout-input {
    height: 48px; border-radius: 10px; border: 1px solid #eee; background: #f5f6f7;
    padding: 0 14px; font-size: 13.5px; width: 100%; color: #0e1318;
}
.checkout-input::placeholder { color: #8a8f94; }
textarea.checkout-input { height: 80px; padding: 12px 14px; resize: vertical; }
.checkout-field-label { font-size: 11.5px; font-weight: 700; color: #8a8f94; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; display: block; }

.order-time-box {
    background: #fff; border-radius: 16px; box-shadow: 0 15px 40px rgba(14,19,24,.08);
    padding: 18px 22px; margin: 14px 0;
}
.order-time-status {
    font-size: 12.5px; font-weight: 600; line-height: 1.5; color: #c0392b;
    background: #fdf1ef; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px;
}
.order-time-choice { display: flex; gap: 10px; margin-top: 6px; }
.order-time-btn {
    flex: 1; border: 1px solid #eee; border-radius: 12px; padding: 10px 8px; text-align: center;
    cursor: pointer; font-weight: 700; font-size: 12.5px; color: #0e1318; background: #fff; transition: all .2s ease;
}
.order-time-btn.active { border-color: #ff8e28; background: #fff3e6; color: #ff8e28; }
.order-time-btn:disabled { color: #c2c6ca; cursor: not-allowed; background: #f7f7f8; }
.order-time-picker { margin-top: 14px; }
.order-time-picker-fields { display: flex; gap: 10px; }
.order-time-picker-fields .checkout-input { flex: 1; }

.payment-options { display: flex; gap: 10px; margin-bottom: 16px; }
.payment-option {
    flex: 1; border: 1px solid #eee; border-radius: 12px; padding: 14px 10px; text-align: center;
    cursor: pointer; font-weight: 700; font-size: 13.5px; color: #0e1318; transition: all .2s ease;
}
.payment-option i { display: block; font-size: 20px; margin-bottom: 6px; color: #8a8f94; }
.payment-option.active { border-color: #ff8e28; background: #fff3e6; color: #ff8e28; }
.payment-option.active i { color: #ff8e28; }

.checkout-privacy { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: #666; margin-bottom: 18px; line-height: 1.5; }
.checkout-privacy input { margin-top: 3px; flex: 0 0 auto; }

.checkout-submit-btn {
    width: 100%; height: 52px; border-radius: 12px; background: #ff8e28; color: #fff;
    font-weight: 700; font-size: 14.5px; border: none; transition: background .2s ease;
}
.checkout-submit-btn:hover:not(:disabled) { background: #e87c15; }
.checkout-submit-btn:disabled { background: #f0d8bb; cursor: not-allowed; }

.checkout-success-state { display: none; text-align: center; padding: 20px 10px 4px; }
.checkout-success-state.active { display: block; }
.checkout-success-icon {
    width: 60px; height: 60px; border-radius: 50%; background: #eafaf0; color: #1fa855;
    font-size: 24px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.checkout-success-state h3 { margin-bottom: 10px; }
.checkout-success-state p { color: #666; font-size: 13.5px; margin-bottom: 4px; }
#checkoutSuccessOrderId { font-weight: 700; color: #0e1318; }
.checkout-success-state .checkout-submit-btn { margin-top: 18px; }

/* --- Responsive --- */
@media (max-width: 991px) {
    .order-layout { flex-direction: column; }
    .category-nav-wrap { flex: none; width: 100%; }
    .category-nav {
        flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 10px;
        position: static; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
    }
    .category-nav::-webkit-scrollbar { height: 5px; }
    .category-nav::-webkit-scrollbar-thumb { background: #d7dadd; border-radius: 10px; }
    .category-nav::-webkit-scrollbar-track { background: transparent; }
    .category-item { flex: 0 0 auto; white-space: nowrap; }
    .order-sidebar { flex: none; width: 100%; position: static; padding-bottom: 90px; }
    .mobile-cart-bar.active { display: flex; }
}

@media (max-width: 767px) {
    .order-layout { gap: 20px; }
    .checkout-form-grid { grid-template-columns: 1fr; }
    .checkout-modal-box { max-height: 100vh; height: 100%; border-radius: 0; width: 100%; max-width: 100%; }
    .configurator-modal-box { max-height: 100vh; height: 100%; border-radius: 0; width: 100%; max-width: 100%; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
}
