/* ============ متغیرها ============ */
:root {
    --bg:            #f5f5f3;
    --card-bg:       #ffffff;
    --text:          #1a1a1a;
    --muted:         #6b6b6b;
    --border:        #ececec;
    --accent:        #c9a227;
    --accent-dark:   #a8861a;
    --accent-soft:   #fdf6e3;
    --danger:        #c0392b;
    --info:          #2c6ba7;
    --radius:        16px;
    --shadow:        0 2px 14px rgba(0,0,0,.06);
    --app-max:       480px;
}

/* ============ ریست ============ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: var(--text);
    background: #ebeae6;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a   { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ============ قالب موبایل ============ */
.app {
    max-width: var(--app-max);
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    box-shadow: 0 0 40px rgba(0,0,0,.06);
}

/* ============ هدر ============ */
.app-header {
    background: #fff;
    padding: 18px 18px 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.app-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -.3px;
}

.app-subtitle {
    font-size: .92rem;
    color: var(--muted);
    margin-top: 4px;
}

/* دکمه بازگشت */
.back-link {
    display: inline-block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--accent-dark);
    margin-bottom: 8px;
}

/* ============ لیست ============ */
.hotel-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 14px 40px;
}

/* ============ کارت ============ */
.hotel-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .2s ease, box-shadow .2s ease;
    position: relative;
}
.hotel-card:active {
    transform: scale(.995);
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
}

/* کاور */
.card-cover {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #eee;
    overflow: hidden;
}
.card-cover img {
    width: 100%; height: 100%;
    object-fit: cover;
}

/* badge */
.badge {
    position: absolute;
    top: 12px;
    inset-inline-start: 12px;
    background: var(--accent);
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    box-shadow: 0 3px 10px rgba(0,0,0,.15);
    z-index: 2;
}
.badge-inline {
    position: static;
    display: inline-block;
    margin: 14px 18px 0;
    inset-inline-start: auto;
}

/* دکمه اشتراک */
.card-share {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    cursor: pointer;
    transition: transform .15s ease;
    color: var(--text);
}
.card-share:active { transform: scale(.9); }

/* بدنه کارت */
.card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* اسم */
.hotel-name {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.6;
    padding-inline-start: 12px;
    border-inline-start: 3px solid var(--accent);
    word-break: break-word;
}

/* اطلاعات */
.info-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: .95rem;
    line-height: 1.7;
    color: #2a2a2a;
}

.info-row .info-icon {
    flex-shrink: 0;
    font-size: 1rem;
    line-height: 1.7;
}

.info-label {
    color: var(--muted);
    font-weight: 600;
    flex-shrink: 0;
}

.info-value { flex: 1; word-break: break-word; }

.info-extra .info-value {
    color: var(--muted);
    font-size: .9rem;
}

/* جداکننده */
.divider {
    height: 1px;
    background: var(--border);
    margin: 2px 0;
}

/* بلوک قیمت — وسط‌چین */
.price-block {
    background: var(--accent-soft);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    align-items: center;
}

.price-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.price-title {
    font-size: .88rem;
    font-weight: 600;
    color: var(--accent-dark);
}

.price-amount {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: -.3px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
}

.currency {
    font-size: .82rem;
    font-weight: 500;
    color: var(--muted);
}

/* حالت استعلام تلفنی */
.price-block.price-call {
    background: #f0f4f8;
    border: 1px dashed #8fa8bf;
}
.price-block.price-call .price-title {
    color: var(--info);
}
.price-amount-call {
    font-size: .88rem;
    font-weight: 600;
    color: #4a5c6e;
    margin-top: 2px;
}

/* فاصله */
.distance-row { padding: 4px 0; }

/* دکمه‌ها */
.actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 2px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    transition: background .18s ease, transform .1s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }

.btn-gallery { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(201,162,39,.3); }
.btn-gallery:active { background: var(--accent-dark); }

.btn-location { background: #f1f1f0; color: var(--text); }
.btn-location:active { background: #e5e5e3; }

.btn-booking { background: #2c7a4b; color: #fff; }
.btn-booking:active { background: #245f3b; }

.btn-phone { background: #f1f1f0; color: var(--text); }

/* ============ کارت غیرفعال ============ */
.hotel-card.inactive .card-cover,
.hotel-card.inactive .card-body {
    filter: grayscale(1) contrast(.9);
    opacity: .55;
}
.hotel-card.inactive .card-body { pointer-events: none; }
.hotel-card.inactive .actions { pointer-events: auto; }
.hotel-card.inactive .btn-booking { display: none; }

/* مهر ظرفیت تکمیل */
.hotel-card.inactive .stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-14deg);
    border: 4px double var(--danger);
    color: var(--danger);
    padding: 10px 26px;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 3px;
    border-radius: 10px;
    pointer-events: none;
    z-index: 5;
    background: rgba(255, 255, 255, .55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    box-shadow:
        0 0 24px rgba(192, 57, 43, .25),
        inset 0 0 0 2px rgba(192, 57, 43, .15);
    text-shadow: 1px 1px 0 rgba(255, 255, 255, .7);
    white-space: nowrap;
    animation: stampIn .4s ease-out;
}
@keyframes stampIn {
    from { transform: translate(-50%, -50%) rotate(-14deg) scale(1.8); opacity: 0; }
    to   { transform: translate(-50%, -50%) rotate(-14deg) scale(1);   opacity: 1; }
}

/* ============ لایت‌باکس ============ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.95);
    z-index: 999;
    display: none;
    flex-direction: column;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
    animation: lbFade .22s ease;
}
.lightbox.open { display: flex; }

@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }

.lb-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 0;
    overflow: hidden;
    touch-action: pan-y;
}

#lb-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    transition: transform .2s ease;
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
}

.lb-close,
.lb-prev,
.lb-next {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,.14);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 600;
    z-index: 3;
    transition: background .18s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    line-height: 1;
}
.lb-close:active,
.lb-prev:active,
.lb-next:active { background: rgba(255,255,255,.3); }

.lb-close { top: 16px; inset-inline-end: 16px; }
.lb-prev  { top: 50%; inset-inline-end: 8px;  transform: translateY(-50%); }
.lb-next  { top: 50%; inset-inline-start: 8px; transform: translateY(-50%); }

.lb-info {
    position: absolute;
    top: 16px;
    inset-inline-start: 16px;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 10px 14px;
    color: #fff;
    font-size: .82rem;
    line-height: 1.6;
    max-width: calc(100% - 90px);
    z-index: 2;
}

.lb-info-title { font-weight: 800; font-size: .95rem; margin-bottom: 3px; }
.lb-info-price { color: var(--accent); font-weight: 700; font-size: .88rem; }
.lb-info-distance { color: rgba(255,255,255,.85); font-size: .8rem; }

.lb-info-location {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 10px;
    background: rgba(201,162,39,.9);
    color: #fff;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 700;
}

.lb-counter {
    margin-top: 4px;
    color: rgba(255,255,255,.6);
    font-size: .75rem;
}

.lb-thumbs {
    display: flex;
    gap: 8px;
    padding: 12px 4px 4px;
    overflow-x: auto;
    scrollbar-width: none;
    justify-content: center;
    flex-shrink: 0;
}
.lb-thumbs::-webkit-scrollbar { display: none; }

.lb-thumbs img {
    width: 60px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: .5;
    border: 2px solid transparent;
    transition: all .18s ease;
    flex-shrink: 0;
}
.lb-thumbs img.active {
    opacity: 1;
    border-color: var(--accent);
    transform: scale(1.05);
}

/* ============ FAB سرچ ============ */
.search-fab {
    position: fixed;
    bottom: 20px;
    right: max(20px, calc(50% - 240px + 20px));
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(201,162,39,.45), 0 2px 6px rgba(0,0,0,.15);
    z-index: 90;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.search-fab:active {
    transform: scale(.92);
    box-shadow: 0 4px 12px rgba(201,162,39,.4);
}

/* ============ شیت سرچ ============ */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}
.search-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.search-sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    width: 100%;
    max-width: var(--app-max);
    background: #fff;
    border-radius: 22px 22px 0 0;
    z-index: 201;
    transform: translate(-50%, 100%);
    transition: transform .3s cubic-bezier(.22,.61,.36,1);
    box-shadow: 0 -8px 30px rgba(0,0,0,.15);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}
.search-sheet.open { transform: translate(-50%, 0); }

.search-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 12px;
    border-bottom: 1px solid var(--border);
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}

.search-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f1f1f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    cursor: pointer;
}

.search-body {
    padding: 16px 20px 8px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* بخش‌های شیت */
.search-section {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.search-section:last-of-type {
    border-bottom: none;
    margin-bottom: 12px;
    padding-bottom: 0;
}

.search-section-label {
    display: block;
    font-size: .85rem;
    font-weight: 700;
    color: #444;
    margin-bottom: 10px;
}

/* ============ تگ‌ها (داخل شیت) ============ */
/* ============ تگ‌ها (داخل شیت) ============ */
.tags-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
}

.tag-btn {
    flex: 0 0 auto;
    padding: 5px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 600;
    transition: all .18s ease;
    white-space: nowrap;
    cursor: pointer;
}
.tag-btn:active { transform: scale(.96); }
.tag-btn.active {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
}

/* ============ مرتب‌سازی (داخل شیت) ============ */
.sort-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sort-btn {
    flex: 0 0 auto;
    padding: 8px 16px;
    border-radius: 999px;
    background: #f1f1f0;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 600;
    transition: all .18s ease;
    white-space: nowrap;
    cursor: pointer;
    border: none;
}
.sort-btn:active { transform: scale(.96); }
.sort-btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(201,162,39,.35);
}

/* ============ فیلدهای سرچ ============ */
.search-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.search-field:last-child { margin-bottom: 0; }

.search-field label {
    font-size: .82rem;
    font-weight: 600;
    color: #444;
}
.search-field input[type=text],
.search-field input[type=number] {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    font-size: .95rem;
    background: #fafaf9;
    transition: border-color .15s ease, background .15s ease;
}
.search-field input:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
}

.search-range {
    display: flex;
    align-items: center;
    gap: 8px;
}
.search-range input { flex: 1; }
.search-range span {
    color: var(--muted);
    font-weight: 600;
}

.search-field.check {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    margin-bottom: 4px;
}
.search-field.check input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}
.search-field.check label {
    margin: 0;
    font-size: .92rem;
    font-weight: 500;
}

.search-actions {
    display: flex;
    gap: 10px;
    padding: 14px 20px calc(18px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.search-actions .btn {
    flex: 1;
    min-height: 46px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: .95rem;
}

/* حالت خالی */
.no-results {
    text-align: center;
    color: var(--muted);
    padding: 60px 20px;
    font-size: .95rem;
}

/* ============ ریسپانسیو ============ */
@media (max-width: 380px) {
    body { font-size: 16px; }
    .app-title { font-size: 1.2rem; }
    .hotel-name { font-size: 1.15rem; }
    .price-amount { font-size: 1.2rem; }
    .lb-thumbs img { width: 52px; height: 38px; }
    .lb-info { font-size: .78rem; padding: 8px 12px; }
    .hotel-card.inactive .stamp {
        font-size: 1.05rem;
        padding: 8px 18px;
        letter-spacing: 2px;
    }
    .search-fab {
        right: max(16px, calc(50% - 240px + 16px));
        bottom: 16px;
    }
}