/*
 * Phone polish + Android app (TWA) shell.
 * Loaded last (end of public-footer) so it wins over page styles of equal specificity.
 * - "Phones" rules apply to every visitor on a small screen.
 * - html.is-app rules apply only inside the Play Store app (see public-start.ejs).
 */

/* Search buttons show their text on wide screens and a magnifier on phones */
.gt-search-btn-icon { display: none; }

/* Price + "Book / Buy now" bar: only rendered on phones and tablets */
.app-sticky-cta { display: none; }

/* Bottom tab bar: only inside the app */
.app-tabbar { display: none; }

/* Purchase cards scrolled to by the sticky bar stay clear of the sticky header */
#gt-book,
#visa-buy,
#product-buy { scroll-margin-top: 84px; }

/* ───────────────────────── Phones ───────────────────────── */
@media (max-width: 767.98px) {
  /* Assistance button: compact round icon so it no longer covers content */
  .floating-whatsapp {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: 56px;
    height: 56px;
    min-height: 56px;
    padding: 0;
    gap: 0;
  }
  .floating-whatsapp > span:not(.floating-whatsapp-icon) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .floating-whatsapp-icon {
    width: auto;
    height: auto;
    background: none;
    border: 0;
    font-size: 1.4rem;
  }

  /* Footer: finger-sized links, readable headings */
  .site-footer ul.list-unstyled.d-grid { gap: 0 !important; }
  .site-footer ul.list-unstyled a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .site-footer h6 { font-size: .78rem !important; }

  /* Minimum 12px text */
  .hero-filter-label,
  .price-badge,
  .service-card-compact p,
  .gt-tour-category,
  .gt-tour-duration,
  .gt-td-itin-dot,
  .gt-td-itin-label,
  .gt-td-price-from,
  .country-tag,
  .about-small-button { font-size: .78rem !important; }

  /* Country / city tab bar: readable labels, swipe sideways when they do not fit */
  .gt-tab-bar {
    display: flex !important;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .gt-tab-bar::-webkit-scrollbar { display: none; }
  .gt-tab {
    flex: 1 0 auto;
    min-width: 84px;
    min-height: 60px;
    font-size: .78rem !important;
  }

  /* Small text links get a full-height touch area */
  .gt-back-link,
  .gt-view-all,
  .gt-detail-back,
  .savings-learn-btn,
  .auth-back-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .about-small-button,
  .gt-td-city-link,
  .reason-card a,
  .blog-back-link,
  .egh-catalogue__pagination,
  .document-subhead .btn-link { min-height: 44px; display: inline-flex; align-items: center; }
  .gt-td-breadcrumb a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }
  .about-person-copy p,
  .about-stack-copy p { font-size: .8rem !important; }

  /* Register form: bigger consent checkbox and links */
  .auth-register-form label.small { font-size: .875rem !important; line-height: 1.5; }
  .auth-register-form label.small a { display: inline-block; padding: 6px 0; }

  /* Visa key facts: 2 x 2 instead of four full-width cards */
  .visa-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .visa-metrics .metric-card { min-width: 0; overflow-wrap: anywhere; }

  /* Search modal tabs: one swipeable row instead of wrapping */
  .site-search-tabs {
    display: flex !important;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .site-search-tabs::-webkit-scrollbar { display: none; }
  .site-search-tabs > button {
    flex: 0 0 auto;
    min-height: 44px;
    padding-left: 14px;
    padding-right: 14px;
    white-space: nowrap;
  }

  /* Blog search */
  #blogSearch { min-height: 44px; font-size: 16px; }
  .blog-search-submit {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .btn-sm.btn-outline-dark { min-height: 40px; }

  /* Form fields: 44px high, 16px text (no zoom-in when focused) */
  .form-control:not(.form-control-sm),
  .form-select:not(.form-select-sm),
  .gt-filter-btn,
  .gt-td-form-group input,
  .gt-td-form-group select {
    min-height: 44px;
    font-size: 16px;
  }
  .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
  }
  .stepper-controls button {
    width: 40px;
    height: 40px;
  }

  /* Country / city hero search: full-width field, square magnifier button */
  .gt-city-search-bar,
  .gt-dest-search-bar { padding: .35rem .35rem .35rem 1rem; }
  .gt-city-search-bar > i,
  .gt-dest-search-bar > i { display: none; }
  .gt-city-search-bar input,
  .gt-dest-search-bar input {
    min-height: 44px;
    font-size: 16px;
  }
  .gt-city-search-bar button,
  .gt-dest-search-bar button {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .gt-city-search-bar button .gt-search-btn-label,
  .gt-dest-search-bar button .gt-search-btn-label { display: none; }
  .gt-city-search-bar button .gt-search-btn-icon,
  .gt-dest-search-bar button .gt-search-btn-icon {
    display: inline-block;
    margin: 0;
    color: #fff;
    font-size: 1.05rem;
  }
}

/* ─────────── Sticky "Book / Buy now" bar (phones + tablets) ─────────── */
@media (max-width: 991.98px) {
  .app-sticky-cta:not([hidden]) {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, .12);
    transition: transform .22s ease;
  }
  .app-sticky-cta.is-offscreen { transform: translateY(120%); }
  .app-sticky-cta__price { min-width: 0; line-height: 1.2; }
  .app-sticky-cta__price small {
    display: block;
    font-size: .78rem;
    color: #64748b;
  }
  .app-sticky-cta__price strong {
    display: block;
    font-size: 1.05rem;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .app-sticky-cta__btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 999px;
    background: var(--brand, #0f35f0);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
  }
  .app-sticky-cta__btn:hover,
  .app-sticky-cta__btn:focus { color: #fff; filter: brightness(1.08); }
  body.has-sticky-cta .floating-whatsapp { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  body.has-sticky-cta .site-footer { padding-bottom: 76px; }
}

/* ───────────────────────── Inside the app ───────────────────────── */
html.is-app { -webkit-tap-highlight-color: transparent; }

@media (max-width: 1199.98px) {
  html.is-app body { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }

  html.is-app .app-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1045;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, .06);
  }
  .app-tabbar a,
  .app-tabbar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 62px;
    padding: 6px 2px;
    border: 0;
    background: none;
    color: #64748b;
    font: inherit;
    font-size: .75rem;
    font-weight: 600;
    text-decoration: none;
    -webkit-user-select: none;
    user-select: none;
  }
  .app-tabbar i { font-size: 1.25rem; }
  .app-tabbar .is-active { color: var(--brand, #0f35f0); }
  .app-tabbar a:active,
  .app-tabbar button:active { background: #f1f5f9; }

  /* The tab bar's "Help" tab replaces the floating assistance button */
  html.is-app .floating-whatsapp { display: none; }

  /* Booking bar sits on top of the tab bar */
  html.is-app .app-sticky-cta:not([hidden]) { bottom: calc(62px + env(safe-area-inset-bottom, 0px)); padding-bottom: 10px; }
  html.is-app body.has-sticky-cta .site-footer { padding-bottom: 76px; }
}

/* ─────────────── Backgrounds and cards (all screen sizes) ───────────────
 * One look for every card on a soft cool background, so cards stand out.
 * Tokens (--app-bg, --app-tint ...) live in site.css :root and follow the brand colour
 * (Admin > Settings); they replace the old peach/orange accents.
 */
/* Page backgrounds */
body,
main,
.gt-shell,
.gt-dest-page,
.gt-city-page,
.gt-tour-detail,
.gt-plan-page,
.egh-catalogue,
.gt-detail-shell,
.blog-page,
.about-page,
.auth-page,
.checkout-page,
.payment-page,
.settings-shell { background-color: var(--app-bg) !important; }

.section-block,
.section-block.alt,
.about-section,
.about-vision,
.about-hiring-section,
.about-leadership-section { background: transparent !important; }
.about-stack-section { background: var(--app-tint) !important; }

.page-hero.visa-detail-hero {
  background: linear-gradient(180deg, var(--app-tint-strong) 0%, var(--app-bg) 100%) !important;
}

/* Cards: white surface, hairline border, soft shadow, 18px corners */
.service-card,
.visa-card,
.simple-card,
.review-card,
.content-panel,
.detail-card,
.gt-card,
.gt-tour-card,
.gt-td-card,
.gt-td-related-card,
.gt-td-price-card,
.egh-catalogue__card,
.gt-sidebar-card,
.gt-plan-card,
.metric-card,
.timeline-card,
.process-calendar,
.document-item,
.about-value-item,
.dashboard-showcase,
.savings-card,
.addon-card,
.checkout-applicant-card,
.checkout-delivery-card,
.checkout-service-card,
.checkout-review-item,
.checkout-option-group-card,
.payment-method-item,
.payment-selected-card {
  background: var(--app-surface) !important;
  border: 1px solid var(--app-line) !important;
  border-radius: var(--app-radius) !important;
  box-shadow: var(--app-shadow) !important;
}

/* Image cards: picture fills the top edge, placeholder while it loads */
.gt-card,
.gt-tour-card,
.gt-td-related-card,
.gt-td-price-card,
.egh-catalogue__card { overflow: hidden; }
.gt-card-img,
.gt-tour-img,
.gt-tour-img-wrap,
.gt-blog-img,
.gt-td-related-card .thumb,
.gt-td-city-img { background: linear-gradient(135deg, #e7ecf5 0%, #f2f5fa 100%); }

/* Full-photo destination cards: rounded, shadowed, darker bottom for readable text */
.gt-dest-card {
  border-radius: var(--app-radius) !important;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(15, 23, 42, .06), 0 12px 28px rgba(15, 23, 42, .14) !important;
  transition: transform .15s ease;
}
.gt-dest-card:active { transform: scale(.98); }
.gt-dest-overlay {
  background: linear-gradient(180deg, rgba(2, 6, 23, 0) 0%, rgba(2, 6, 23, .35) 40%, rgba(2, 6, 23, .82) 100%) !important;
}
.gt-dest-name { text-shadow: 0 2px 10px rgba(0, 0, 0, .35); }

/* Card descriptions end with … instead of a cut word */
.egh-catalogue__body p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Pressed feedback on tappable cards */
a.gt-card,
a.gt-tour-card,
a.gt-td-related-card,
a.egh-catalogue__card,
.product-card-link .service-card,
.product-card-link .visa-card,
a.visa-card {
  transition: transform .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
a.gt-card:active,
a.gt-tour-card:active,
a.gt-td-related-card:active,
a.egh-catalogue__card:active,
.product-card-link:active .service-card,
.product-card-link:active .visa-card,
a.visa-card:active {
  transform: scale(.98);
  box-shadow: var(--app-shadow-press) !important;
}

/* Blocks inside cards: brand tint instead of peach */
.process-item,
.purchase-panel,
.purchase-summary-box,
.purchase-service-card,
.checkout-summary-total,
.checkout-meta-pill,
.auth-preview-card {
  background: var(--app-tint) !important;
  border: 1px solid var(--app-tint-line) !important;
  border-radius: var(--app-radius-sm) !important;
  box-shadow: none !important;
}
.purchase-field,
.purchase-applicants {
  background: var(--app-surface) !important;
  border: 1px solid var(--app-line) !important;
  border-radius: var(--app-radius-sm) !important;
}
.doc-tag {
  background: var(--app-tint) !important;
  border-color: var(--app-tint-line) !important;
  color: var(--brand, #0f35f0) !important;
}
.visa-empty-state {
  background: var(--app-tint) !important;
  border: 1px dashed var(--app-tint-line) !important;
  border-radius: var(--app-radius) !important;
}

/* Service icons: brand tint circle instead of peach */
.service-illustration { background: var(--app-tint-strong) !important; }
.service-illustration::before,
.service-illustration::after { border-color: var(--app-tint-line) !important; }
.service-illustration i { text-shadow: none !important; }

/* Note banner (visa estimate), dashboard preview and "Explore all services" icon */
.note-banner {
  background: var(--app-tint) !important;
  border: 1px solid var(--app-tint-line) !important;
  border-radius: var(--app-radius-sm) !important;
}
.dashboard-panel,
.dashboard-panel.active {
  background: var(--app-surface) !important;
  border-color: var(--app-line) !important;
  box-shadow: none !important;
}
.dashboard-panel-media { background: var(--app-tint) !important; border-color: var(--app-tint-line) !important; }
.service-explore-icon { background: var(--app-tint-strong) !important; }

/* Warm borders left from the old theme */
.document-head,
.checkout-service-settings,
.checkout-delivery-option,
.checkout-delivery-address,
.checkout-applicant-selector,
.checkout-linked-visa-item,
.checkout-review-note-card { border-color: var(--app-line) !important; }
