/**
 * ==============================================================================
 * Saha Mobile Luxury Components — World-Class Mobile Experience v4.0
 * (Booking.com, Airbnb, Stripe Level Polish)
 * ==============================================================================
 */

/* ──────────────────────────────────────────────────────────────────────────────
   1. FLOATING STICKY BOOKING BAR (شريط الحجز الذكي العائم للجوال)
   ────────────────────────────────────────────────────────────────────────────── */
.ota-sticky-booking-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-fixed, 1030);
  background: var(--glass-bg, rgba(255, 255, 255, 0.94));
  backdrop-filter: var(--glass-blur, blur(16px));
  -webkit-backdrop-filter: var(--glass-blur, blur(16px));
  border-top: 1px solid var(--surface-border, #e2e8f0);
  box-shadow: 0 -8px 24px -4px rgba(15, 23, 42, 0.1);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  transition: transform var(--duration-normal, 240ms) var(--ease-out, ease), opacity var(--duration-normal, 240ms) ease;
  will-change: transform;
}

[data-theme="dark"] .ota-sticky-booking-bar {
  background: var(--glass-bg, rgba(17, 24, 39, 0.94));
  border-top-color: var(--surface-border, #1f293d);
  box-shadow: 0 -8px 28px -4px rgba(0, 0, 0, 0.45);
}

.ota-sticky-booking-bar.is-hidden {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}

.ota-sbb-container {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ota-sbb-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.ota-sbb-room-name {
  font-size: var(--font-xs, 0.75rem);
  font-weight: var(--weight-bold, 700);
  color: var(--text-primary, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ota-sbb-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.ota-sbb-price-amount {
  font-size: var(--font-lg, 1.25rem);
  font-weight: var(--weight-black, 900);
  color: var(--color-primary, #ff8c00);
  letter-spacing: -0.02em;
  line-height: 1.1;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.ota-sbb-price-currency {
  font-size: var(--font-xs, 0.75rem);
  font-weight: var(--weight-bold, 700);
  color: var(--text-secondary, #475569);
}

.ota-sbb-meta {
  font-size: var(--font-3xs, 0.65rem);
  color: var(--text-tertiary, #94a3b8);
  display: flex;
  align-items: center;
  gap: 4px;
}

.ota-sbb-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--color-primary-400, #fca01f) 0%, var(--color-primary-500, #ff8c00) 50%, var(--color-primary-600, #e07000) 100%);
  color: #ffffff !important;
  font-size: var(--font-sm, 0.875rem);
  font-weight: var(--weight-bold, 700);
  border-radius: var(--radius-xl, 20px);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(255, 140, 0, 0.35);
  transition: transform var(--duration-fast, 150ms) ease, box-shadow var(--duration-fast, 150ms) ease;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.ota-sbb-cta-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: none;
  animation: ota-shimmer-sweep 3s infinite ease-in-out;
}

.ota-sbb-cta-btn:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(255, 140, 0, 0.25);
}

.ota-sbb-cta-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

[dir="rtl"] .ota-sbb-cta-btn:hover svg {
  transform: translateX(-3px);
}

[dir="ltr"] .ota-sbb-cta-btn:hover svg {
  transform: translateX(3px);
}

/* ──────────────────────────────────────────────────────────────────────────────
   2. MODERN BOTTOM SHEET MODAL (نافذة الدرج المنزلق من الأسفل)
   ────────────────────────────────────────────────────────────────────────────── */
.ota-btn-glow {
  box-shadow: 0 4px 16px rgba(255, 140, 0, 0.45);
  animation: ota-pulse-glow 2.5s infinite;
}

@keyframes ota-pulse-glow {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(255, 140, 0, 0.4);
  }
  50% {
    box-shadow: 0 6px 22px rgba(255, 140, 0, 0.65);
  }
}

.ota-sbb-cta-btn i,
.ota-sbb-cta-btn svg {
  font-size: 1.15rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

[dir="rtl"] .ota-sbb-cta-btn:hover i,
[dir="rtl"] .ota-sbb-cta-btn:hover svg {
  transform: translateX(-3px);
}

[dir="ltr"] .ota-sbb-cta-btn:hover i,
[dir="ltr"] .ota-sbb-cta-btn:hover svg {
  transform: translateX(3px);
}

/* Bottom Sheet Modal Wrapper */
.ota-bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 1080);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  visibility: hidden;
  transition: visibility var(--duration-normal, 240ms);
}

.ota-bottom-sheet.active {
  pointer-events: auto;
  visibility: visible;
}

/* Backdrop */
.ota-sheet-backdrop,
.ota-bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: var(--glass-blur, blur(8px));
  -webkit-backdrop-filter: var(--glass-blur, blur(8px));
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal, 240ms) var(--ease-out, ease);
}

.ota-bottom-sheet.active .ota-sheet-backdrop,
.ota-bottom-sheet-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Drawer Container */
.ota-sheet-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface-card, #ffffff);
  border-top-left-radius: var(--radius-2xl, 28px);
  border-top-right-radius: var(--radius-2xl, 28px);
  border-top: 1px solid var(--surface-border-subtle, #f1f5f9);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  transform: translateY(100%);
  transition: transform var(--duration-slow, 380ms) var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
  will-change: transform;
  overflow: hidden;
}

[data-theme="dark"] .ota-sheet-container {
  background: var(--surface-card, #111827);
  border-top-color: var(--surface-border, #1f293d);
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.6);
}

.ota-bottom-sheet.active .ota-sheet-container {
  transform: translateY(0);
}

/* Drag Handle */
.ota-sheet-handle-bar,
.ota-sheet-drag-handle {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 0 6px;
  cursor: grab;
}

.ota-sheet-handle,
.ota-sheet-drag-bar {
  width: 44px;
  height: 5px;
  border-radius: var(--radius-full, 9999px);
  background: var(--gray-300, #cbd5e1);
  transition: background 0.2s ease;
}

[data-theme="dark"] .ota-sheet-handle,
[data-theme="dark"] .ota-sheet-drag-bar {
  background: var(--gray-700, #334155);
}

/* Sheet Header */
.ota-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 14px;
  border-bottom: 1px solid var(--surface-border, #e2e8f0);
}

[data-theme="dark"] .ota-sheet-header {
  border-bottom-color: var(--surface-border, #1f293d);
}

.ota-sheet-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ota-sheet-title {
  font-size: var(--font-md, 1.125rem);
  font-weight: var(--weight-bold, 700);
  color: var(--text-primary, #0f172a);
  margin: 0;
}

.ota-sheet-subtitle {
  font-size: var(--font-xs, 0.75rem);
  color: var(--text-secondary, #475569);
  margin: 0;
}

.ota-sheet-close,
.ota-sheet-close-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full, 9999px);
  background: var(--gray-100, #f1f5f9);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  transition: all 0.2s ease;
}

[data-theme="dark"] .ota-sheet-close,
[data-theme="dark"] .ota-sheet-close-btn {
  background: var(--gray-800, #1e293b);
  color: var(--text-secondary, #94a3b8);
}

.ota-sheet-close:hover,
.ota-sheet-close-btn:hover {
  background: var(--gray-200, #e2e8f0);
  color: var(--text-primary, #0f172a);
}

/* Sheet Scrollable Body */
.ota-sheet-body {
  padding: 18px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

/* Sheet Sticky Actions Footer */
.ota-sheet-footer {
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--surface-border, #e2e8f0);
  background: var(--surface-card, #ffffff);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

[data-theme="dark"] .ota-sheet-footer {
  background: var(--surface-card, #111827);
  border-top-color: var(--surface-border, #1f293d);
}

/* Room Detail Bottom Sheet Interior Elements */
.ota-sheet-room-hero {
  position: relative;
  width: 100%;
  height: 190px;
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--gray-200, #e2e8f0);
}

.ota-sheet-room-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ota-sheet-room-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  border-radius: 20px;
  font-size: var(--font-xs, 0.75rem);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ota-sheet-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.ota-sheet-spec-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md, 12px);
  background: var(--surface-card-subtle, #f8fafc);
  border: 1px solid var(--surface-border-subtle, #f1f5f9);
  font-size: var(--font-xs, 0.75rem);
  color: var(--text-primary, #0f172a);
}

[data-theme="dark"] .ota-sheet-spec-card {
  background: #172033;
  border-color: var(--surface-border, #1f293d);
  color: var(--text-primary, #f8fafc);
}

.ota-sheet-spec-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-primary-soft, rgba(255, 140, 0, 0.12));
  color: var(--color-primary, #ff8c00);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.ota-sheet-section-title {
  font-size: var(--font-sm, 0.875rem);
  font-weight: var(--weight-bold, 700);
  color: var(--text-primary, #0f172a);
  margin: 14px 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ota-sheet-amenities-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.ota-sheet-amenity-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full, 9999px);
  background: var(--gray-100, #f1f5f9);
  color: var(--text-secondary, #475569);
  font-size: var(--font-xs, 0.75rem);
  font-weight: 600;
  border: 1px solid var(--surface-border-subtle, #e2e8f0);
}

[data-theme="dark"] .ota-sheet-amenity-chip {
  background: var(--gray-800, #1e293b);
  border-color: var(--surface-border, #1f293d);
  color: var(--text-secondary, #94a3b8);
}

.ota-sheet-amenity-chip i,
.ota-sheet-amenity-chip svg {
  color: var(--color-primary, #ff8c00);
}

.ota-sheet-policy-box {
  padding: 12px 14px;
  border-radius: var(--radius-md, 12px);
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--font-xs, 0.75rem);
  line-height: 1.5;
}

.ota-sheet-policy-box.is-refundable {
  background: var(--color-success-50, #ecfdf5);
  border: 1px solid var(--color-success-border, rgba(16, 185, 129, 0.3));
  color: var(--color-success-700, #047857);
}

[data-theme="dark"] .ota-sheet-policy-box.is-refundable {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
}

.ota-sheet-policy-box.is-non-refundable {
  background: var(--color-danger-50, #fef2f2);
  border: 1px solid var(--color-danger-border, rgba(239, 68, 68, 0.3));
  color: var(--color-danger-700, #b91c1c);
}

[data-theme="dark"] .ota-sheet-policy-box.is-non-refundable {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

.ota-sheet-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--gray-50, #f8fafc);
  border-radius: var(--radius-md, 12px);
  margin-bottom: 16px;
  border: 1px solid var(--surface-border-subtle, #e2e8f0);
}

[data-theme="dark"] .ota-sheet-price-row {
  background: #172033;
  border-color: var(--surface-border, #1f293d);
}

.ota-sheet-action-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  margin-top: 8px;
  border-top: 1px solid var(--surface-border, #e2e8f0);
}

[data-theme="dark"] .ota-sheet-action-footer {
  border-top-color: var(--surface-border, #1f293d);
}

/* ──────────────────────────────────────────────────────────────────────────────
   3. SHIMMER SKELETON LOADERS (Zero CLS = 0 Loaders)
   ────────────────────────────────────────────────────────────────────────────── */
@keyframes ota-skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes ota-shimmer-sweep {
  0% {
    left: -100%;
  }
  20%, 100% {
    left: 200%;
  }
}

.ota-skeleton-box,
.ota-skeleton-line,
.ota-skeleton-pill-placeholder {
  background: linear-gradient(
    90deg,
    var(--gray-200, #e2e8f0) 25%,
    var(--gray-100, #f8fafc) 50%,
    var(--gray-200, #e2e8f0) 75%
  );
  background-size: 200% 100%;
  animation: ota-skeleton-shimmer 1.5s infinite linear;
  border-radius: var(--radius-sm, 8px);
}

[data-theme="dark"] .ota-skeleton-box,
[data-theme="dark"] .ota-skeleton-line,
[data-theme="dark"] .ota-skeleton-pill-placeholder {
  background: linear-gradient(
    90deg,
    var(--gray-800, #1e293b) 25%,
    var(--gray-700, #334155) 50%,
    var(--gray-800, #1e293b) 75%
  );
  background-size: 200% 100%;
}

/* Zero-CLS Hotel Card Placeholder Container */
.ota-skeleton-hotel-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-card, #ffffff);
  border: 1px solid var(--surface-border, #e2e8f0);
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  box-shadow: var(--box-shadow-sm);
  contain: content; /* Containment to prevent browser layout recalcs */
  min-height: 380px;
}

[data-theme="dark"] .ota-skeleton-hotel-card {
  background: var(--surface-card, #111827);
  border-color: var(--surface-border, #1f293d);
}

.ota-skeleton-hotel-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 220px;
  position: relative;
}

.ota-skeleton-hotel-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

/* Zero-CLS Room Table Row Placeholder */
.ota-skeleton-room-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-card, #ffffff);
  border: 1px solid var(--surface-border, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  padding: 16px;
  gap: 12px;
  margin-bottom: 12px;
}

[data-theme="dark"] .ota-skeleton-room-card {
  background: var(--surface-card, #111827);
  border-color: var(--surface-border, #1f293d);
}

/* ──────────────────────────────────────────────────────────────────────────────
   4. FILTER PILLS & QUICK CHIPS (شريط الفلاتر السريعة الكبسولية)
   ────────────────────────────────────────────────────────────────────────────── */
.ota-filter-pills,
.ota-filter-pills-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 2px 10px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.ota-filter-pills::-webkit-scrollbar,
.ota-filter-pills-row::-webkit-scrollbar {
  display: none;
}

.ota-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full, 9999px);
  background: var(--surface-card, #ffffff);
  border: 1.5px solid var(--surface-border, #e2e8f0);
  color: var(--text-secondary, #475569);
  font-size: var(--font-xs, 0.75rem);
  font-weight: var(--weight-semibold, 600);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--duration-fast, 150ms) var(--ease-out, ease);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--box-shadow-2xs);
}

[data-theme="dark"] .ota-filter-pill {
  background: var(--surface-card, #111827);
  border-color: var(--surface-border, #1f293d);
  color: var(--text-secondary, #94a3b8);
}

.ota-filter-pill:hover {
  border-color: var(--color-primary-300, #fdbb4d);
  color: var(--text-primary, #0f172a);
}

[data-theme="dark"] .ota-filter-pill:hover {
  color: var(--text-primary, #f8fafc);
  border-color: var(--color-primary-600, #e07000);
}

.ota-filter-pill:active {
  transform: scale(0.96);
}

.ota-filter-pill.active {
  background: var(--color-navy, #0f2942);
  color: #ffffff !important;
  border-color: var(--color-navy, #0f2942);
  box-shadow: 0 4px 12px rgba(15, 41, 66, 0.25);
}

[data-theme="dark"] .ota-filter-pill.active {
  background: var(--color-primary, #ff8c00);
  border-color: var(--color-primary, #ff8c00);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(255, 140, 0, 0.35);
}

.ota-filter-pill .ota-pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full, 9999px);
  background: var(--gray-100, #f1f5f9);
  color: var(--text-secondary, #475569);
  font-size: var(--font-3xs, 0.625rem);
  font-weight: var(--weight-bold, 700);
}

.ota-filter-pill.active .ota-pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

[data-theme="dark"] .ota-filter-pill .ota-pill-count {
  background: var(--gray-800, #1e293b);
  color: var(--text-secondary, #94a3b8);
}

.ota-filter-pill .ota-pill-check {
  display: none;
  font-size: 0.85em;
}

.ota-filter-pill.active .ota-pill-check {
  display: inline-block;
}

/* ──────────────────────────────────────────────────────────────────────────────
   5. CANCELLATION & AMENITY LUXURY BADGES (شارة الإلغاء والخدمات المجانية)
   ────────────────────────────────────────────────────────────────────────────── */
.ota-badge-free-cancellation {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-sm, 8px);
  background: var(--color-success-50, #ecfdf5);
  color: var(--color-success-700, #047857);
  font-size: var(--font-xs, 0.75rem);
  font-weight: var(--weight-bold, 700);
  border: 1px solid var(--color-success-border, rgba(16, 185, 129, 0.3));
}

[data-theme="dark"] .ota-badge-free-cancellation {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.ota-badge-amenity {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm, 8px);
  background: var(--gray-100, #f1f5f9);
  color: var(--text-secondary, #475569);
  font-size: var(--font-2xs, 0.6875rem);
  font-weight: var(--weight-semibold, 600);
  border: 1px solid var(--surface-border-subtle, #e2e8f0);
}

[data-theme="dark"] .ota-badge-amenity {
  background: var(--gray-800, #1e293b);
  color: var(--text-secondary, #94a3b8);
  border-color: var(--surface-border, #1f293d);
}

.ota-badge-amenity svg,
.ota-badge-amenity i {
  color: var(--color-primary, #ff8c00);
  font-size: 1.05em;
}
