/* ============================================================
   GROCERY SERVICE – Guest Shopping UI
   ============================================================ */
:root {
    --grocery-primary: #27ae60;
    --grocery-primary-dark: #219a52;
    --grocery-light: #e8f8ef;
    --grocery-text: #1e293b;
    --grocery-muted: #64748b;
    --grocery-border: #e2e8f0;
    --grocery-bg: #f8fafb;
}

/* ---- Layout ---- */
.grocery-page { padding: 0; }
.grocery-header {
    text-align: center; padding: 24px 16px 16px;
}
.grocery-header h2 {
    font-size: 22px; font-weight: 700; margin: 0 0 4px;
    color: var(--grocery-text);
}
.grocery-header p {
    font-size: 14px; color: var(--grocery-muted); margin: 0;
}

/* ---- Search ---- */
.grocery-search {
    padding: 0 16px 12px; position: sticky; top: 0; z-index: 10;
    background: var(--gb-bg, #fff);
}
.grocery-search input {
    width: 100%; padding: 10px 14px 10px 38px; border: 1px solid var(--grocery-border);
    border-radius: 24px; font-size: 14px; background: #fff;
    outline: none; transition: border-color 0.2s;
}
.grocery-search input:focus { border-color: var(--grocery-primary); }
.grocery-search .search-icon {
    position: absolute; left: 28px; top: 50%; transform: translateY(-50%);
    color: var(--grocery-muted); font-size: 14px; pointer-events: none;
}

/* ---- Category Tabs ---- */
.grocery-categories {
    display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 12px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.grocery-categories::-webkit-scrollbar { display: none; }
.grocery-cat-tab {
    white-space: nowrap; padding: 6px 16px; border-radius: 20px;
    border: 1px solid var(--grocery-border); background: #fff;
    font-size: 13px; cursor: pointer; transition: all 0.2s;
    flex-shrink: 0;
}
.grocery-cat-tab.active,
.grocery-cat-tab:hover {
    background: var(--grocery-primary); color: #fff;
    border-color: var(--grocery-primary);
}

/* ---- Bundle Cards ---- */
.grocery-bundles { padding: 0 16px 16px; }
.grocery-bundles-title {
    font-size: 16px; font-weight: 600; margin: 0 0 10px;
    display: flex; align-items: center; gap: 8px;
}
.grocery-bundles-scroll {
    display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.grocery-bundles-scroll::-webkit-scrollbar { display: none; }
.grocery-bundle-card {
    min-width: 200px; max-width: 220px; border-radius: 12px;
    border: 1px solid var(--grocery-border); overflow: hidden;
    background: #fff; flex-shrink: 0; cursor: pointer; transition: box-shadow 0.2s;
}
.grocery-bundle-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.grocery-bundle-img {
    height: 100px; background: var(--grocery-light);
    display: flex; align-items: center; justify-content: center;
    color: var(--grocery-primary); font-size: 32px;
}
.grocery-bundle-img img { width: 100%; height: 100%; object-fit: cover; }
.grocery-bundle-body { padding: 10px 12px; }
.grocery-bundle-name { font-size: 14px; font-weight: 600; }
.grocery-bundle-meta { font-size: 12px; color: var(--grocery-muted); margin-top: 2px; }
.grocery-bundle-btn {
    display: block; text-align: center; padding: 8px;
    background: var(--grocery-light); color: var(--grocery-primary);
    font-size: 13px; font-weight: 600; border: none; cursor: pointer;
    transition: background 0.2s;
}
.grocery-bundle-btn:hover { background: var(--grocery-primary); color: #fff; }

/* ---- Item Grid ---- */
.grocery-items { padding: 0 16px 100px; }
.grocery-cat-section { margin-bottom: 20px; }
.grocery-cat-section-title {
    font-size: 15px; font-weight: 600; margin: 0 0 10px;
    padding-bottom: 6px; border-bottom: 2px solid var(--grocery-primary);
    color: var(--grocery-text);
}
.grocery-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 12px;
}
.grocery-item {
    background: #fff; border: 1px solid var(--grocery-border);
    border-radius: 12px; overflow: hidden; transition: all 0.2s;
    position: relative;
}
.grocery-item.in-cart { border-color: var(--grocery-primary); }
.grocery-item-img {
    height: 100px; background: #f1f5f9;
    display: flex; align-items: center; justify-content: center;
    color: #94a3b8; font-size: 28px;
}
.grocery-item-img img { width: 100%; height: 100%; object-fit: cover; }
.grocery-item-body { padding: 10px; }
.grocery-item-name { font-size: 13px; font-weight: 500; line-height: 1.3; }
.grocery-item-unit { font-size: 11px; color: var(--grocery-muted); margin-top: 2px; }
.grocery-item-price { font-size: 15px; font-weight: 700; color: var(--grocery-primary); margin-top: 4px; }
.grocery-item-add {
    display: flex; align-items: center; justify-content: center;
    width: 100%; padding: 8px; background: var(--grocery-light);
    color: var(--grocery-primary); font-size: 13px; font-weight: 600;
    border: none; cursor: pointer; gap: 6px; transition: all 0.2s;
}
.grocery-item-add:hover { background: var(--grocery-primary); color: #fff; }

/* Qty Stepper */
.grocery-qty-stepper {
    display: flex; align-items: center; justify-content: center;
    width: 100%; background: var(--grocery-primary); border-radius: 0 0 11px 11px;
}
.grocery-qty-stepper button {
    width: 36px; height: 36px; background: none; border: none;
    color: #fff; font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.grocery-qty-stepper button:hover { background: rgba(255,255,255,0.15); }
.grocery-qty-stepper .qty-value {
    flex: 1; text-align: center; color: #fff; font-weight: 700; font-size: 15px;
}

/* ---- Floating Cart Bar ---- */
.grocery-cart-bar {
    position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%);
    width: calc(100% - 32px); max-width: 500px;
    background: var(--grocery-primary); color: #fff;
    border-radius: 16px; padding: 12px 16px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 8px 32px rgba(39,174,96,0.35);
    z-index: 100; cursor: pointer; transition: transform 0.3s;
    display: none;
}
.grocery-cart-bar:hover { transform: translateX(-50%) scale(1.02); }
.grocery-cart-bar.visible { display: flex; }
.grocery-cart-info { display: flex; align-items: center; gap: 10px; }
.grocery-cart-count {
    background: #fff; color: var(--grocery-primary); width: 28px; height: 28px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
}
.grocery-cart-label { font-size: 14px; font-weight: 500; }
.grocery-cart-total { font-size: 18px; font-weight: 700; }
.grocery-cart-arrow { font-size: 16px; margin-left: 8px; }

/* ---- Checkout Panel ---- */
.grocery-checkout {
    display: none; padding: 0 16px 120px;
}
.grocery-checkout.active { display: block; }

.grocery-checkout-back {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--grocery-primary); font-size: 14px; font-weight: 500;
    cursor: pointer; padding: 8px 0; margin-bottom: 12px;
    background: none; border: none;
}

/* Steps */
.grocery-steps { display: flex; gap: 4px; margin-bottom: 20px; }
.grocery-step {
    flex: 1; height: 4px; border-radius: 2px;
    background: var(--grocery-border);
}
.grocery-step.active { background: var(--grocery-primary); }
.grocery-step.done { background: var(--grocery-primary); opacity: 0.5; }

.grocery-step-title {
    font-size: 18px; font-weight: 700; margin: 0 0 16px;
}

/* Cart Review */
.grocery-cart-item {
    display: flex; gap: 12px; padding: 12px 0;
    border-bottom: 1px solid var(--grocery-border);
    align-items: center;
}
.grocery-cart-item-img {
    width: 52px; height: 52px; border-radius: 8px;
    background: #f1f5f9; flex-shrink: 0; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    color: #94a3b8; font-size: 18px;
}
.grocery-cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.grocery-cart-item-info { flex: 1; }
.grocery-cart-item-name { font-size: 14px; font-weight: 500; }
.grocery-cart-item-price { font-size: 13px; color: var(--grocery-muted); }
.grocery-cart-item-notes {
    width: 100%; margin-top: 4px; padding: 6px 8px;
    border: 1px solid var(--grocery-border); border-radius: 6px;
    font-size: 12px; resize: none;
}

/* Delivery Windows */
.grocery-window-card {
    border: 2px solid var(--grocery-border); border-radius: 12px;
    padding: 14px 16px; margin-bottom: 8px; cursor: pointer;
    transition: all 0.2s; display: flex; align-items: center; gap: 12px;
}
.grocery-window-card:hover { border-color: var(--grocery-primary); }
.grocery-window-card.selected { border-color: var(--grocery-primary); background: var(--grocery-light); }
.grocery-window-radio {
    width: 20px; height: 20px; border: 2px solid var(--grocery-border);
    border-radius: 50%; flex-shrink: 0; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.grocery-window-card.selected .grocery-window-radio {
    border-color: var(--grocery-primary);
}
.grocery-window-card.selected .grocery-window-radio::after {
    content: ''; width: 10px; height: 10px; border-radius: 50%;
    background: var(--grocery-primary);
}
.grocery-window-label { font-size: 14px; font-weight: 500; }
.grocery-window-time { font-size: 12px; color: var(--grocery-muted); }

/* Fee Summary */
.grocery-fee-summary { margin: 16px 0; }
.grocery-fee-line {
    display: flex; justify-content: space-between; padding: 6px 0;
    font-size: 14px;
}
.grocery-fee-line.total {
    font-size: 18px; font-weight: 700;
    border-top: 2px solid var(--grocery-primary);
    padding-top: 10px; margin-top: 6px;
}
.grocery-fee-note {
    font-size: 12px; color: var(--grocery-muted); margin-top: 4px;
}

/* Guest Info Form */
.grocery-form { display: flex; flex-direction: column; gap: 14px; }
.grocery-form label { font-size: 13px; font-weight: 500; display: block; margin-bottom: 4px; }
.grocery-form input,
.grocery-form textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--grocery-border);
    border-radius: 8px; font-size: 14px; outline: none;
}
.grocery-form input:focus,
.grocery-form textarea:focus { border-color: var(--grocery-primary); }

/* Submit Button */
.grocery-submit-btn {
    display: block; width: 100%; padding: 14px;
    background: var(--grocery-primary); color: #fff;
    border: none; border-radius: 12px;
    font-size: 16px; font-weight: 700; cursor: pointer;
    transition: background 0.2s; margin-top: 16px;
}
.grocery-submit-btn:hover { background: var(--grocery-primary-dark); }
.grocery-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Confirmation ---- */
.grocery-confirmation {
    text-align: center; padding: 40px 16px;
}
.grocery-confirmation-icon {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--grocery-light); color: var(--grocery-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; margin: 0 auto 16px;
}
.grocery-confirmation h3 { font-size: 22px; margin: 0 0 8px; }
.grocery-confirmation p { color: var(--grocery-muted); font-size: 14px; }
.grocery-order-number {
    display: inline-block; background: var(--grocery-light);
    color: var(--grocery-primary); padding: 8px 20px;
    border-radius: 8px; font-size: 18px; font-weight: 700;
    margin: 16px 0;
}

/* ---- Guest Instructions Banner ---- */
.grocery-instructions {
    background: var(--grocery-light); border-radius: 10px;
    padding: 12px 16px; margin: 0 16px 12px; font-size: 13px;
    color: var(--grocery-text); line-height: 1.5;
}

/* ---- Empty State ---- */
.grocery-empty {
    text-align: center; padding: 60px 20px; color: var(--grocery-muted);
}
.grocery-empty i { font-size: 48px; opacity: 0.3; margin-bottom: 12px; }

/* ---- Responsive ---- */
@@media (min-width: 768px) {
    .grocery-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
    .grocery-cart-bar { bottom: 24px; }
}
