/**
 * Safir — professional mobile polish (320px → tablet)
 * Load after responsive.css on all pages.
 */

/* ===== Foundation ===== */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: clip;
  overflow-y: auto;
  min-height: 100%;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  html,
  body {
    overscroll-behavior-y: auto;
    touch-action: pan-y pinch-zoom;
  }
}

img,
video,
svg {
  max-width: 100%;
  height: auto;
}

/* Touch-friendly controls site-wide */
@media (max-width: 768px) {
  .btn,
  .nav-link,
  .lang-switcher-btn,
  .lang-switcher-option,
  .menu-toggle,
  .about-promo-nav,
  .about-promo-option,
  .scroll-top-btn,
  .appstore-button,
  .playstore-button,
  .download-io-button,
  .service-box-link,
  .rep-form-submit {
    touch-action: manipulation;
  }

  .btn,
  .btn-sm,
  .btn-lg {
    min-height: 44px;
  }

  .menu-toggle {
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  .lang-switcher-btn {
    min-width: 58px;
    height: 38px;
    padding: 0 12px;
  }

  .lang-switcher-option {
    min-height: 44px;
    padding: 10px 14px;
  }
}

/* ===== Hero phones — mobile: no hover lift, lighter GPU ===== */
@media (max-width: 768px) {
  .hero-phones {
    transform: translateX(0);
    margin-inline: auto;
    height: min(420px, 48vh);
    min-height: 280px;
    gap: 10px;
    perspective: none;
    transform-style: flat;
    contain: layout style;
  }

  html[dir="ltr"] .hero-phones {
    transform: translateX(0);
  }

  .hero-phone {
    will-change: auto;
    transition: opacity 0.28s ease, width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .hero-phone-img--tilt {
    width: min(168px, 40vw);
    max-height: 420px;
    transition: opacity 0.28s ease;
  }

  .hero-phone--exchange,
  .hero-phone--exchange:hover,
  .hero-phone--exchange:focus-visible {
    z-index: 1;
    transform: rotate(-5deg) scale(0.86);
  }

  .hero-phone--home,
  .hero-phone--home:hover,
  .hero-phone--home:focus-visible {
    z-index: 2;
    transform: translateY(-4px) rotate(4deg) scale(0.92);
  }

  .hero-phones:has(.hero-phone:hover) .hero-phone:not(:hover),
  .hero-phones:has(.hero-phone:focus-visible) .hero-phone:not(:focus-visible) {
    opacity: 1;
  }

  .hero-phones:has(.hero-phone--exchange:hover) .hero-phone--home,
  .hero-phones:has(.hero-phone--exchange:focus-visible) .hero-phone--home,
  .hero-phones:has(.hero-phone--home:hover) .hero-phone--exchange,
  .hero-phones:has(.hero-phone--home:focus-visible) .hero-phone--exchange {
    opacity: 1;
  }

  .hero-phones:has(.hero-phone--exchange:hover) .hero-phone--home,
  .hero-phones:has(.hero-phone--exchange:focus-visible) .hero-phone--home {
    transform: translateY(-4px) rotate(4deg) scale(0.92);
  }

  .hero-phones:has(.hero-phone--home:hover) .hero-phone--exchange,
  .hero-phones:has(.hero-phone--home:focus-visible) .hero-phone--exchange {
    transform: rotate(-5deg) scale(0.86);
  }

  .hero-phone:hover .hero-phone-img--tilt,
  .hero-phone:focus-visible .hero-phone-img--tilt {
    animation-play-state: paused;
    filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.22));
  }
}

/* ===== Hero stats — phones only (desktop offsets stay in style.css) ===== */
@media (max-width: 768px) {
  html.lang-fa .hero-stats--en,
  html.lang-ar .hero-stats--en,
  html.lang-en .hero-stats--en {
    transform: none;
    translate: none;
  }

  .hero-stats--en {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    align-self: stretch;
    padding: 12px 8px;
    box-sizing: border-box;
    justify-content: space-between;
    gap: 0;
  }

  .hero-stats--en .stat {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    padding: 0 4px;
  }

  .hero-stats--en .stat-num {
    font-size: clamp(0.86rem, 4vw, 1rem);
    overflow: visible;
    text-overflow: unset;
    max-width: 100%;
  }

  .hero-stats--en .stat-label {
    font-size: clamp(0.54rem, 2.8vw, 0.62rem);
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
    max-width: 100%;
  }

  .hero-stats--en .stat-divider {
    flex: 0 0 1px;
    width: 1px;
    height: 24px;
    align-self: center;
    opacity: 0.22;
  }
}

/* ===== About services — tap/hover feedback on mobile ===== */
@media (max-width: 768px) {
  .about-service-item {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
  }

  .about-service-item:hover,
  .about-service-item:active,
  .about-service-item:focus-visible,
  .about-service-item.is-pressed {
    transform: none;
    border-color: rgba(234, 179, 8, 0.28);
    background: rgba(254, 249, 195, 0.3);
    box-shadow: none;
  }
}

/* ===== About promo packages ===== */
@media (max-width: 768px) {
  .about-promo-wrap {
    margin-top: 6px;
  }

  .about-promo-head {
    margin-bottom: 10px;
  }

  .about-promo-head-title {
    font-size: 1.15rem;
  }

  .about-promo-head-desc {
    font-size: 0.8rem;
  }

  .about-promo-carousel-viewport {
    container-type: inline-size;
    container-name: promo-viewport;
    width: 100%;
    padding: 14px 0 16px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-snap-stop: always;
    scroll-padding-inline: 0;
    touch-action: pan-x pan-y;
  }

  .about-promo-carousel-track {
    gap: 0;
    padding-inline: 0;
    width: max-content;
  }

  .about-promo-nav {
    width: 42px;
    height: 42px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .about-promo-nav--prev {
    inset-inline-start: 6px;
    left: auto;
    right: auto;
  }

  .about-promo-nav--next {
    inset-inline-end: 6px;
    left: auto;
    right: auto;
  }

  html[dir="rtl"] .about-promo-nav--prev {
    right: 6px;
    left: auto;
  }

  html[dir="rtl"] .about-promo-nav--next {
    left: 6px;
    right: auto;
  }

  html[dir="ltr"] .about-promo-nav--prev {
    left: 6px;
    right: auto;
  }

  html[dir="ltr"] .about-promo-nav--next {
    right: 6px;
    left: auto;
  }

  .about-promo-nav-icon {
    width: 20px;
    height: 20px;
  }

  .about-promo-card {
    flex: 0 0 100cqi;
    width: 100cqi;
    min-width: 100cqi;
    max-width: 100cqi;
    padding-inline: 12px;
    box-sizing: border-box;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .about-promo-card-shell {
    height: min(360px, 68vh);
  }

  .about-promo-card-body {
    gap: 6px;
    padding: 10px 10px 12px;
  }

  .about-promo-city-box {
    padding: 7px 10px;
  }

  .about-promo-card-title {
    font-size: 0.88rem;
    line-height: 1.35;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .about-promo-summary {
    font-size: 0.72rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .about-promo-options {
    gap: 6px;
  }

  .about-promo-option {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
  }

  .about-promo-option-label {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.68rem;
    text-align: start;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .about-promo-option-info {
    flex: 1 1 auto;
    min-width: 0;
    gap: 1px;
  }

  .about-promo-option-stars {
    font-size: 0.56rem;
    letter-spacing: 0.4px;
  }

  .about-promo-option-price {
    flex-shrink: 0;
    font-size: 0.64rem;
    text-align: end;
    white-space: nowrap;
  }

  .about-promo-head-title,
  .about-promo-head-desc {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

}

/* ===== Tablet portrait — hero board & cards ===== */
@media (max-width: 768px) {
  .hero-bottom-row {
    margin-top: calc(28px + var(--hero-flag-rise, 46px));
    grid-template-columns: 1fr;
    margin-left: max(-16px, calc(-1 * env(safe-area-inset-left)));
    margin-right: max(-16px, calc(-1 * env(safe-area-inset-right)));
    padding-top: var(--hero-spacer-h, 52px);
    overflow: visible;
  }

  .hero-bottom-row.hero-board--mobile-top {
    padding-top: var(--hero-spacer-h, 52px);
  }

  .hero-bottom-row::after {
    display: none;
  }

  .hero-board-skyline {
    width: min(500px, 94%);
  }

  .hero-bottom-flags {
    z-index: 3;
    overflow: visible;
  }

  .hero-flags-group {
    gap: 14px;
    max-width: none;
  }

  .hero-flags-group--left,
  .hero-flags-group--right {
    max-width: none;
  }

  .hero-bottom-spacer {
    height: var(--hero-spacer-h, 52px);
  }

  .hero-payment-badges {
    gap: var(--hero-m-badge-gap, 4px);
    z-index: 10;
    align-items: center;
  }

  .hero-payment-badge {
    width: var(--hero-m-badge-w, 48px);
    height: var(--hero-m-badge-h, 52px);
    min-height: 0;
    flex: 0 0 var(--hero-m-badge-w, 48px);
    padding: 3px 2px;
    gap: 2px;
    border-radius: 9px;
    justify-content: center;
    overflow: hidden;
  }

  .hero-payment-badge > img {
    height: 17px;
    max-width: calc(var(--hero-m-badge-w, 48px) - 8px);
    flex-shrink: 0;
  }

  .hero-payment-badge--visa > img {
    height: 13px;
    max-width: calc(var(--hero-m-badge-w, 48px) - 10px);
  }

  .hero-payment-badge--zain > img {
    height: 13px;
    max-width: calc(var(--hero-m-badge-w, 48px) - 6px);
  }

  .hero-payment-badge--zain .hero-payment-badge-name {
    color: var(--dark);
  }

  .hero-payment-badge-name {
    font-size: 0.4rem;
    line-height: 1.05;
    word-break: break-word;
    max-height: 2.15em;
    overflow: hidden;
  }

  .hero-payment-badge-name--stacked {
    max-height: 2.3em;
    gap: 0;
  }

  .hero-payment-badge-name-fa {
    font-size: 0.38rem;
    line-height: 1.05;
  }

  .hero-payment-badge-name-en {
    font-size: 0.34rem;
    line-height: 1.05;
  }

  .hero-board--mobile-badges .hero-bottom-spacer {
    min-width: 0;
    z-index: 8;
  }

  .hero-flag {
    filter: drop-shadow(0 2px 8px rgba(15, 23, 42, 0.12));
  }

  .hero-flag-img {
    height: var(--flag-height, 56px) !important;
  }

  .hero-bottom-box--a,
  .hero-bottom-box--b {
    grid-column: 1;
    border-radius: 0;
  }

  .hero-bottom-box {
    min-height: 104px;
    backdrop-filter: blur(10px) saturate(1.15);
    -webkit-backdrop-filter: blur(10px) saturate(1.15);
  }

  .hero-bottom-box--a {
    border-left: none;
    border-bottom: 1px solid rgba(234, 179, 8, 0.16);
    border-top: none;
  }

  .hero-flights-inner {
    padding: 5px 0 5px;
  }

  .hero-flights-head--split {
    padding: 0 10px 4px;
  }

  .hero-flights-title-wrap {
    gap: 6px;
  }

  .hero-flights-live {
    width: 6px;
    height: 6px;
  }

  .hero-flights-title {
    font-size: 0.74rem;
    line-height: 1.25;
  }

  .hero-flights-status {
    font-size: 0.62rem;
    padding: 1px 6px;
  }

  .hero-flights-track-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 10px;
    scrollbar-width: none;
    touch-action: pan-x;
  }

  .hero-flights-track-wrap::-webkit-scrollbar {
    display: none;
  }

  .hero-flights-track-wrap:has(.is-mobile-marquee) {
    overflow: hidden;
    scroll-snap-type: none;
    touch-action: pan-y pinch-zoom;
  }

  .hero-flights-track.is-mobile-marquee {
    gap: 7px;
    padding: 5px 10px 7px;
    width: max-content;
    flex-wrap: nowrap;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
  }

  .hero-flights-track.is-mobile-marquee.is-animating--to-center,
  .hero-flights-track.is-mobile-marquee.is-animating--from-left {
    animation: none !important;
  }

  .hero-flight-card--mobile,
  .hero-hotel-card--mobile {
    flex-shrink: 0;
    scroll-snap-align: unset;
  }

  .hero-flight-card--mobile {
    min-width: min(178px, 70vw);
    max-width: min(220px, 74vw);
    min-height: 46px;
    padding: 5px 9px;
    gap: 6px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(234, 179, 8, 0.28);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.08);
  }

  .hero-flight-card--mobile .hero-flight-logo {
    width: 26px;
    height: 26px;
    border-radius: 6px;
  }

  .hero-flight-card--mobile .hero-flight-route {
    font-size: 0.68rem;
    font-weight: 800;
    gap: 4px;
  }

  .hero-flight-card--mobile .hero-flight-airline {
    font-size: 0.58rem;
    margin-top: 1px;
    max-width: 96px;
  }

  .hero-flight-card--mobile .hero-flight-time {
    font-size: 0.66rem;
  }

  .hero-flight-card--mobile .hero-flight-price {
    font-size: 0.7rem;
  }

  .hero-flight-card--mobile .hero-flight-price small {
    font-size: 0.58rem;
  }

  .hero-hotel-card--mobile {
    min-width: min(184px, 72vw);
    max-width: min(228px, 76vw);
    min-height: 46px;
    padding: 5px 9px;
    gap: 8px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(234, 179, 8, 0.28);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.08);
  }

  .hero-hotel-card--mobile .hero-hotel-name {
    font-size: 0.66rem;
    max-width: 100%;
  }

  .hero-hotel-card--mobile .hero-hotel-meta {
    gap: 5px;
    margin-top: 2px;
  }

  .hero-hotel-card--mobile .hero-hotel-city {
    font-size: 0.58rem;
    padding: 0 5px;
  }

  .hero-hotel-card--mobile .hero-hotel-stars {
    font-size: 0.6rem;
    letter-spacing: 0.5px;
  }

  .hero-hotel-card--mobile .hero-hotel-nights {
    font-size: 0.56rem;
  }

  .hero-hotel-card--mobile .hero-hotel-price {
    font-size: 0.72rem;
  }

  .hero-bottom-box--a .hero-flights-track-wrap:has(.is-mobile-marquee),
  .hero-bottom-box--b .hero-flights-track-wrap:has(.is-mobile-marquee) {
    mask-image: linear-gradient(to right, transparent 0%, #000 6%, #000 94%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 6%, #000 94%, transparent 100%);
  }

  .hero-flights-track {
    flex-wrap: nowrap;
    width: max-content;
    padding: 5px 10px 7px;
    gap: 7px;
  }

  .hero-flights-track.is-animating--to-center:not(.is-mobile-marquee),
  .hero-flights-track.is-animating--from-left:not(.is-mobile-marquee) {
    animation: none !important;
    transform: none !important;
  }

  .hero-bottom-box--a .hero-flights-track-wrap,
  .hero-bottom-box--b .hero-flights-track-wrap {
    mask-image: linear-gradient(to left, transparent 0%, #000 3%, #000 97%, transparent 100%);
    -webkit-mask-image: linear-gradient(to left, transparent 0%, #000 3%, #000 97%, transparent 100%);
  }

  .hero-flight-card,
  .hero-hotel-card {
    scroll-snap-align: start;
    flex-shrink: 0;
  }
}

@media (max-width: 640px) {
  .hero-bottom-row {
    grid-template-columns: 1fr;
    margin-left: max(-16px, calc(-1 * env(safe-area-inset-left)));
    margin-right: max(-16px, calc(-1 * env(safe-area-inset-right)));
  }

  .hero-hotel-card {
    min-width: min(184px, 72vw);
    max-width: min(228px, 76vw);
  }

  .hero-flight-card {
    min-width: min(178px, 70vw);
    max-width: min(220px, 74vw);
  }
}

/* ===== Standard phones (≤430px) ===== */
@media (max-width: 430px) {
  .hero-payment-badge > img {
    height: 15px;
  }

  .hero-payment-badge--visa > img {
    height: 12px;
  }

  .hero-payment-badge-name {
    font-size: 0.37rem;
  }

  .hero-payment-badge-name-fa {
    font-size: 0.36rem;
  }

  .hero-payment-badge-name-en {
    font-size: 0.32rem;
  }

  .hero-flags-group {
    gap: 12px;
  }

  .hero-flag-img {
    height: var(--flag-height, 48px) !important;
  }

  .container {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }

  .hero {
    padding-top: max(88px, calc(72px + env(safe-area-inset-top)));
  }

  .hero-route {
    z-index: 1;
    display: block;
  }

  .hero-content {
    position: relative;
    z-index: 2;
  }

  .hero-visual,
  .hero-phones {
    position: relative;
    z-index: 3;
  }

  .hero-phone {
    z-index: 3;
  }

  .hero-title {
    font-size: clamp(1.45rem, 7.5vw, 1.85rem);
    line-height: 1.35;
  }

  .hero-desc {
    font-size: 0.92rem;
    line-height: 1.75;
    max-width: 34ch;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    margin-inline: auto;
  }

  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-stats--en {
    padding: 10px 6px;
  }

  .hero-stats--en .stat {
    padding: 0 2px;
  }

  .hero-stats--en .stat-num {
    font-size: clamp(0.8rem, 4.5vw, 0.92rem);
  }

  .hero-stats--en .stat-label {
    font-size: clamp(0.5rem, 2.9vw, 0.58rem);
    line-height: 1.3;
  }

  .hero-stats--en .stat-divider {
    height: 22px;
  }

  .hero-phone-img--tilt {
    width: min(150px, 38vw);
    max-height: 400px;
  }

  .hero-phones {
    transform: translateX(0);
    margin-inline: auto;
    height: min(380px, 44vh);
  }

  html[dir="ltr"] .hero-phones {
    transform: translateX(0);
  }

  .hero-hotel-card,
  .hero-flight-card {
    min-width: min(168px, 68vw);
    max-width: 74vw;
  }

  .hero-hotel-name,
  .hero-flight-route {
    font-size: 0.66rem;
  }

  .section-title {
    font-size: clamp(1.35rem, 5.5vw, 1.65rem);
  }

  .section-desc {
    font-size: 0.88rem;
    line-height: 1.7;
  }

  /* Currency — single column rates */
  .currency-rates,
  .currency-rates--3 {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .currency-converter {
    padding: 14px 12px;
  }

  .converter-result {
    padding: 10px 8px;
  }

  .result-value {
    font-size: clamp(1.2rem, 7vw, 1.55rem);
  }

  /* Download */
  .download-buttons {
    width: 100%;
    max-width: min(100%, 340px);
  }

  .download-buttons .appstore-button,
  .download-buttons .playstore-button,
  .download-buttons .download-io-button {
    min-height: 48px;
    padding: 10px 14px;
  }

  .appstore-button-bottom {
    font-size: 1.1rem;
  }

  .appstore-button-top {
    font-size: 0.65rem;
  }

  .download-text h2 {
    font-size: clamp(1.35rem, 5.5vw, 1.6rem);
  }

  /* Motion logo — iPhone/Safari: MP4 without visible background box */
  .download-visual.is-bg-keyed {
    background: transparent;
    isolation: isolate;
  }

  .download-app-video.is-bg-keyed {
    background: transparent;
    border-radius: 0;
    mix-blend-mode: multiply;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.1));
  }

  /* Representatives */
  .rep-card-name {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.35;
  }

  .rep-card-meta {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.4;
  }

  .rep-card-btn {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 0.78rem;
    flex: 1;
    min-width: calc(50% - 4px);
  }

  .rep-card-actions {
    width: 100%;
    gap: 8px;
  }

  .rep-grid {
    max-height: min(55vh, 400px);
  }

  .rep-form-field input {
    min-height: 48px;
    font-size: max(16px, 0.9rem);
  }

  .phone-input-wrap {
    min-width: 0;
  }

  .ticket-field .phone-input-wrap {
    width: 100%;
  }

  .ticket-field input.phone-input {
    padding-block: 0;
    padding-inline-end: 12px;
  }

  /* Feature boxes — readable back text */
  .service-box-back-panel {
    padding: 10px 8px 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
  }

  .service-box-desc {
    font-size: 0.72rem;
    line-height: 1.55;
    max-width: 100%;
    overflow-y: auto;
  }

  .service-box-back-panel h3 {
    font-size: 0.82rem;
  }

  .service-box-back-panel .service-box-link--back {
    min-height: 40px;
    margin-top: auto;
    flex-shrink: 0;
  }

  /* Top bars (ticket / admin) */
  .page-top-bar,
  .admin-top-bar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .ticket-back-site,
  .admin-back {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 56px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ===== Small phones (≤360px) ===== */
@media (max-width: 360px) {
  .hero-payment-badge {
    border-radius: 8px;
    padding: 2px 1px;
  }

  .hero-payment-badge > img {
    height: 13px;
  }

  .hero-payment-badge--visa > img {
    height: 11px;
  }

  .hero-payment-badge-name {
    font-size: 0.34rem;
    max-height: 1.9em;
  }

  .hero-payment-badge-name-fa {
    font-size: 0.33rem;
  }

  .hero-payment-badge-name-en {
    font-size: 0.3rem;
  }

  .hero-bottom-row {
    --hero-spacer-h: 44px;
  }

  .hero-title {
    font-size: 1.4rem;
  }

  .features-grid--app {
    gap: 6px;
  }

  .about-services {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .about-service-item {
    font-size: 0.62rem;
    padding: 8px 4px;
  }

  .about-service-icon {
    width: 26px;
    height: 26px;
  }

  .header-actions .btn-sm {
    padding: 8px 10px;
    font-size: 0.72rem;
  }

  .rep-card-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.7rem;
  }
}

/* ===== Ticket page ===== */
@media (max-width: 768px) {
  .ticket-page {
    padding-top: max(80px, calc(64px + env(safe-area-inset-top)));
    padding-bottom: max(32px, env(safe-area-inset-bottom));
  }

  .ticket-wrap {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .ticket-sidebar,
  .ticket-main {
    border-radius: 14px;
  }

  .ticket-list-btn {
    min-height: 48px;
    padding: 12px 14px;
    text-align: start;
  }

  .ticket-field input,
  .ticket-field textarea,
  .ticket-chat-foot input[type="text"] {
    min-height: 48px;
    font-size: max(16px, 0.9rem);
  }

  .ticket-attach-btn,
  .ticket-chat-foot .btn {
    min-height: 44px;
    min-width: 44px;
  }

  .ticket-chat-body {
    max-height: min(52vh, 340px);
  }

  .ticket-bubble {
    max-width: 92%;
    font-size: 0.82rem;
  }
}

@media (max-width: 430px) {
  .ticket-layout {
    gap: 14px;
  }

  .ticket-head {
    margin-bottom: 20px;
  }

  .ticket-head h1 {
    font-size: 1.35rem;
  }

  .ticket-chat-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .ticket-chat-foot input[type="text"] {
    flex: 1 1 auto;
    width: 100%;
    order: 1;
  }

  .ticket-chat-foot .ticket-attach-btn,
  .ticket-chat-foot .btn-primary {
    order: 2;
    flex: 1;
    min-width: 0;
  }

  .ticket-chat-foot-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    order: 2;
  }

  .ticket-file-label {
    order: 3;
    text-align: center;
  }

  .ticket-sidebar {
    padding: 14px;
  }

  .ticket-main {
    min-height: min(70vh, 480px);
  }
}

/* ===== Admin pages ===== */
@media (max-width: 768px) {
  .admin-page {
    padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  .admin-wrap,
  .admin-wrap--wide {
    max-width: 100%;
  }

  .admin-card {
    padding: 22px 18px;
    border-radius: 14px;
  }

  .admin-header h1 {
    font-size: clamp(1.2rem, 5vw, 1.45rem);
  }

  .admin-field input {
    min-height: 48px;
    font-size: max(16px, 1rem);
  }

  .admin-list-actions .btn,
  .admin-actions .btn {
    min-height: 44px;
  }

  .admin-list-item {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-list-actions {
    width: 100%;
  }

  .admin-list-actions .btn {
    flex: 1;
    min-width: calc(50% - 4px);
  }
}

@media (max-width: 480px) {
  .admin-rate-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .admin-rate-row .rate-label {
    justify-content: flex-start;
  }

  .admin-rate-row input {
    width: 100%;
    min-height: 48px;
    font-size: max(16px, 1rem);
  }

  .admin-actions {
    flex-direction: column;
  }

  .admin-actions .btn {
    width: 100%;
    min-width: 0;
  }
}

/* Admin ticket panel */
.admin-ticket-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 16px;
}

.admin-ticket-list {
  max-height: 520px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}

.admin-ticket-chat {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-ticket-chat-body {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
}

.admin-ticket-chat-foot {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-ticket-chat-foot input[type="text"],
.admin-ticket-chat-foot select {
  flex: 1 1 140px;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: var(--font);
  font-size: max(16px, 0.86rem);
}

.admin-ticket-item {
  text-align: start;
  width: 100%;
  padding: 12px 14px;
  min-height: 48px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
  font-family: var(--font);
}

.admin-ticket-item.is-active,
.admin-ticket-item:hover {
  border-color: var(--primary);
  background: rgba(234, 179, 8, 0.1);
}

.admin-ticket-item strong {
  display: block;
  font-size: 0.84rem;
}

.admin-ticket-item small {
  display: block;
  margin-top: 3px;
  font-size: 0.72rem;
  color: var(--gray-light);
}

.admin-badge-new {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 999px;
  margin-inline-end: 6px;
}

.admin-file-label {
  font-size: 0.72rem;
  color: var(--gray-light);
  flex: 1 1 100%;
  word-break: break-word;
}

@media (max-width: 800px) {
  .admin-ticket-layout {
    grid-template-columns: 1fr;
  }

  .admin-ticket-list {
    max-height: min(40vh, 280px);
  }
}

@media (max-width: 430px) {
  .admin-ticket-chat {
    min-height: min(65vh, 420px);
  }

  .admin-ticket-chat-body {
    max-height: min(45vh, 280px);
  }

  .admin-ticket-chat-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-ticket-chat-foot input[type="text"],
  .admin-ticket-chat-foot select {
    flex: 1 1 auto;
    width: 100%;
  }

  .admin-ticket-chat-foot .btn {
    flex: 1;
    min-height: 44px;
  }

  .admin-ticket-chat-foot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }
}

/* Landscape phones — reduce vertical waste */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding-top: max(72px, calc(56px + env(safe-area-inset-top)));
  }

  .ticket-chat-body,
  .admin-ticket-chat-body {
    max-height: 40vh;
  }
}

/* ===== Hero news notification — hidden on phone only ===== */
@media (max-width: 768px) {
  .hero-news-stack {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }
}
