/* =========================================================
   KB AI Restaurant – Frontend Styles
   ========================================================= */

.kb-ai-rs-wrap,
.kb-ai-rs-detail-wrap { font-family: inherit; }

/* ---- Buttons ---- */
.kb-ai-rs-btn-primary {
    display: inline-block;
    background: #ea580c;
    color: #fff !important;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s;
}
.kb-ai-rs-btn-primary:hover { background: #c2410c; }
.kb-ai-rs-btn-outline {
    display: inline-block;
    background: transparent;
    color: #ea580c !important;
    border: 2px solid #ea580c;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
}
.kb-ai-rs-btn-outline:hover { background: #ea580c; color: #fff !important; }

/* ---- Filter bar ---- */
.kb-ai-rs-filter-bar {
    background: #fff8f4;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
}
.kb-ai-rs-filter-row { display: flex; flex-direction: column; gap: 12px; }

/* Category tabs */
.kb-ai-rs-cat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.kb-ai-rs-cat-tab {
    padding: 6px 16px;
    border-radius: 20px;
    background: #fff;
    border: 1.5px solid #fed7aa;
    color: #374151;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all .2s;
}
.kb-ai-rs-cat-tab:hover, .kb-ai-rs-cat-tab.active {
    background: #ea580c;
    color: #fff !important;
    border-color: #ea580c;
}

/* Filter dropdowns */
.kb-ai-rs-filter-selects { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.kb-ai-rs-filter-selects select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
}

/* ---- Count ---- */
.kb-ai-rs-count { color: #6b7280; font-size: 14px; margin-bottom: 14px; }

/* ---- Item grid ---- */
.kb-ai-rs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.kb-ai-rs-no-results { color: #6b7280; padding: 40px; text-align: center; grid-column: 1/-1; }

/* ---- Card ---- */
.kb-ai-rs-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.kb-ai-rs-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); transform: translateY(-2px); }

.kb-ai-rs-card-img { position: relative; height: 180px; overflow: hidden; background: #f9fafb; }
.kb-ai-rs-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kb-ai-rs-no-img { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 48px; }

/* badges */
.kb-ai-rs-badge {
    position: absolute; top: 10px; left: 10px;
    padding: 3px 10px; border-radius: 4px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; color: #fff;
}
.kb-ai-rs-badge-chef    { background: #7c3aed; }
.kb-ai-rs-badge-popular { background: #ea580c; }

.kb-ai-rs-card-body { padding: 14px; }
.kb-ai-rs-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; gap: 8px; }
.kb-ai-rs-card-title { font-size: 15px; font-weight: 700; margin: 0; flex: 1; }
.kb-ai-rs-card-title a { color: inherit; text-decoration: none; }
.kb-ai-rs-card-title a:hover { color: #ea580c; }
.kb-ai-rs-card-price { font-size: 16px; font-weight: 800; color: #ea580c; white-space: nowrap; }
.kb-ai-rs-card-desc { font-size: 12px; color: #6b7280; margin: 0 0 10px; line-height: 1.4; }

/* meta tags */
.kb-ai-rs-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.kb-ai-rs-spice { font-size: 14px; }
.kb-ai-rs-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: #f3f4f6;
    color: #374151;
}
.kb-ai-rs-tag-veg   { background: #dcfce7; color: #166534; }
.kb-ai-rs-tag-halal { background: #dbeafe; color: #1e40af; }
.kb-ai-rs-tag-gf    { background: #fef9c3; color: #713f12; }

.kb-ai-rs-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* =========================================================
   Order Modal (opens on Add to Order)
   ========================================================= */
.kb-ai-rs-order-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.kb-ai-rs-order-modal-inner {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,.2);
    padding: 22px 22px 20px;
}
.kb-ai-rs-order-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6b7280;
}
.kb-ai-rs-order-modal-close:hover { color: #111; }
.kb-ai-rs-order-modal-inner h3 {
    margin: 0 0 14px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #111827;
}
#kb-rs-order-items-preview {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 14px;
    max-height: 96px;
    overflow-y: auto;
    background: #fff8f4;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 10px 12px;
}
.kb-ai-rs-order-success { text-align: center; padding: 24px 0; }
.kb-ai-rs-order-success-msg {
    font-size: 17px; font-weight: 600; color: #16a34a;
    margin: 0;
}

/* Input in cart form */
.kb-ai-rs-input {
    width: 100%; box-sizing: border-box;
    padding: 9px 12px; border: 1px solid #d1d5db;
    border-radius: 6px; font-size: 14px;
    margin-bottom: 10px; display: block;
}
.kb-ai-rs-input:focus {
    outline: none;
    border-color: #fb923c;
    box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.25);
}

/* PlaceAutocompleteElement styling (the new Google UI widget) */
#kb-rs-order-form gmp-place-autocomplete,
#kb-rs-order-form gmp-basic-place-autocomplete,
#kb-rs-order-form gmp-place-autocomplete-element,
#kb-rs-order-form .pac-container {
    font-family: inherit;
}

.kb-ai-rs-btn-primary:disabled,
.kb-ai-rs-btn-primary[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
    background: #9ca3af;
}
.kb-ai-rs-btn-primary.kb-ai-rs-ordered {
    background: #16a34a;
}
.kb-ai-rs-btn-primary.kb-ai-rs-ordered:hover {
    background: #16a34a;
}

/* Make the new Places element visually match our inputs */
#kb-rs-order-form [data-kb-places-ui="1"] {
    margin-bottom: 10px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    box-shadow: none;
}
#kb-rs-order-form [data-kb-places-ui="1"]:focus-within {
    border-color: #fb923c;
    box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.25);
}
#kb-rs-order-msg { font-size: 14px; margin-bottom: 8px; }
#kb-rs-order-msg.success { color: #16a34a; }
#kb-rs-order-msg.error   { color: #dc2626; }

/* =========================================================
   Single Item Detail Page
   ========================================================= */
.kb-ai-rs-breadcrumb { font-size: 14px; color: #6b7280; margin-bottom: 20px; }
.kb-ai-rs-breadcrumb a { color: #ea580c; text-decoration: none; }
.kb-ai-rs-breadcrumb span { margin: 0 6px; }

.kb-ai-rs-detail-layout { display: grid; grid-template-columns: 1fr 320px; gap: 32px; }
@media (max-width: 860px) { .kb-ai-rs-detail-layout { grid-template-columns: 1fr; } }

.kb-ai-rs-detail-featured { border-radius: 10px; overflow: hidden; margin-bottom: 12px; max-height: 420px; }
.kb-ai-rs-detail-featured img { width: 100%; height: 100%; object-fit: cover; display: block; }

.kb-ai-rs-detail-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; }
.kb-ai-rs-detail-gallery a img { width: 100%; height: 70px; object-fit: cover; border-radius: 6px; }

.kb-ai-rs-detail-section { margin-bottom: 28px; }
.kb-ai-rs-detail-section h2 { font-size: 18px; font-weight: 700; border-bottom: 2px solid #f3f4f6; padding-bottom: 8px; margin-bottom: 14px; }

/* Specs grid */
.kb-ai-rs-specs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kb-ai-rs-spec { background: #fff8f4; border: 1px solid #fed7aa; border-radius: 8px; padding: 10px 14px; font-size: 14px; }
.kb-ai-rs-spec span { display: block; font-size: 11px; text-transform: uppercase; color: #9ca3af; margin-bottom: 3px; }

/* Dietary badges */
.kb-ai-rs-dietary-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.kb-ai-rs-dietary-badge { padding: 5px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; background: #f3f4f6; }
.kb-ai-rs-dietary-vegetarian { background: #dcfce7; color: #166534; }
.kb-ai-rs-dietary-vegan      { background: #bbf7d0; color: #14532d; }
.kb-ai-rs-dietary-halal      { background: #dbeafe; color: #1e40af; }
.kb-ai-rs-dietary-gluten_free{ background: #fef9c3; color: #713f12; }

/* Chatbot embed box */
.kb-ai-rs-chatbot-box { background: #fff8f4; border: 1px solid #fed7aa; border-radius: 10px; padding: 20px; }
.kb-ai-rs-chatbot-box h3 { margin: 0 0 8px; font-size: 16px; }
.kb-ai-rs-chatbot-box p { font-size: 13px; color: #6b7280; margin: 0 0 12px; }

/* Sidebar order card */
.kb-ai-rs-order-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 20px; position: sticky; top: 20px; }
.kb-ai-rs-sidebar-box { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 20px; margin-top: 16px; }
.kb-ai-rs-sidebar-box h3 { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.kb-ai-rs-form-msg { font-size: 13px; padding: 8px 12px; border-radius: 6px; margin-bottom: 10px; display: none; }
.kb-ai-rs-form-msg.success { background: #dcfce7; color: #166534; display: block; }
.kb-ai-rs-form-msg.error   { background: #fee2e2; color: #991b1b; display: block; }
.kb-ai-rs-detail-title { font-size: 22px; font-weight: 800; margin: 0 0 10px; }
.kb-ai-rs-detail-price { font-size: 28px; font-weight: 800; color: #ea580c; margin: 0 0 16px; }

.kb-ai-rs-highlights { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.kb-ai-rs-highlight { background: #fff8f4; border: 1px solid #fed7aa; border-radius: 20px; padding: 3px 12px; font-size: 12px; font-weight: 600; }

/* Qty control */
.kb-ai-rs-qty-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.kb-ai-rs-qty-row label { font-size: 14px; font-weight: 600; }
.kb-ai-rs-qty-ctrl { display: flex; align-items: center; gap: 8px; }
.kb-ai-rs-qty-btn { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #e5e7eb; background: #fff; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.kb-ai-rs-qty-btn:hover { border-color: #ea580c; color: #ea580c; }
#kb-rs-qty { width: 50px; text-align: center; border: 1px solid #e5e7eb; border-radius: 6px; padding: 6px; font-size: 15px; }

.kb-ai-rs-back-link { display: block; text-align: center; color: #6b7280; font-size: 13px; text-decoration: none; margin-top: 14px; }
.kb-ai-rs-back-link:hover { color: #ea580c; }
