/* SIPO API Dynamic Component Styles */
:root {
    --primary: #E8430A;
    --red: #ef4444;
    --green: #22c55e;
    --gold: #e5b96a;
    --white: #ffffff;
    --radius-sm: 8px;
    --radius-md: 16px;
}

/* Base Modal */
.sipo-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}
.sipo-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.sipo-modal {
    background: #16213e;
    color: white;
    padding: 2.5rem;
    border-radius: 24px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    position: relative;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.sipo-modal-overlay.active .sipo-modal {
    transform: translateY(0);
}
.sipo-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.6;
}
.sipo-modal-close:hover { opacity: 1; }
.sipo-modal-icon { margin-bottom: 1.5rem; }
.sipo-modal-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; color: white; }
.sipo-modal-text { font-size: 1rem; color: rgba(255, 255, 255, 0.8); margin-bottom: 2rem; line-height: 1.6; }
.sipo-modal-btn { width: 100%; }

/* Special Offer Modal Styles */
.offer-modal { border: 2px solid var(--gold); }
.offer-modal .sipo-modal-title { color: var(--gold); }

/* Popular Items Grid Integration */
.popular-items .items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.item-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.item-card-img {
    height: 200px;
    position: relative;
    overflow: hidden;
}
.item-card-img img { width: 100%; height: 100%; object-fit: cover; }
.item-card-img .badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
}
.item-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.item-card-body h3 { font-size: 1.2rem; margin-bottom: 10px; color: #16213e; }
.item-card-body p { font-size: 0.9rem; color: #666; margin-bottom: 15px; }

/* Ordering Disabled State */
body.ordering-disabled .nav-order-btn,
body.ordering-disabled .floating-order-btn,
body.ordering-disabled .btn-primary {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(0.5);
}

.footer-hours-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.footer-hours-list .hours-list-item {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.hours-list-item .day,
.hours-row .day {
    font-weight: 700;
}

.hours-list-item.today .day,
.hours-row.today .day {
    color: var(--gold);
}

.hours-list-item .time,
.hours-row .time {
    text-align: right;
}

[data-branch-hours-table] .hours-row {
    display: grid;
    grid-template-columns: minmax(135px, 1fr) minmax(170px, 1.25fr);
    gap: 24px;
    justify-content: stretch;
    align-items: start;
}

.menu-preview-grid,
.api-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.menu-preview .menu-preview-grid {
    width: min(1080px, 100%);
    margin: 44px auto 40px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
}

.menu-page-shell {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.api-menu-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 28px;
}

.menu-tab {
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    background: #f4d59f;
    color: #7b2d12;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.menu-tab.active,
.menu-tab:hover {
    background: #e1262c;
    color: #ffffff;
    transform: translateY(-1px);
}

.menu-loading,
.gallery-empty {
    text-align: center;
    color: rgba(17, 17, 17, 0.7);
    margin: 0 0 24px;
}

.menu-card {
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 16px 35px rgba(17, 17, 17, 0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.menu-preview .menu-card {
    min-height: 330px;
    border-radius: 18px;
    box-shadow: 0 14px 30px rgba(17, 17, 17, 0.08);
}

.menu-card-img {
    position: relative;
    min-height: 220px;
    background: linear-gradient(135deg, rgba(225, 38, 44, 0.1), rgba(255, 213, 26, 0.12));
}

.menu-card-img img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.menu-preview .menu-card-img,
.menu-preview .menu-card-placeholder {
    min-height: 150px;
}

.menu-preview .menu-card-img img {
    height: 150px;
    object-fit: contain;
    padding: 16px;
}

.menu-card-placeholder {
    min-height: 220px;
}

.menu-card-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(113, 53, 28, 0.9);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
}

.menu-card-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.menu-preview .menu-card-body {
    padding: 18px 20px 20px;
    text-align: left;
}

.menu-card-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.menu-card h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #7b2d12;
}

.menu-preview .menu-card h3 {
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.15;
}

.menu-card p {
    margin: 0;
    color: rgba(17, 17, 17, 0.72);
    line-height: 1.55;
}

.menu-preview .menu-card p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 14px;
    line-height: 1.35;
}

.menu-card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.menu-card .price {
    white-space: nowrap;
    font-weight: 800;
    color: #e1262c;
}

.menu-card .order-link {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    background: #e1262c;
    color: #ffffff;
    font-weight: 700;
}

@media (max-width: 760px) {
    .menu-preview .menu-preview-grid,
    .menu-preview-grid,
    .api-menu-grid {
        width: min(100%, 340px);
        grid-template-columns: 1fr;
        gap: 28px;
        margin-left: auto;
        margin-right: auto;
    }

    .menu-preview .menu-card,
    .menu-card {
        width: 100%;
        min-width: 0;
    }

    .menu-card-heading,
    .menu-card-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .menu-card .order-link {
        width: 100%;
    }

    [data-branch-hours-table] .hours-row {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .hours-row .time {
        text-align: left;
    }
}

.gallery-card {
    margin: 0;
    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 14px 32px rgba(17, 17, 17, 0.08);
    background: #ffffff;
}

.gallery-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

/* ---- Branch switcher (menu page) ---- */
.api-branch-tabs {
    display: inline-flex;
    gap: 6px;
    padding: 6px;
    margin: 0 0 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.branch-tab {
    border: 0;
    border-radius: 999px;
    padding: 10px 22px;
    background: transparent;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.branch-tab:hover {
    background: rgba(255, 255, 255, 0.16);
}

.branch-tab.active {
    background: #ffd51a;
    color: #7b2d12;
}

/* ---- Order branch picker ---- */
.branch-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(17, 17, 17, 0.7);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.branch-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

body.branch-modal-open {
    overflow: hidden;
}

.branch-modal {
    position: relative;
    width: min(520px, 100%);
    padding: 34px 28px 28px;
    border-radius: 24px;
    background: #f6f6e9;
    color: #111111;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    transform: translateY(16px);
    transition: transform 0.3s ease;
}

.branch-modal-overlay.active .branch-modal {
    transform: translateY(0);
}

.branch-modal h2 {
    margin: 0 0 6px;
    color: #e1262c;
    font-family: "Brush Script MT", "Segoe Script", cursive;
    font-size: 44px;
    font-weight: 400;
    line-height: 1;
}

.branch-modal-sub {
    margin: 0 0 22px;
    color: #555;
}

.branch-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    border: 0;
    background: transparent;
    color: #111111;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.55;
}

.branch-modal-close:hover {
    opacity: 1;
}

.branch-modal-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.branch-option {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 16px;
    border: 2px solid rgba(225, 38, 44, 0.2);
    border-radius: 18px;
    background: #ffffff;
    color: #111111;
    text-align: left;
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.branch-option:hover,
.branch-option:focus-visible {
    border-color: #e1262c;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(225, 38, 44, 0.15);
    outline: none;
}

.branch-option-name {
    font-size: 20px;
    font-weight: 700;
}

.branch-option-address {
    flex: 1;
    font-size: 14px;
    line-height: 1.35;
    color: #555;
}

.branch-option-cta {
    margin-top: 6px;
    color: #e1262c;
    font-weight: 700;
    font-size: 14px;
}

@media (max-width: 520px) {
    .branch-modal-list {
        grid-template-columns: 1fr;
    }
}
