/* ============================================
   SIPO API component styles — Indo Lanka
   ============================================
   Everything here styles markup that the `api/`
   modules inject or render at runtime. Colours
   come from the tokens in css/styles.css, so this
   file carries no palette of its own.
   ============================================ */

/* ---------- Status strip (statusManager.js) ---------- */
/* The strip is in the HTML from first paint with a FIXED height, and the header
   is offset by the same CSS constant (--strip-h), so nothing moves when the live
   status text arrives. */
.status-strip {
    position: fixed;
    inset: 0 0 auto;
    z-index: 60;
    height: var(--strip-h);
    display: flex;
    align-items: center;
    background: var(--forest-950);
    color: #fff;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: .86rem;
    letter-spacing: .02em;
    padding: 0 16px;
    overflow: hidden;
    transition: background-color .4s;
}
.status-strip.open { background: #17692c; }
.status-strip.closed { background: var(--saffron-600); }
.status-strip.error { background: var(--forest-950); }
.status-strip-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    min-width: 0;
}
.status-strip-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.status-strip-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    flex: none;
    background: currentColor;
}
.status-strip.open .status-strip-dot { animation: sipo-pulse 2s ease-in-out infinite; }
@keyframes sipo-pulse { 50% { box-shadow: 0 0 0 5px rgba(255, 255, 255, .25); } }
.countdown-timer { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .status-strip { font-size: .8rem; } }

/* ---------- Status chip + today's hours ---------- */
[data-field="status"] {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-weight: 700;
    font-size: .92rem;
    padding: .5em 1.05em;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .22);
    color: #fff;
    white-space: nowrap;
    backdrop-filter: blur(8px);
}
[data-field="status"] .dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
    flex: none;
}
[data-field="status"].is-open .dot { background: #4cd36b; box-shadow: 0 0 0 4px rgba(76, 211, 107, .22); }
[data-field="status"].is-closed .dot { background: #ff8a4c; }
.status-chip--light[data-field="status"] { background: var(--cream); border-color: var(--sand-2); color: var(--ink); backdrop-filter: none; }
.status-chip--light[data-field="status"].is-open .dot { background: #1f9a42; box-shadow: 0 0 0 4px rgba(31, 154, 66, .18); }
.status-chip--light[data-field="status"].is-closed .dot { background: var(--saffron); }

/* ---------- Service pills ---------- */
[data-field="services"] {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}
.service-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 700;
    font-size: .85rem;
    padding: .3em .95em;
    border-radius: 999px;
    background: var(--saffron);
    color: #fff;
}

/* ---------- Address + alert ---------- */
.address-link { text-decoration: none; color: inherit; }
.address-link:hover { color: var(--saffron-600); }
.site-footer .address-link:hover { color: #fff; }

[data-field="alert"] {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: .6rem;
    background: var(--saffron);
    color: #fff;
    padding: 1rem 1.25rem;
    font-weight: 700;
    text-align: center;
}
.alert-mark { font-size: 1.1rem; line-height: 1.4; }

/* ---------- Opening hours ---------- */
[data-field="hours-list"] {
    list-style: none;
    margin: 0;
    padding: 0;
}
[data-field="hours-list"] li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .1rem 0;
    font-size: .92rem;
}
.hours-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
}
.hours-row:last-child { border-bottom: 0; }
.hours-row .day, [data-field="hours-list"] li .day { white-space: nowrap; }
.hours-row .time, [data-field="hours-list"] li .time { text-align: right; color: var(--muted); }
[data-field="hours-list"] li .time { color: inherit; }
.hours-row.today { background: var(--forest); color: #fff; border-radius: 12px; border-bottom-color: transparent; }
.hours-row.today .time { color: #fff; }
[data-field="hours-list"] li.today { color: #ffb27d; font-weight: 700; }
.hours-row.today .day::after, [data-field="hours-list"] li.today .day::after {
    content: " · today";
    font-weight: 600;
    font-size: .85em;
}
.closed-day { font-weight: 700; }
.next-day {
    display: inline-block;
    margin-left: .35rem;
    font-size: .75em;
    font-weight: 700;
    opacity: .8;
}

/* ---------- Loading / empty ---------- */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    padding: 2.5rem 0;
    font-weight: 600;
    color: var(--muted);
    grid-column: 1 / -1;
}
.spinner {
    width: 22px; height: 22px;
    border: 3px solid rgba(11, 58, 23, .15);
    border-top-color: var(--saffron);
    border-radius: 50%;
    animation: sipo-spin .7s linear infinite;
}
@keyframes sipo-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

.menu-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 1rem;
    font-weight: 600;
}
.menu-empty a { color: var(--saffron-600); }

/* ---------- Popular dish cards (home, uiManager.renderPopularItems) ---------- */
.dish-card {
    background: var(--cream);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 0 var(--line);
    transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.dish-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.dish-media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--sand-2);
    overflow: hidden;
}
.dish-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.dish-card:hover .dish-media img { transform: scale(1.06); }
/* No product photo in SIPO yet: a branded panel, never a stock photo of another dish */
.dish-media.is-empty {
    aspect-ratio: auto;
    height: 64px;
    overflow: visible;
    background:
        radial-gradient(rgba(229, 80, 2, .18) 1.3px, transparent 1.5px) 0 0 / 16px 16px,
        var(--sand-2);
}
.dish-media.is-empty .dish-mark { display: none; }
.dish-mark { display: grid; place-items: center; height: 100%; color: var(--muted); }
.dish-mark svg { width: 34px; height: 34px; }
.dish-mark-text { font-size: .8rem; }
.dish-badge {
    position: absolute;
    left: .85rem; top: .85rem;
    background: var(--saffron);
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .35rem .65rem;
    border-radius: 999px;
}
.dish-media.is-empty .dish-badge { top: auto; bottom: -13px; }
.dish-body {
    padding: 1.25rem 1.35rem 1.4rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.dish-body h3 { font-size: 1.35rem; color: var(--forest); margin: 0 0 .45rem; }
.dish-body p { margin: 0 0 1rem; font-size: .95rem; color: var(--muted); line-height: 1.55; }
.dish-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
}
.dish-order {
    font-weight: 700;
    font-size: .88rem;
    text-decoration: none;
    color: var(--saffron-600);
    border: 1.5px solid var(--saffron);
    padding: .4em 1.1em;
    border-radius: 999px;
    transition: background .25s, color .25s;
}
.dish-order:hover { background: var(--saffron); color: #fff; }

/* ---------- Prices (PriceTagManager output) ---------- */
.dish-prices { display: flex; flex-wrap: wrap; gap: .3rem .9rem; }
.size-price {
    display: inline-flex;
    align-items: baseline;
    gap: .35rem;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--saffron-600);
    font-size: 1.05rem;
    white-space: nowrap;
}
.size-price em {
    font-family: var(--font-body);
    font-style: normal;
    font-weight: 700;
    font-size: .78rem;
    color: var(--muted);
}
.size-price.single { font-size: 1.3rem; }

/* ---------- Menu page: category chips + sections (app.js MenuPage) ---------- */
#api-menu-tabs {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    scrollbar-width: none;
}
#api-menu-tabs::-webkit-scrollbar { display: none; }
.cat-chip {
    flex: none;
    text-decoration: none;
    border: 1.5px solid var(--sand-2);
    background: var(--cream);
    color: var(--ink);
    font-weight: 700;
    font-size: .9rem;
    padding: .55rem 1.15rem;
    border-radius: 999px;
    transition: background-color .2s, color .2s, border-color .2s;
}
.cat-chip:hover { border-color: var(--forest); }
.cat-chip.active { background: var(--forest); color: #fff; border-color: var(--forest); }

.menu-section { padding: clamp(2.5rem, 5vw, 4.5rem) 0; }
.menu-section:nth-of-type(even) { background: var(--sand); }
.menu-section > * { width: min(100% - 2.5rem, 1100px); margin-inline: auto; }
.menu-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 2px solid var(--forest);
    padding-bottom: .8rem;
    margin-bottom: .4rem;
}
.menu-section-head h2 { color: var(--forest); font-size: clamp(1.9rem, 4vw, 2.7rem); }
.menu-section-count {
    font-weight: 800;
    font-size: .76rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--saffron-600);
    white-space: nowrap;
}
.dish-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 clamp(2rem, 5vw, 5rem);
}
.dish-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem 0;
    border-bottom: 1px dashed rgba(11, 58, 23, .22);
}
.dish-thumb {
    width: 84px; height: 84px;
    flex: none;
    border-radius: 14px;
    overflow: hidden;
    background: var(--sand-2);
}
.dish-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dish-info { flex: 1; min-width: 0; }
.dish-info h3 {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.08rem;
    color: var(--ink);
    line-height: 1.3;
    letter-spacing: 0;
}
.dish-info p {
    margin: .3rem 0 0;
    color: var(--muted);
    font-size: .93rem;
    line-height: 1.5;
}
.dish-options { font-size: .85rem; }
.dish-row .dish-prices {
    flex-direction: column;
    align-items: flex-end;
    gap: .15rem;
    text-align: right;
}
.dish-row .size-price { justify-content: flex-end; }

@media (max-width: 760px) {
    .dish-list { grid-template-columns: 1fr; }
    .dish-row { padding: 1rem 0; }
    .dish-thumb { width: 64px; height: 64px; }
    .size-price.single { font-size: 1.15rem; }
}
