/* TravelGo UX States + Responsive Final Audit
 * Additive hardening layer. Kept outside signed core files.
 */
:root{--tg-ux-blue:#0b63ce;--tg-ux-ink:#102033;--tg-ux-muted:#68778b;--tg-ux-line:#e4eaf1;--tg-ux-soft:#f7f9fc;--tg-ux-danger:#b42318;--tg-ux-danger-bg:#fff3f2;--tg-ux-warning:#9a6700;--tg-ux-warning-bg:#fff9e8;--tg-ux-success:#067647;--tg-ux-success-bg:#ecfdf3}
html,body{max-width:100%;overflow-x:clip}
img{max-width:100%;height:auto}
.tg-container,.tg-content,.tg-filter-layout,.tg-filter-results,.tg-archive-grid,.tg-tour-card,.tg-booking-shell,.tg-payment-shell,.tg-tracker-shell{min-width:0}

/* Unified empty/error state */
.tg-ux-state{grid-column:1/-1;width:100%;min-height:260px;display:flex;align-items:center;justify-content:center;padding:28px 18px;border:1px dashed #d9e2ec;border-radius:20px;background:linear-gradient(180deg,#fff,#fafcff);text-align:center;box-sizing:border-box}
.tg-ux-state__inner{width:min(100%,430px);margin:auto}
.tg-ux-state__icon{display:grid;place-items:center;width:58px;height:58px;margin:0 auto 14px;border-radius:18px;background:#eef5ff;color:var(--tg-ux-blue)}
.tg-ux-state__icon svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tg-ux-state h3{margin:0 0 7px;color:var(--tg-ux-ink);font-size:20px;line-height:1.25}
.tg-ux-state p{margin:0 auto;color:var(--tg-ux-muted);font-size:14px;line-height:1.65}
.tg-ux-state__actions{display:flex;gap:9px;justify-content:center;flex-wrap:wrap;margin-top:18px}
.tg-ux-state__btn{appearance:none;border:0;border-radius:12px;min-height:42px;padding:0 16px;background:var(--tg-ux-blue);color:#fff;font:inherit;font-size:13px;font-weight:800;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
.tg-ux-state__btn.is-secondary{background:#fff;color:#334155;border:1px solid #dbe3ec}
.tg-ux-state.is-error{border-style:solid;border-color:#f1c7c3;background:linear-gradient(180deg,#fff,#fff8f7)}
.tg-ux-state.is-error .tg-ux-state__icon{background:var(--tg-ux-danger-bg);color:var(--tg-ux-danger)}

/* Filter loading state */
.tg-filter-results{position:relative}
[data-tour-filter].is-loading{pointer-events:none}
[data-tour-filter].is-loading .tg-btn{opacity:.75;cursor:wait}
[data-tour-filter].is-loading .tg-btn::after{content:'';display:inline-block;width:14px;height:14px;margin-left:9px;border:2px solid rgba(255,255,255,.45);border-top-color:#fff;border-radius:50%;vertical-align:-2px;animation:tgUxSpin .7s linear infinite}
@keyframes tgUxSpin{to{transform:rotate(360deg)}}
.tg-ux-loading-grid{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;width:100%}
.tg-ux-skeleton{overflow:hidden;border:1px solid #e8edf3;border-radius:18px;background:#fff;min-height:340px}
.tg-ux-skeleton::before{content:'';display:block;height:190px;background:#edf1f5}
.tg-ux-skeleton::after{content:'';display:block;height:118px;margin:18px;border-radius:10px;background:linear-gradient(90deg,#eef2f6 25%,#f7f9fb 37%,#eef2f6 63%);background-size:400% 100%;animation:tgUxShimmer 1.25s ease infinite}
@keyframes tgUxShimmer{0%{background-position:100% 0}100%{background-position:0 0}}
[data-filter-status]:not(:empty){display:inline-flex;align-items:center;min-height:30px;padding:5px 10px;border-radius:999px;background:#eef5ff;color:#1d4f91;font-size:12px;font-weight:800}
[data-filter-status].is-error{background:var(--tg-ux-danger-bg);color:var(--tg-ux-danger)}

/* Broken image fallback */
img.tg-ux-image-error{object-fit:contain!important;min-height:120px;background:#f4f7fa;padding:18px;box-sizing:border-box}

/* Network toast */
.tg-ux-network{position:fixed;left:50%;bottom:max(82px,calc(env(safe-area-inset-bottom) + 70px));z-index:2147483600;transform:translate(-50%,18px);opacity:0;pointer-events:none;display:flex;align-items:center;gap:9px;max-width:calc(100vw - 28px);padding:10px 14px;border-radius:999px;background:#182230;color:#fff;box-shadow:0 12px 35px rgba(15,23,42,.22);font-size:12.5px;font-weight:750;transition:.2s ease}
.tg-ux-network.is-visible{opacity:1;transform:translate(-50%,0)}
.tg-ux-network.is-online{background:#075e45}

/* Tracker not-found/error polish */
.tg-tracker-alert.danger{position:relative;padding:14px 14px 14px 44px!important;border:1px solid #f4c7c3!important;border-radius:14px!important;background:var(--tg-ux-danger-bg)!important;color:#8f1d14!important;line-height:1.55!important}
.tg-tracker-alert.danger::before{content:'!';position:absolute;left:14px;top:14px;display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:#d92d20;color:#fff;font-weight:900;font-size:12px}
.tg-tracker-form button.is-loading,.tg-payment-shell button.is-loading,.tg-booking-shell button.is-loading{pointer-events:none;opacity:.76}
.tg-tracker-form button.is-loading::after,.tg-payment-shell button.is-loading::after,.tg-booking-shell button.is-loading::after{content:'';display:inline-block;width:13px;height:13px;margin-left:8px;border:2px solid rgba(255,255,255,.45);border-top-color:#fff;border-radius:50%;animation:tgUxSpin .7s linear infinite}

/* Generic frontend notice states */
.tg-payment-shell .error,.tg-payment-shell .notice-error,.tg-booking-shell .error,.tg-booking-shell .notice-error,.tg-checkout-error{border:1px solid #f4c7c3!important;border-radius:14px!important;background:var(--tg-ux-danger-bg)!important;color:#8f1d14!important;padding:12px 14px!important}

/* Final responsive hardening */
@media (max-width:479px){
  .tg-container{width:100%!important;max-width:none!important;padding-left:16px!important;padding-right:16px!important;box-sizing:border-box}
  .tg-page-hero{padding-left:0!important;padding-right:0!important}
  .tg-page-hero .tg-container{padding-left:18px!important;padding-right:18px!important}
  .tg-tour-mobile-inner{width:calc(100% - 16px)!important;max-width:calc(100% - 16px)!important}
  .tg-tour-mobile-title{min-width:0;max-width:calc(100vw - 116px)}
  .tg-tour-mobile-title strong,.tg-tour-mobile-title small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .tg-tour-mobile-search{width:100%;box-sizing:border-box}
  .tg-tour-mobile-chips{scroll-padding-inline:8px;-webkit-overflow-scrolling:touch}
  .tg-filter-panel{width:min(94vw,420px)!important;max-width:94vw!important;max-height:min(82dvh,720px)!important;overflow:auto!important;overscroll-behavior:contain;box-sizing:border-box}
  .tg-filter-panel form,.tg-filter-panel label,.tg-filter-panel input,.tg-filter-panel select,.tg-filter-panel button{max-width:100%;box-sizing:border-box}
  .tg-filter-two{grid-template-columns:1fr!important}
  .tg-result-toolbar{gap:8px;align-items:center;flex-wrap:wrap}
  .tg-result-toolbar strong{min-width:0;font-size:13px}
  .tg-archive-grid{grid-template-columns:1fr!important;gap:14px!important}
  .tg-tour-card{width:100%;max-width:100%;margin-left:0;margin-right:0}
  .tg-tour-card img{width:100%;object-fit:cover}
  .tg-ux-loading-grid{grid-template-columns:1fr;gap:14px}
  .tg-ux-skeleton:nth-child(n+3){display:none}
  .tg-ux-state{min-height:230px;border-radius:16px;padding:24px 16px}
  .tg-ux-state h3{font-size:18px}
  .tg-ux-state__actions{display:grid;grid-template-columns:1fr;width:100%}
  .tg-ux-state__btn{width:100%}
  .tg-mobile-bottom-nav{padding-bottom:max(7px,env(safe-area-inset-bottom));height:auto;min-height:64px}
  .tg-booking-shell,.tg-payment-shell,.tg-tracker-shell{width:100%!important;max-width:100%!important;padding-left:12px!important;padding-right:12px!important;box-sizing:border-box}
  .tg-tracker-layout,.tg-tracker-summary-grid,.tg-tracker-actions,.tg-payment-shell .layout,.tg-booking-shell .layout{grid-template-columns:1fr!important}
  .tg-tracker-search-card,.tg-tracker-result,.tg-tracker-info-card{min-width:0;width:100%;box-sizing:border-box}
  .tg-tracker-result-head{gap:10px;align-items:flex-start;flex-wrap:wrap}
  .tg-tracker-result-head h2{overflow-wrap:anywhere}
  .tg-tracker-actions a{width:100%;box-sizing:border-box;text-align:center;justify-content:center}
  .tg-tracker-next-action{align-items:flex-start;gap:12px;flex-direction:column}
  .tg-tracker-next-action>a{width:100%;box-sizing:border-box;text-align:center}
  input,select,textarea{font-size:16px!important}
  table{max-width:100%}
}

/* Explicit 360 / 390 / 430 phone checks */
@media (max-width:374px){
  .tg-container{padding-left:12px!important;padding-right:12px!important}
  .tg-tour-mobile-inner{width:calc(100% - 12px)!important;max-width:calc(100% - 12px)!important;margin-left:6px!important;margin-right:6px!important}
  .tg-tour-mobile-title small{font-size:10.5px}
  .tg-mobile-bottom-nav a,.tg-mobile-bottom-nav button{min-width:0;padding-left:2px!important;padding-right:2px!important}
  .tg-mobile-bottom-nav span{font-size:9.5px!important}
}
@media (min-width:375px) and (max-width:404px){.tg-container{padding-left:14px!important;padding-right:14px!important}}
@media (min-width:405px) and (max-width:479px){.tg-container{padding-left:18px!important;padding-right:18px!important}}

/* Tablet */
@media (min-width:768px) and (max-width:1024px){
  .tg-container{width:min(100% - 40px,960px)!important;max-width:none!important}
  .tg-filter-layout{grid-template-columns:minmax(220px,260px) minmax(0,1fr)!important;gap:20px!important}
  .tg-archive-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:18px!important}
  .tg-ux-loading-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .tg-tracker-layout{gap:20px}
}

/* Laptop */
@media (min-width:1025px) and (max-width:1366px){
  .tg-container{width:min(100% - 48px,1180px)!important}
  .tg-filter-layout{grid-template-columns:minmax(230px,270px) minmax(0,1fr)!important;gap:24px!important}
  .tg-archive-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
}

/* Wide desktop */
@media (min-width:1367px){
  .tg-container{width:min(100% - 64px,1280px)}
  .tg-archive-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}

@media (prefers-reduced-motion:reduce){.tg-ux-skeleton::after,[data-tour-filter].is-loading .tg-btn::after,.tg-tracker-form button.is-loading::after,.tg-payment-shell button.is-loading::after,.tg-booking-shell button.is-loading::after{animation:none!important}.tg-ux-network{transition:none}}
