/* =============================================================
   mobi-portal.css
   Replaces jQuery Mobile 1.4.5 for the mobile portal.
   Pure CSS — no framework dependency.
   Brand accent: #DA4336 (matches existing mobile theme)
   ============================================================= */

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

body {
    margin: 0;
    padding: 0;
    font-family: helvetica, arial, sans-serif;
    font-size: 15px;
    color: #111;
    background: #f5f5f5;
    /* Space for fixed header only (no tab bar at bottom) */
    padding-top: 52px;
}

img { max-width: 100%; }
a   { text-decoration: none; color: #DA4336; }

/* Anchor offset for category jump links */
.anchor-target {
    display: block;
    position: relative;
    top: -110px;
    visibility: hidden;
}

/* ---- Top header -------------------------------------------- */
.mob-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 52px;
    background: #DA4336;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 6px;
    z-index: 200;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.mob-header__btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 50%;
    line-height: 1;
    transition: background .15s;
}
.mob-header__btn:hover { background: rgba(255,255,255,.15); }

.mob-header__title {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px;
}

.mob-header__right {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Cart icon button */
.mob-header__cart {
    position: relative;
    padding: 6px 10px;
    background: none;
}

.mob-header__cart svg {
    display: block;
    width: 26px;
    height: 26px;
    stroke: #ffffff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cart-badge {
    position: absolute;
    top: 2px; right: 2px;
    background: #689f38;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    min-width: 17px;
    height: 17px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    pointer-events: none;
}

/* ---- Search bar -------------------------------------------- */
.search-bar {
    position: fixed;
    top: 52px; left: 0; right: 0;
    background: #fff;
    z-index: 190;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .2s ease, padding .2s ease;
    border-bottom: 1px solid #ddd;
}
.search-bar.is-visible {
    max-height: 60px;
    padding: 8px 12px;
}

.search-bar__inner {
    display: flex;
    align-items: center;
    gap: 8px;
}
.search-bar__inner input {
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 14px;
    outline: none;
}
.search-bar__inner input:focus { border-color: #DA4336; }
#search-clear {
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

/* ---- Category slide-in panel ------------------------------- */
.cat-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 300;
}
.cat-overlay.is-visible { display: block; }

.cat-panel {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 240px;
    background: #fff;
    z-index: 400;
    transform: translateX(-100%);
    transition: transform .25s ease;
    overflow-y: auto;
    padding: 52px 0 24px;
    box-shadow: 4px 0 16px rgba(0,0,0,.15);
}
.cat-panel.is-open { transform: translateX(0); }

.cat-panel__close {
    position: absolute;
    top: 10px; right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #555;
    padding: 4px 8px;
}

.cat-panel__title {
    background: #DA4336;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    padding: 10px 16px;
    position: absolute;
    top: 0; left: 0; right: 0;
}

.cat-panel__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cat-panel__list li {
    border-bottom: 1px solid #eee;
}
.cat-panel__list a {
    display: block;
    padding: 13px 18px;
    color: #222;
    font-size: 14px;
    font-weight: normal;
    transition: background .12s;
}
.cat-panel__list a:hover,
.cat-panel__list a:active { background: #fff0ee; color: #DA4336; }

/* ---- View panes -------------------------------------------- */
.view-pane {
    min-height: calc(100vh - 52px);
    background: #fafafa;
}

/* ---- Merchant info bar ------------------------------------- */
.merchant-bar {
    background: #fff;
    padding: 10px 14px 8px;
    text-align: center;
    font-size: 12px;
    color: #666;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 4px;
}
.merchant-bar__addr { margin-bottom: 2px; }
.merchant-bar__hours { color: #444; font-weight: bold; }

/* ---- Menu sections ----------------------------------------- */
.menu-section {
    margin-bottom: 4px;
}
.menu-section__header {
    background: #fafafa;
    padding: 20px 14px 6px;
   /* border-top: 1px solid #e8e8e8; */
    border-bottom: 1px solid #e8e8e8;
    position: sticky;
    top: 52px;
    z-index: 100;
}
.menu-section__title {
    font-size: 1.05em;
    font-weight: bold;
    color: #880000;
    margin: 0 0 2px;
}
.menu-section__desc {
    font-size: 0.8em;
    font-style: italic;
    color: #666;
}

/* ---- Menu rows --------------------------------------------- */
.menu-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    transition: background .12s;
}
.menu-row--tap { cursor: pointer; }
.menu-row--tap:active,
.menu-row--tap:hover { background: #fffde7; }

.menu-row__info { flex: 1; min-width: 0; }
.row-name {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    color: #111;
}
.row-desc {
    font-size: 12px;
    color: #777;
    font-style: italic;
    line-height: 1.3;
    margin-top: 3px;
}
.badge-img {
    height: 16px;
    vertical-align: middle;
    margin-left: 4px;
}

.menu-row__img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.menu-row__price {
    font-weight: bold;
    font-size: 14px;
    color: #222;
    text-align: left;
    white-space: nowrap;
    flex-shrink: 0;
    width: 58px;
    align-self: flex-start;
    padding-top: 2px;
}
.price-plus { color: #d00; font-size: 12px; }

/* ---- Cart pane --------------------------------------------- */
.cart-pane {
    padding: 0 0 24px;
}
.cart-pane__title {
    font-size: 1.15em;
    font-weight: bold;
    text-align: center;
    padding: 14px 12px 8px;
    margin: 0;
    background: #ffffd2;
    border-bottom: 1px solid #e0df9e;
    position: sticky;
    top: 52px;
    z-index: 100;
}

/* Reuse existing cart table styles from mobi_cart.jsp */
.ordersection     { background: #ffffd2; width: 100%; padding: 8px 12px; }
.cart_table       { border-collapse: collapse; width: 100%; font-size: 14px; }
.orderlist_head thead tr th {
    border-bottom: 2px solid #000040;
    padding: 6px 4px;
}
.orderlist_head tr td {
    border-bottom: 1px dashed #aaa;
    padding: 6px 4px;
}
.orderlist_head tr:hover { background: #fffde7; }
.orderlist_foot tfoot tr td {
    border-top: 2px solid #000040;
    padding: 6px 4px;
}

.item_note  { color: #800000; display: inline; font-size: 12px; }
.tiny_note  { color: #666; text-align: center; font-size: 12px; padding: 8px 0; }
.normal_text { font-size: 14px; }
.news       { color: #f00; }

.mbtn {
    display: inline-block;
    background: linear-gradient(to bottom, #d67069, #DA4336);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    padding: 12px 24px;
    cursor: pointer;
    width: 100%;
    text-align: center;
    margin-top: 8px;
    text-decoration: none;
}
.mbtn:hover { background: linear-gradient(to bottom, #e07a70, #c0382c); }

input.box, textarea.box, select.box, .popup_cart {
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #ccc;
    padding: 8px 10px;
    width: 100%;
}
textarea.box { background: #ffffca; resize: vertical; }

#space { height: 8px; display: block; }

/* ---- Modals ------------------------------------------------ */
.modal {
    display: none;
    position: fixed; inset: 0;
    z-index: 1000;
    background: rgba(255,255,255,.85) url('../images/load.gif') center no-repeat;
}
body.loading { overflow: hidden; }
body.loading .modal { display: block; }

.info_hiden { display: none !important; }

/* ---- Footer ----------------------------------------------- */
.mobi-footer {
    text-align: center;
    padding: 16px 12px;
 /*   border-top: 1px solid #e0e0e0; */
    margin-top: 8px;
}
.mobi-footer p {
    margin: 0;
    font-size: 11px;
    color: #999;
}

/* =============================================================
   mobi_cart.jsp styles
   ============================================================= */

.cart-panel { font-size: 15px; padding: 0 14px 24px; }

/* ---- Notice banners ---- */
.cart-notice {
    padding: 14px 12px;
    border-radius: 10px;
    margin: 10px 0;
    font-size: 1em;
    font-weight: bold;
    background: #f0f4ff;
    color: #1a56cc;
    text-align: center;
    border: 1px solid #c5d5f5;
}
.cart-notice--warn { background: #fdecea; color: #c0392b; border-color: #f5c5c5; }

/* ---- Column headers ---- */
.cart-header {
    display: flex;
    align-items: center;
    padding: 10px 0 6px;
    border-bottom: 2px solid #000040;
    font-weight: bold;
    font-size: 0.85em;
    color: #666;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.cart-header__name  { flex: 1; }
.cart-header__qty   { width: 88px; text-align: center; }
.cart-header__price { width: 60px; text-align: right; }
.cart-header__del   { width: 32px; }

/* ---- Item rows ---- */
.cart-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
    background: #f7f7f7;
}
.cart-row__name {
    flex: 1;
    line-height: 1.4;
    font-size: 1em;
    font-weight: 500;
}
.cart-row__note {
    display: block;
    color: #800000;
    font-size: 0.82em;
    font-weight: normal;
    margin-top: 2px;
}
.cart-row__qty {
    width: 88px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.cart-row__qty-num {
    min-width: 22px;
    text-align: center;
    font-weight: bold;
    font-size: 1em;
}
.cart-row__price   { width: 60px; text-align: right; font-size: 1em; font-weight: 500; }
.cart-row__del     { width: 32px; text-align: right; }

/* Qty +/− buttons — larger tap targets */
.cart-qty-btn {
    width: 22px; height: 22px;
    border: 1.5px solid #DA4336;
    border-radius: 50%;
    background: #fff;
    cursor: pointer; padding: 0;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: background .12s;
}
.cart-qty-btn:active { background: #fdecea; }
.cart-qty-btn svg {
    width: 10px; height: 10px;
    stroke: #DA4336; stroke-width: 2.5; stroke-linecap: round; fill: none;
}

/* Delete button */
.cart-del-btn {
    width: 32px; height: 32px;
    border: none; background: none; cursor: pointer; padding: 0;
    display: flex; align-items: center; justify-content: center;
}
.cart-del-btn svg {
    width: 16px; height: 16px;
    stroke: #ccc; stroke-width: 2; stroke-linecap: round; fill: none;
    transition: stroke .12s;
}
.cart-del-btn:active svg { stroke: #c0392b; }

/* ---- Totals ---- */
.cart-totals {
    margin-top: 6px;
    background: #fafafa;
    border-radius: 10px;
    padding: 4px 12px;
    margin-bottom: 8px;
}
.cart-totals__row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 0;
    border-top: 1px solid #ebebeb;
    font-size: 0.95em; gap: 6px;
}
.cart-totals__row:first-child { border-top: none; }
.cart-totals__row--discount { color: #c0392b; }
.cart-totals__row--total {
    border-top: 2px solid #000040;
    font-size: 1.1em;
    padding-top: 10px;
    padding-bottom: 2px;
}
.cart-totals__row--tip,
.cart-totals__row--coupon { flex-wrap: wrap; gap: 6px; align-items: center; }

.cart-hint {
    display: inline-flex; align-items: center; justify-content: center;
    width: 15px; height: 15px; border-radius: 50%;
    border: 1px solid #aaa; font-size: 10px; color: #888; cursor: help; margin-left: 3px;
}

.cart-expand-btn {
    background: none; border: none; cursor: pointer; padding: 0 3px; vertical-align: middle; line-height: 1;
}
.cart-expand-btn svg {
    width: 11px; height: 11px;
    stroke: #555; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    fill: none; display: inline-block; vertical-align: middle;
}
.cart-taxfees-detail {
    background: #f2f2f2;
    border-radius: 6px;
    margin: 0 0 4px 10px;
    padding: 2px 0;
}
.cart-taxfees-item {
    display: flex; justify-content: space-between;
    padding: 6px 8px; font-size: 0.88em; color: #555;
    border-top: 1px solid #e5e5e5;
}
.cart-taxfees-item:first-child { border-top: none; }

/* Tip / coupon inputs */
.cart-tip-input {
    width: 64px; text-align: right; font-size: 14px;
    padding: 6px 8px; border: 1px solid #ccc; border-radius: 8px;
}
.cart-coupon-input {
    flex: 1; min-width: 0; font-size: 14px;
    padding: 8px 10px; border: 1px solid #ccc; border-radius: 8px;
}
.cart-apply-btn {
    font-size: 13px; padding: 8px 14px;
    border: none; border-radius: 8px;
    background: #DA4336; color: #fff; cursor: pointer; white-space: nowrap;
}
.cart-apply-btn:active { background: #c0392b; }
.cart-totals__row--coupon span:last-child {
    display: flex; align-items: center; gap: 6px; flex: 1;
}

/* Full-width selects */
.cart-select {
    font-size: 14px; border: 1px solid #ddd; border-radius: 8px;
    padding: 10px 12px; width: 100%; background: #fff;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpolyline points='1,1 6,7 11,1' fill='none' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* ---- Section blocks ---- */
.cart-section {
    padding: 14px 0 10px;
    border-bottom: 1px solid #f0f0f0;
}
.cart-section:last-of-type { border-bottom: none; }
.cart-section__label {
    font-weight: bold;
    font-size: 0.95em;
    margin-bottom: 10px;
    color: #222;
}
.cart-section__hint { font-size: 0.85em; color: #888; margin-bottom: 8px; line-height: 1.5; }

/* Pill-style radio buttons for Pickup/Delivery */
.cart-section__options {
    display: flex; gap: 10px; flex-wrap: wrap;
}
.cart-radio {
    display: flex; align-items: center;
    cursor: pointer;
}
.cart-radio input[type="radio"] { display: none; }
.cart-radio-pill {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 18px;
    border: 1.5px solid #ddd;
    border-radius: 24px;
    font-size: 0.95em;
    color: #444;
    background: #fff;
    transition: border-color .15s, background .15s, color .15s;
    white-space: nowrap;
}
.cart-radio input[type="radio"]:checked + .cart-radio-pill {
    border-color: #DA4336;
    background: #fdecea;
    color: #DA4336;
    font-weight: bold;
}

/* Textarea */
.cart-textarea {
    width: 100%; box-sizing: border-box; font-size: 14px;
    border: 1px solid #ddd; border-radius: 8px;
    padding: 10px 12px; background: #ffffff !important;
    resize: vertical; line-height: 1.5;
    transition: border-color .15s;
}
.cart-textarea:focus { outline: none; border-color: #DA4336; background: #ffffff;}

/* ---- Checkout button ---- */
.cart-checkout { padding: 16px 0 8px; }
.cart-checkout .mbtn {
    display: block; width: 100%;
    background: #DA4336; border: none; border-radius: 12px;
    color: #fff; font-size: 1.15em; font-weight: bold;
    padding: 16px; cursor: pointer;
    letter-spacing: 0.02em;
    box-shadow: 0 3px 10px rgba(218, 67, 54, 0.35);
    transition: background .15s, box-shadow .15s;
}
.cart-checkout .mbtn:active {
    background: #c0392b;
    box-shadow: 0 1px 4px rgba(218, 67, 54, 0.3);
}

/* ---- Menu image disclaimer notice ------------------------- */
.menu-img-notice {
    font-size: 0.75em;
    font-style: italic;
    color: #999;
    text-align: center;
    padding: 12px 16px 8px;
    line-height: 1.5;
    margin: 0;
}

/* ---- Optional badge --------------------------------------- */
.cart-optional-badge {
    display: inline-block;
    font-size: 0.72em;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 20px;
    background: #eaf4e8;
    color: #2e7d32;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
    margin-left: 6px;
}
