/* WhatsApp ordering storefront - visual design ported from the 2ndwife
   WhatsApp-order reference project (same layout, spacing, colors, card and
   cart treatment), adapted to dilcosystem's own menu_items/menu_categories
   data (no per-item photos/descriptions, variations instead of extras). */

:root {
    --wa-primary: #D62828;
    --wa-primary-dark: #B71F1F;
    --wa-dark: #212529;
    --wa-light: #FFFFFF;
    --wa-border: #ECECEC;
    --wa-success: #28A745;
    --wa-muted: #6C757D;
    --wa-bg-subtle: #FAFAFA;
    --wa-radius: 10px;
    --wa-radius-sm: 6px;
    --wa-shadow-sm: 0 1px 3px rgba(33, 37, 41, .06);
    --wa-shadow-md: 0 6px 20px rgba(33, 37, 41, .08);
    --wa-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.wa-page { font-family: var(--wa-font); color: var(--wa-dark); background: var(--wa-light); padding-bottom: 40px; }
.wa-page a { text-decoration: none; color: inherit; }
.wa-container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header */
.wa-header {
    position: sticky; top: 0; z-index: 1040;
    background: var(--wa-light);
    border-bottom: 1px solid var(--wa-border);
    transition: box-shadow .2s ease;
}
.wa-header.is-scrolled { box-shadow: var(--wa-shadow-sm); }
.wa-header .header-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; }

.wa-brand-logo { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 1px solid var(--wa-border); flex-shrink: 0; }
.wa-brand-meta { min-width: 0; }
.wa-brand-name { font-weight: 700; font-size: 17px; line-height: 1.2; }
.wa-brand-sub { font-size: 12.5px; color: var(--wa-muted); }

.wa-header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.wa-search-box { position: relative; width: 220px; }
.wa-search-box input {
    border-radius: var(--wa-radius); border: 1px solid var(--wa-border);
    padding: 8px 14px 8px 36px; font-size: 14px; width: 100%;
}
.wa-search-box input:focus { outline: none; border-color: var(--wa-primary); box-shadow: 0 0 0 3px rgba(214,40,40,.08); }
.wa-search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--wa-muted); }

.wa-cart-trigger {
    position: relative; background: var(--wa-primary); color: #fff; border: none;
    border-radius: var(--wa-radius); padding: 9px 16px; font-weight: 600; font-size: 14px;
    display: inline-flex; align-items: center; gap: 8px;
}
.wa-cart-trigger:hover { background: var(--wa-primary-dark); color: #fff; }
.wa-cart-count {
    background: #fff; color: var(--wa-primary); border-radius: 50%; font-size: 11px; font-weight: 700;
    min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* Cover / hero */
.wa-cover { position: relative; }
.wa-cover-image { width: 100%; height: 220px; object-fit: cover; display: block; }
.wa-cover-plain { height: 160px; background: linear-gradient(135deg, var(--wa-primary), var(--wa-primary-dark)); }
.wa-cover-overlay { background: rgba(33, 37, 41, .5); position: absolute; inset: 0; display: flex; align-items: flex-end; }
.wa-cover-plain .wa-cover-overlay { background: transparent; position: static; display: flex; align-items: center; height: 100%; }
.wa-cover-content { color: #fff; padding: 24px; width: 100%; }
.wa-cover-content h2 { font-weight: 700; font-size: 24px; margin-bottom: 4px; }
.wa-cover-content p { font-size: 14px; opacity: .92; max-width: 640px; margin-bottom: 0; }

/* Category nav */
.wa-category-nav-wrap { position: sticky; top: 73px; z-index: 1030; background: var(--wa-light); border-bottom: 1px solid var(--wa-border); }
.wa-category-nav { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; scrollbar-width: none; }
.wa-category-nav::-webkit-scrollbar { display: none; }
.wa-category-pill {
    flex-shrink: 0; padding: 8px 16px; border-radius: 20px; border: 1px solid var(--wa-border);
    font-size: 13.5px; font-weight: 600; color: var(--wa-dark); white-space: nowrap;
    display: inline-flex; align-items: center; gap: 6px; background: #fff;
}
.wa-category-pill:hover { border-color: var(--wa-primary); color: var(--wa-primary); }
.wa-category-pill.active { background: var(--wa-primary); border-color: var(--wa-primary); color: #fff; }

/* Sections */
.wa-section { padding: 28px 0; }
.wa-section-heading { font-size: 20px; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.wa-section-heading-sub { font-size: 13.5px; color: var(--wa-muted); margin-bottom: 18px; }

/* Popular row */
.wa-popular-scroll { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 6px; }
.wa-popular-scroll .wa-food-card { flex: 0 0 220px; }

/* Food cards */
.wa-food-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.wa-food-card {
    border: 1px solid var(--wa-border); border-radius: var(--wa-radius); overflow: hidden;
    background: var(--wa-light); transition: box-shadow .2s ease, transform .2s ease;
    cursor: pointer; display: flex; flex-direction: column;
}
.wa-food-card:hover { box-shadow: var(--wa-shadow-md); transform: translateY(-2px); }

.wa-food-card-thumb { position: relative; height: 150px; background: #FCE9E9; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.wa-food-card-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.wa-food-card-emoji {
    width: 64px; height: 64px; border-radius: 50%; background: #fff; box-shadow: var(--wa-shadow-sm);
    display: flex; align-items: center; justify-content: center; font-size: 30px; line-height: 1;
}
.wa-availability-badge {
    position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 600;
    padding: 3px 9px; border-radius: 20px; color: #fff; background: var(--wa-success);
}

.wa-food-card-body { padding: 14px; display: flex; flex-direction: column; gap: 4px; flex-grow: 1; }
.wa-food-name { font-weight: 700; font-size: 15px; }
.wa-food-desc {
    font-size: 12.5px; color: var(--wa-muted); flex-grow: 1;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wa-food-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.wa-food-price { font-weight: 700; color: var(--wa-primary); font-size: 15px; }
.wa-food-add-btn {
    width: 34px; height: 34px; border-radius: 50%; background: var(--wa-primary); color: #fff; border: none;
    display: inline-flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1; flex-shrink: 0;
}
.wa-food-add-btn:hover { background: var(--wa-primary-dark); }

/* Item modal */
.wa-modal-photo { width: 100%; height: 200px; object-fit: cover; border-radius: var(--wa-radius) var(--wa-radius) 0 0; display: block; }
.wa-qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--wa-border); border-radius: var(--wa-radius); overflow: hidden; }
.wa-qty-stepper button { width: 38px; height: 38px; border: none; background: var(--wa-bg-subtle); font-size: 18px; line-height: 1; }
.wa-qty-stepper input { width: 46px; text-align: center; border: none; font-weight: 700; }
.wa-qty-stepper input:focus { outline: none; }

.wa-variation-list { display: flex; flex-wrap: wrap; gap: 10px; }
.wa-variation-list .form-check {
    flex: 1 1 110px; margin: 0; padding: 12px 10px; text-align: center;
    border: 2px solid var(--v-color, var(--wa-border));
    background: var(--v-bg, var(--wa-bg-subtle));
    border-radius: var(--wa-radius); cursor: pointer;
    transition: border-width .1s ease, box-shadow .15s ease;
}
.wa-variation-list .form-check:hover { box-shadow: var(--wa-shadow-sm); }
.wa-variation-list .form-check.is-selected { border-width: 3px; }
.wa-variation-list .form-check .form-check-input { display: none; }
.wa-variation-option-label { display: block; font-size: 13px; color: var(--v-color, var(--wa-dark)); margin-bottom: 3px; }
.wa-variation-option-price { display: block; font-weight: 700; font-size: 15px; color: var(--v-color, var(--wa-dark)); }

/* Cart offcanvas */
.wa-cart-panel { width: 380px; border-left: 1px solid var(--wa-border); }
.wa-cart-panel .offcanvas-header { border-bottom: 1px solid var(--wa-border); }
.wa-cart-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--wa-border); align-items: flex-start; }
.wa-cart-item-name { font-weight: 600; font-size: 13.5px; }
.wa-cart-item-variation { font-size: 11.5px; color: var(--wa-muted); }
.wa-cart-item-price { font-weight: 700; font-size: 13.5px; color: var(--wa-primary); white-space: nowrap; }
.wa-cart-item .wa-qty-stepper button { width: 26px; height: 26px; font-size: 14px; }
.wa-cart-item .wa-qty-stepper input { width: 32px; font-size: 13px; }
.wa-cart-remove-btn { border: none; background: none; color: var(--wa-muted); font-size: 14px; }
.wa-cart-remove-btn:hover { color: var(--wa-primary); }

.wa-cart-empty { text-align: center; padding: 40px 10px; color: var(--wa-muted); }
.wa-cart-empty i { font-size: 40px; opacity: .3; display: block; margin-bottom: 10px; }

.wa-cart-summary-row { display: flex; justify-content: space-between; font-size: 16px; font-weight: 700; padding-top: 10px; border-top: 1px solid var(--wa-border); margin-top: 6px; }

.wa-btn-whatsapp {
    background: var(--wa-success); color: #fff; border: none; border-radius: var(--wa-radius); padding: 12px;
    font-weight: 700; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.wa-btn-whatsapp:hover { background: #218838; color: #fff; }
.wa-btn-whatsapp:disabled { background: var(--wa-muted); }

.wa-floating-cart-btn {
    position: fixed; bottom: 18px; left: 16px; right: 16px; z-index: 1045;
    background: var(--wa-primary); color: #fff; border: none; border-radius: var(--wa-radius);
    padding: 14px 18px; font-weight: 700; box-shadow: var(--wa-shadow-md);
    display: none; align-items: center; justify-content: space-between;
}
.wa-floating-cart-btn.show { display: flex; }

.wa-btn-primary { background: var(--wa-primary); border-color: var(--wa-primary); color: #fff; }
.wa-btn-primary:hover { background: var(--wa-primary-dark); border-color: var(--wa-primary-dark); color: #fff; }
.wa-rounded { border-radius: var(--wa-radius) !important; }

@media (max-width: 991.98px) {
    .wa-category-nav-wrap { top: 65px; }
}
