:root {
    --bs-brand: #111827;
    --bs-accent: #d4a24e;
    --brand-primary: var(--bs-brand);
    --brand-accent: var(--bs-accent);
}

html {
    height: 100%;
}

body {
    min-height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main {
    flex: 1 0 auto;
    padding-bottom: 3rem;
}

.bs-navbar {
    background: var(--bs-brand);
    /* Keep the navbar (and its account dropdown) above other sticky elements
       like the booking card, which otherwise share z-index 1020 and cover it. */
    z-index: 1030;
}

.bs-navbar .navbar-brand {
    color: var(--bs-accent) !important;
    white-space: nowrap;
}

.bs-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, .35);
    padding: .4rem .55rem;
}
.bs-navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 .2rem rgba(212, 162, 78, .35);
}

.bs-navbar .btn-accent,
.bs-nav-offcanvas .btn-accent {
    background: var(--bs-accent);
    border-color: var(--bs-accent);
    color: #111;
    font-weight: 600;
}
.bs-navbar .btn-accent:hover,
.bs-navbar .btn-accent:focus,
.bs-nav-offcanvas .btn-accent:hover,
.bs-nav-offcanvas .btn-accent:focus {
    background: #e0b56a;
    border-color: #e0b56a;
    color: #111;
}

.bs-nav-offcanvas .text-accent { color: var(--bs-accent); }

.bs-nav-icon-link,
.bs-nav-cta,
.bs-nav-account {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.bs-lang-dropdown .dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
}

/* Mobile / tablet offcanvas: taller tap targets, stacked actions */
@media (max-width: 1199.98px) {
    .bs-nav-offcanvas {
        width: min(20rem, 88vw);
        color: #fff;
        background: var(--bs-brand) !important;
    }
    .bs-nav-offcanvas .navbar-nav .nav-link {
        color: rgba(255, 255, 255, .85);
    }
    .bs-nav-offcanvas .navbar-nav .nav-link:hover,
    .bs-nav-offcanvas .navbar-nav .nav-link:focus {
        color: #fff;
    }
    .bs-nav-offcanvas .offcanvas-body {
        padding-top: .75rem;
        gap: .35rem;
        height: 100%;
    }
    .bs-nav-offcanvas .navbar-nav {
        width: 100%;
    }
    .bs-nav-offcanvas .offcanvas-body > .navbar-nav:last-child {
        margin-top: auto;
    }
    .bs-nav-offcanvas .nav-link {
        padding: .7rem .85rem;
        border-radius: .375rem;
        font-size: 1.05rem;
    }
    .bs-nav-offcanvas .nav-link:hover,
    .bs-nav-offcanvas .nav-link:focus {
        background: rgba(255, 255, 255, .08);
    }
    .bs-nav-offcanvas .dropdown-menu {
        position: static !important;
        transform: none !important;
        background: rgba(0, 0, 0, .25);
        border: 0;
        border-radius: .375rem;
        margin: .25rem 0 .5rem;
        padding: .35rem;
    }
    .bs-nav-offcanvas .dropdown-item {
        color: #e5e7eb;
        border-radius: .25rem;
        padding: .55rem .75rem;
    }
    .bs-nav-offcanvas .dropdown-item:hover,
    .bs-nav-offcanvas .dropdown-item:focus {
        background: rgba(255, 255, 255, .1);
        color: #fff;
    }
    .bs-nav-offcanvas .dropdown-divider {
        border-color: rgba(255, 255, 255, .15);
    }
    .bs-nav-offcanvas .bs-nav-cta {
        display: flex;
        width: 100%;
        justify-content: center;
        align-items: center;
        margin: .35rem 0;
        padding: .55rem .75rem;
        white-space: nowrap;
    }
    .bs-nav-offcanvas .bs-nav-lang {
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, .12);
    }
    .bs-nav-offcanvas .bs-nav-lang .btn-group {
        width: 100%;
        display: flex;
    }
    .bs-nav-offcanvas .bs-nav-lang .btn {
        flex: 1 1 25%;
        padding: .45rem .35rem;
    }
}

/* Desktop inline navbar: single-line labels, tighter chrome */
@media (min-width: 1200px) {
    .navbar.bs-navbar .bs-nav-offcanvas.offcanvas {
        position: static;
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
        z-index: auto;
        display: flex;
        flex-direction: row;
        flex-grow: 1;
        width: auto !important;
        height: auto !important;
        max-width: none;
        visibility: visible !important;
        background: transparent !important;
        border: 0 !important;
        transform: none !important;
        transition: none;
    }
    .navbar.bs-navbar .bs-nav-offcanvas .offcanvas-body {
        display: flex;
        flex-direction: row;
        align-items: center;
        flex-grow: 1;
        padding: 0;
        overflow: visible;
        min-width: 0;
    }
    .bs-navbar .navbar-nav .nav-link {
        white-space: nowrap;
        padding: .5rem .65rem;
        font-size: .925rem;
    }
    .bs-navbar .bs-nav-actions {
        flex-wrap: nowrap;
        flex-shrink: 0;
    }
    .bs-navbar .bs-nav-cta {
        margin-inline-start: .25rem;
        white-space: nowrap;
    }
    .bs-navbar .bs-nav-lang {
        margin-inline-start: .35rem;
        flex-shrink: 0;
    }
    .bs-navbar .bs-nav-account {
        max-width: 9.5rem;
    }
    .bs-navbar .bs-nav-account-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 7.5rem;
    }
    /* Icon-first: drop verbose CTA text on the top bar */
    .bs-navbar .bs-nav-cta .bs-nav-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .bs-navbar .bs-lang-dropdown .dropdown-menu {
        min-width: 4.5rem;
    }
}

.bs-footer {
    flex-shrink: 0;
    margin-top: auto;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.hero {
    background: linear-gradient(135deg, #111827 0%, #1f2937 60%, #374151 100%);
    color: #fff;
    padding: 4rem 0;
}

.hero h1 { font-weight: 700; }

.hero-search {
    display: flex;
    align-items: stretch;
    gap: .5rem;
    max-width: 42rem;
    background: #fff;
    border-radius: 999px;
    padding: .35rem .35rem .35rem .85rem;
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .2);
}
.hero-search .form-control {
    border: 0;
    box-shadow: none;
    background: transparent;
    color: #111827;
    padding: .65rem .25rem;
}
.hero-search .form-control:focus {
    box-shadow: none;
}
.hero-search .btn {
    border-radius: 999px;
    white-space: nowrap;
    padding-inline: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.search-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: .5rem;
}
.search-toolbar .form-control {
    flex: 1 1 14rem;
    min-width: 0;
}
.search-toolbar .btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    white-space: nowrap;
}

.search-layout .search-map-wrap {
    position: sticky;
    top: 5rem;
}
#search-map {
    height: calc(100vh - 12rem);
    min-height: 280px;
    border-radius: .5rem;
}

.service-suggestions {
    z-index: 20;
    display: none;
    max-height: 220px;
    overflow: auto;
}

.shop-card-cover {
    height: 160px;
    object-fit: cover;
}
.shop-card-footer {
    z-index: 2;
}

.shop-card { transition: transform .15s ease, box-shadow .15s ease; }
.shop-card:hover { transform: translateY(-3px); box-shadow: 0 .5rem 1rem rgba(0,0,0,.1); }

.rating-stars { color: var(--bs-accent); }

.shop-logo-wrap {
    width: 100%;
    text-align: center;
}
.shop-logo-wrap .shop-logo {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    margin-inline: auto;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    color: inherit;
    background: #f1f3f5;
    text-decoration: none;
    font-size: 1rem;
}
.social-link:hover {
    background: #212529;
    color: #fff;
}

.shop-reviews-toggle .shop-reviews-chevron {
    transition: transform .15s ease;
}
.shop-reviews-toggle:not(.collapsed) .shop-reviews-chevron {
    transform: rotate(90deg);
}

/* Shop location map: blocked by default until the user taps the overlay */
.shop-map-wrap {
    position: relative;
    overflow: hidden;
}
.shop-map {
    height: 280px;
}
.shop-map-overlay {
    position: absolute;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    padding: 0;
    background: rgba(33, 37, 41, .18);
    cursor: pointer;
    transition: background .15s ease;
}
.shop-map-overlay:hover {
    background: rgba(33, 37, 41, .28);
}
.shop-map-overlay-label {
    background: rgba(255, 255, 255, .95);
    color: #212529;
    border-radius: 2rem;
    padding: .4rem .9rem;
    font-size: .875rem;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}

/* Customer appointments page */
.appt-page .appt-stats .appt-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .1rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: .75rem;
    padding: .85rem .5rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    height: 100%;
    transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.appt-page .appt-stats .appt-stat:hover {
    border-color: #ced4da;
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 .35rem .9rem rgba(17, 24, 39, .06);
}
.appt-page .appt-stat-icon {
    font-size: 1rem;
    color: #9aa2ad;
    line-height: 1;
}
.appt-page .appt-stat-active {
    border-color: var(--bs-brand);
    background: #fff;
}
.appt-page .appt-stat-active .appt-stat-icon { color: var(--bs-brand); }
.appt-page .appt-stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--bs-brand);
}
.appt-page .appt-stat-label {
    font-size: .75rem;
    color: #6c757d;
}
.appt-page .appt-stat-warn {
    background: #fff8e6;
    border-color: #f0d78c;
}
.appt-page .appt-stat-warn .appt-stat-num { color: #a06a00; }
.appt-page .appt-stat-warn .appt-stat-icon { color: #c98a1a; }

.appt-page .appt-filter .btn { display: inline-flex; align-items: center; gap: .3rem; }

.appt-page .appt-card {
    border: 1px solid #e9ecef;
    border-radius: .85rem;
    box-shadow: 0 .125rem .5rem rgba(17, 24, 39, .04);
    transition: transform .15s ease, box-shadow .15s ease;
}
.appt-page .appt-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1.25rem rgba(17, 24, 39, .09);
}
.appt-page .appt-card-due {
    border-color: #f0d78c;
    box-shadow: 0 0 0 1px rgba(212, 162, 78, .15);
}

/* Calendar-style date chip */
.appt-page .appt-datechip {
    flex: 0 0 auto;
    width: 3.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: .35rem .25rem .4rem;
    border-radius: .65rem;
    background: #f4f5f7;
    border: 1px solid #e9ecef;
    line-height: 1;
}
.appt-page .appt-datechip-dow {
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .03em;
    color: #8a919c;
}
.appt-page .appt-datechip-day {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bs-brand);
    margin-top: .05rem;
}
.appt-page .appt-datechip-mon {
    font-size: .68rem;
    font-weight: 600;
    color: #6c757d;
}
.appt-page .appt-datechip-soon {
    background: var(--bs-brand);
    border-color: var(--bs-brand);
}
.appt-page .appt-datechip-soon .appt-datechip-dow,
.appt-page .appt-datechip-soon .appt-datechip-mon { color: rgba(255, 255, 255, .7); }
.appt-page .appt-datechip-soon .appt-datechip-day { color: #fff; }

.appt-page .appt-shop-link {
    display: inline-block;
    max-width: 100%;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
}
.appt-page .appt-shop-link:hover { color: var(--bs-accent); }
.appt-page .appt-time { color: #4b5563; font-size: .875rem; }

.appt-page .appt-rel {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .15rem .55rem;
    border-radius: 2rem;
    background: #f0f1f3;
    color: #5a6270;
    font-weight: 600;
}
.appt-page .appt-rel-soon {
    background: rgba(212, 162, 78, .16);
    color: #97671a;
}
.appt-page .min-w-0 { min-width: 0; }

.appt-page .badge.bg-paid {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #c8e6c9;
}

.slot-btn { min-width: 84px; }
.slot-btn-taken {
    text-decoration: line-through;
    opacity: .55;
    cursor: not-allowed;
}

/* Booking date strip */
.date-strip-wrap {
    display: flex;
    align-items: stretch;
    gap: .35rem;
}
.date-strip {
    display: flex;
    gap: .35rem;
    flex: 1;
    min-width: 0;
}
.date-strip-nav {
    flex: 0 0 2.25rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.date-tile {
    flex: 1 1 0;
    min-width: 0;
    padding: .4rem .15rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.15;
    gap: .1rem;
}
.date-tile .date-tile-dow {
    font-size: .68rem;
    text-transform: capitalize;
    opacity: .75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.date-tile .date-tile-day {
    font-size: 1.15rem;
    font-weight: 700;
}
.date-tile .date-tile-cap {
    font-size: .62rem;
    text-transform: capitalize;
    opacity: .8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.date-tile.active .date-tile-dow,
.date-tile.active .date-tile-cap { opacity: .9; }
.date-calendar-anchor {
    position: relative;
    display: inline-flex;
}
.date-calendar-face {
    pointer-events: none;
}
.date-strip-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    border: 0;
    padding: 0;
    margin: 0;
}
.date-calendar-anchor:focus-within .date-calendar-face {
    border-color: #212529;
    box-shadow: 0 0 0 .2rem rgba(33, 37, 41, .15);
}

#map { height: 460px; border-radius: .5rem; }

@media (max-width: 991.98px) {
    .search-layout .search-map-wrap { position: static; }
    #search-map { height: 240px; min-height: 0; }
}

.featured-badge {
    background: var(--bs-accent);
    color: #111;
    font-weight: 600;
}

.map-pin-featured {
    background: none !important;
    border: none !important;
}
.map-pin-featured-body {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: var(--bs-accent, #d4a24e);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}
.map-pin-featured-body i {
    transform: rotate(45deg);
    color: #111;
    font-size: 14px;
    line-height: 1;
}

/* Floating chat widget */
.bs-app-install-fab {
    position: fixed; bottom: 20px; left: 20px; z-index: 1050;
    border-radius: 999px; box-shadow: 0 .5rem 1rem rgba(0,0,0,.2);
}
html[dir="rtl"] .bs-app-install-fab { left: auto; right: 20px; }
@media (max-width: 767.98px) {
    .bs-app-install-fab { bottom: 16px; left: 16px; }
    html[dir="rtl"] .bs-app-install-fab { left: auto; right: 16px; }
}
#chat-launcher {
    position: fixed; bottom: 20px; right: 20px; z-index: 1050;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--bs-accent); color: #111; border: none;
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.2); font-size: 1.4rem;
}
#chat-panel {
    position: fixed; bottom: 88px; right: 20px; z-index: 1050;
    width: 340px; max-width: 92vw; height: 460px; max-height: 70vh;
    background: #fff; border-radius: .75rem; box-shadow: 0 1rem 2rem rgba(0,0,0,.25);
    display: none; flex-direction: column; overflow: hidden;
}
#chat-panel.open { display: flex; }
#chat-header { background: var(--bs-brand); color: #fff; padding: .75rem 1rem; font-weight: 600; }
#chat-messages { flex: 1; overflow-y: auto; padding: .75rem; background: #f8f9fa; }
.chat-msg { margin-bottom: .5rem; padding: .5rem .75rem; border-radius: .5rem; max-width: 85%; }
.chat-msg.user { background: var(--bs-accent); margin-left: auto; }
.chat-msg.assistant { background: #fff; border: 1px solid #e9ecef; }
#chat-form { display: flex; border-top: 1px solid #e9ecef; }
#chat-input { flex: 1; border: none; padding: .6rem .75rem; }
#chat-input:focus { outline: none; }

/* Persian (RTL) tweaks for custom chrome */
html[dir="rtl"] #chat-launcher { right: auto; left: 20px; }
html[dir="rtl"] #chat-panel { right: auto; left: 20px; }
@media (max-width: 767.98px) {
    html[dir="rtl"] #chat-panel { left: 12px; right: 12px; }
    html[dir="rtl"] #chat-launcher { left: 16px; right: auto; }
}
html[dir="rtl"] .chat-msg.user { margin-left: 0; margin-right: auto; }
html[dir="rtl"] #chat-header > .bi { margin-inline-end: .4rem; }
html[dir="rtl"] .appt-page .badge { unicode-bidi: isolate; }
html[dir="rtl"] .appt-page .btn .bi + span { margin-inline-start: .15rem; }

/* User guides */
.guide-page .text-accent-label { color: #9a6b16; letter-spacing: .06em; }
.guide-hero-img {
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: cover;
    border-radius: 1rem;
    box-shadow: 0 12px 32px rgba(17, 24, 39, .12);
}
.guide-card { overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.guide-card:hover { transform: translateY(-3px); box-shadow: 0 .5rem 1.25rem rgba(0,0,0,.1); }
.guide-card .card-img-top { height: 180px; object-fit: cover; }
.guide-roles .nav-link {
    color: #374151;
    background: #fff;
    border: 1px solid #e5e7eb;
}
.guide-roles .nav-link.active {
    background: #111827;
    border-color: #111827;
    color: #d4a24e;
}
.guide-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    margin-inline-end: .4rem;
    border-radius: 50%;
    background: #111827;
    color: #d4a24e;
    font-size: .85rem;
    font-weight: 700;
    vertical-align: middle;
}
.guide-tip, .guide-warn {
    border-radius: .65rem;
    padding: .75rem 1rem;
    margin-top: .75rem;
}
.guide-tip { background: #fff7e8; border-inline-start: 4px solid #d4a24e; }
.guide-warn { background: #fef2f2; border-inline-start: 4px solid #dc2626; }
.guide-toc .badge { font-weight: 500; color: #374151; text-decoration: none; }
.guide-toc .badge:hover { background: #fff7e8; border-color: #d4a24e !important; }

/* Mobile refinements */
@media (max-width: 767.98px) {
    .hero { padding: 2.25rem 0; }
    .hero h1 { font-size: 1.75rem; }
    .hero-search { max-width: none; }

    #map { height: 300px; }

    .search-toolbar .btn > span:not(.badge) { display: none; }
    .search-toolbar .btn .bi { margin: 0; }

    /* Wide tables scroll horizontally instead of overflowing the viewport */
    main table.table {
        display: block;
        width: 100%;
        min-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Keep the floating chat panel within the viewport */
    #chat-panel {
        right: 12px; left: 12px; bottom: 84px;
        width: auto; max-width: none; height: 70vh;
    }
    #chat-launcher { bottom: 16px; right: 16px; }
}
