/* assets/css/style.css
   Combined styles for both index (hero) and track pages.
   - Restores hero styles (background, overlay header, large hero search)
   - Uses per-item connectors for the stepper (each icon has ::before / ::after)
   - Mobile layout converts stepper to vertical timeline
   - Responsive behavior included
*/

/* Custom Properties */
:root {
  --color-primary: #ff851b;
  --color-text-main: #262626;
  --color-text-sub: #404040;
  --white: #ffffff;
  --bg-gray: #f6f8f9;
  --font-main: "Manrope", system-ui, -apple-system, sans-serif;
  --transition-speed: 0.25s;
  --border: #efefef;

  --content-width: 820px; /* centered content width to match reference */
  --card-radius: 14px;
  --card-padding: 22px;
  --soft-shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
  --soft-shadow-2: 0 6px 18px rgba(16, 24, 40, 0.04);

  /* hero specifics */
  --hero-padding-top: 120px;
  --hero-padding-bottom: 80px;
  --hero-max-width: 560px;

  /* stepper tuning */
  --stepper-icon-size: 46px; /* icon circle size */
  --stepper-progress-default-width: 25%; /* fallback width for short orange segment */
}

/* Base reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
}
body {
  font-family: var(--font-main);
  color: var(--color-text-main);
  background: var(--bg-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Icon font */
@font-face {
  font-family: "thaistore-icon";
  src: url("../fonts/thaistore-icon.woff?z33r9t") format("woff");
  font-display: block;
}
[class^="t-"],
[class*=" t-"] {
  font-family: "thaistore-icon" !important;
  speak: never;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* icons (keep your glyph codes) */
.t-tag:before {
  content: "\e901";
}
.t-user-circle:before {
  content: "\e903";
}
.t-user-list:before {
  content: "\e902";
}
.t-check:before {
  content: "\e904";
}
.t-car:before {
  content: "\e905";
}
.t-printer:before {
  content: "\e906";
}
.t-package:before {
  content: "\e907";
}
.t-gps-fix:before {
  content: "\e908";
}
.t-caret-right:before {
  content: "\e909";
}
.t-rocket:before {
  content: "\e900";
}

/* Container utility */
.container {
  max-width: 1000px;
  margin: 0 auto;
}

/* Header */
.site-header {
  width: 100%;
  background: var(--white);
  z-index: 40;
  position: relative;
}
.site-header--overlay {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  background: transparent;
  box-shadow: none;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 0;
}
@media screen and (max-width: 720px) {
  .site-header__inner {
    padding: 24px 20px;
  }
}
@media screen and (max-width: 600px) {
  .site-header__inner {
    padding: 16px;
  }
}
.site-logo img {
  height: 44px;
  display: block;
}
.site-cta {
  background: var(--color-primary);
  color: var(--white);
  border: 0;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(255, 133, 27, 0.14);
  cursor: pointer;
}

/* -----------------------------
   HERO (index.html) styles
   ----------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background-image: url("../img/bg.jpg");
  background-size: cover;
  background-position: center right;
  padding: var(--hero-padding-top) 0 var(--hero-padding-bottom);
  position: relative;
}
.hero__content {
  width: 100%;
}
.hero__box {
  max-width: var(--hero-max-width);
}
.hero__title {
  font-size: 34px;
  line-height: 1.1;
  margin-bottom: 16px;
  color: var(--color-text-main);
  font-weight: 700;
}
.hero__description {
  color: var(--color-text-sub);
  margin-bottom: 40px;
  font-size: 16px;
  line-height: 1.5;
}

/* Ensure overlay header text/cta remain visible over hero */
.site-header--overlay .site-cta {
  box-shadow: 0 6px 16px rgba(255, 133, 27, 0.12);
}

/* -----------------------------
   Search component (shared)
   ----------------------------- */
.search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  padding: 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.search--big {
  padding: 6px 6px 6px 20px;
  max-width: 520px;
}
.search__icon {
  color: var(--color-primary);
  display: flex;
  align-items: center;
  font-size: 24px;
}
.search__input {
  border: 0;
  outline: 0;
  font-size: 1rem;
  width: 100%;
  color: var(--color-text-main);
  background: transparent;
}
.search__input::placeholder {
  color: #a0a0a0;
}
.search__button {
  background-color: var(--color-primary);
  color: var(--white);
  border: none;
  padding: 12px 32px;
  border-radius: 50px;
  font-size: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: opacity var(--transition-speed);
}
.search__button:hover {
  opacity: 0.95;
}
.search__button,
.search__arrow {
  line-height: 1;
}

/* Card shared styles and centered width */
.status-card,
.info-card,
.table-card,
.gallery-card {
  width: var(--content-width);
  max-width: 96%;
  margin: 20px auto;
  background: var(--white);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  border: 1px solid var(--border);
  overflow: hidden;
}

.status-card {
  border: none;
  border-radius: 0;
}

.table-card {
  padding: 0;
}

/* -----------------------------
   Stepper (per-item connectors)
   ----------------------------- */
.stepper {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 6px;
  min-height: 92px;
  width: 100%;
}

/* per-step item */
.stepper__item {
  flex: 1;
  min-width: 96px;
  text-align: center;
  position: relative; /* anchors per-item connectors */
  z-index: 1;
}

/* icon */
.stepper__icon {
  width: var(--stepper-icon-size);
  height: var(--stepper-icon-size);
  border-radius: 50%;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f6f7;
  color: #9aa0a6;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(16, 24, 40, 0.03);
  transition: all 0.18s;
  position: relative;
  z-index: 3;
}

/* per-item horizontal connectors: left and right halves */
.stepper__item::before,
.stepper__item::after {
  content: "";
  position: absolute;
  top: calc(var(--stepper-icon-size) / 2 + 2px); /* align with baseline */
  height: 2px;
  background: #f0f0f0;
  z-index: 1;
  border-radius: 2px;
}

/* left half: from center towards previous item */
.stepper__item::before {
  left: calc(-65% + (var(--stepper-icon-size) / 2));
  width: calc(80% - (var(--stepper-icon-size) / 2));
}

/* right half: from center towards next item */
.stepper__item::after {
  left: calc(80% + (var(--stepper-icon-size) / 2));
  width: calc(80% - (var(--stepper-icon-size) / 2));
}

/* hide connectors at ends */
.stepper__item:first-child::before {
  display: none;
}
.stepper__item:last-child::after {
  display: none;
}

/* labels */
.stepper__label {
  margin-top: 4px;
  font-weight: 600;
  color: var(--color-text-main);
}
.stepper__sub {
  font-size: 13px;
  color: var(--color-text-sub);
  margin-top: 6px;
}

/* active icon style */
.stepper__item--active .stepper__icon {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255, 133, 27, 0.16);
}

/* color connectors when a step is active (and color connector to next) */
.stepper__item--active::after,
.stepper__item--active::before,
.stepper__item--active + .stepper__item::before {
  background: var(--color-primary);
}

/* completed variant */
.stepper__item--completed .stepper__icon {
  background: #00a65a;
  color: #fff;
}
.stepper__item--completed::after,
.stepper__item--completed::before,
.stepper__item--completed + .stepper__item::before {
  background: #00a65a;
}

/* -----------------------------
   Info grid, table, gallery
   ----------------------------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  align-items: center;
}
.info-grid__title {
  font-size: 0.9rem;
  color: var(--color-text-sub);
}
.info-grid__data {
  margin-top: 6px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.info-grid__data i {
  color: var(--color-primary);
  font-size: 18px;
}

/* Table */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 1.4;
}
.results-table th {
  text-align: left;
  color: var(--color-text-sub);
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.results-table td {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  color: var(--color-text-main);
}
.results-table tfoot td {
  padding-top: 16px;
  font-weight: 700;
  border-top: 1px solid var(--border);
}
.results-table th,
.results-table td {
  padding: 12px 16px;
}

/* Gallery */
.gallery {
  display: flex;
  gap: 16px;
  align-items: center;
}
.gallery__item {
  width: 120px;
  height: 84px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
}

/* -----------------------------
   Search pill (track page centered wide version)
   ----------------------------- */
.search-section {
  display: flex;
  justify-content: center;
  padding: 28px 0 6px;
}
.search {
  width: var(--content-width);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  position: relative;
}
.search__button {
  background: var(--color-primary);
  color: var(--white);
  border: 0;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 24px rgba(255, 133, 27, 0.14);
  margin-left: 12px;
  transition: transform var(--transition-speed);
}

/* -----------------------------
   Responsive adjustments
   ----------------------------- */
@media (max-width: 1000px) {
  :root {
    --content-width: 92%;
  }
  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .search {
    padding-left: 12px;
    padding-right: 12px;
  }
  .hero {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 640px) {
  .search {
    padding: 10px;
  }

  /* Mobile: convert stepper to vertical timeline using same per-item connectors as vertical bars */
  .stepper {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0;
    padding-left: 0;
    position: relative;
    min-height: auto;
  }

  .stepper__item {
    position: relative;
    display: block;
    padding: 8px 16px 8px 88px; /* space for icon + gap */
    min-height: 56px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
  }

  .stepper__text {
    min-height: 56px;
  }

  /* place icon on left, centered over vertical baseline */
  .stepper__icon {
    position: absolute;
    left: 12px;
    top: 30%;
    transform: translateY(-50%);
    margin: 0;
    z-index: 3;
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  /* transform per-item connectors into vertical top/bottom bars */
  .stepper__item::before,
  .stepper__item::after {
    /* reuse pseudoelements but reposition to vertical line */
    left: calc(12px + (var(--stepper-icon-size) / 2) - 1px);
    width: 2px;
    background: #f0f0f0;
    border-radius: 2px;
    z-index: 1;
    position: absolute;
  }

  /* top connector */
  .stepper__item::before {
    top: -16px;
    height: calc(50% + 6px);
  }

  /* bottom connector */
  .stepper__item::after {
    top: calc(50% + 6px);
    bottom: 0;
    height: calc(50% - 6px);
  }

  /* hide first top connector and last bottom connector */
  .stepper__item:first-child::before {
    display: none;
  }
  .stepper__item:last-child::after {
    display: none;
  }

  /* color vertical connectors for active/completed */
  .stepper__item--active::before,
  .stepper__item--active::after,
  .stepper__item--active + .stepper__item::before {
    background: var(--color-primary);
  }
  .stepper__item--completed::before,
  .stepper__item--completed::after,
  .stepper__item--completed + .stepper__item::before {
    background: #00a65a;
  }

  /* label alignment */
  .stepper__label,
  .stepper__sub {
    text-align: left;
    margin-left: 0;
    white-space: normal;
  }

  /* spacing between items */
  .stepper__item + .stepper__item {
    margin-top: 8px;
  }

  /* layout adjustments for small screens */
  .status-card,
  .info-card,
  .table-card,
  .gallery-card {
    margin-left: 16px;
    margin-right: 16px;
    width: auto;
    max-width: calc(100% - 32px);
  }
  .info-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .gallery__item {
    width: 92px;
    height: 68px;
  }
  .search__button {
    padding: 9px 14px;
  }
  .hero__title {
    font-size: 26px;
  }
  .hero {
    padding-top: 90px;
    padding-bottom: 60px;
    background-position: center;
  }
}

/* Accessibility / reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* -----------------------------
   NOT FOUND (Order not found) styles
   Append this to the end of assets/css/style.css
   ----------------------------- */

.not-found-hero {
  max-width: var(--content-width);
  max-width: 860px;
  margin: 0 auto 48px;
  text-align: center;
  box-sizing: border-box;
}

.not-found-hero .search {
  /* make the search pill visually lighter and centered above the illustration */
  margin: 0 auto 36px;
  width: 100%;
  max-width: var(--content-width);
  background: var(--white);
  border-radius: 40px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 12px 16px;
  box-shadow: var(--soft-shadow-2);
  align-items: center;
}

.not-found-hero .search__icon {
  margin-right: 12px;
  font-size: 20px;
  color: var(--color-primary);
}

.not-found-illustration {
  width: 360px;
  max-width: 55%;
  height: auto;
  display: block;
  margin: 0 auto 24px;
}

.not-found__title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-main);
  margin: 6px 0 6px;
  letter-spacing: 0.1px;
}

.not-found__desc {
  font-size: 15px;
  color: var(--color-text-sub);
  line-height: 1.7;
  margin: 0 auto;
  max-width: 640px;
}

/* subtle spacing under the pill and above the page boundary */
.search-section {
  padding-top: 28px;
}

/* smaller screens */
@media (max-width: 900px) {
  .not-found-illustration {
    width: 300px;
    max-width: 62%;
  }
  .not-found__title {
    font-size: 22px;
  }
  .not-found__desc {
    font-size: 15px;
  }
}

@media (max-width: 640px) {
  .not-found-hero {
    margin: 4vh 12px 36px;
  }
  .not-found-illustration {
    width: 220px;
    max-width: 72%;
    margin-bottom: 16px;
  }
  .not-found__title {
    font-size: 18px;
  }
  .not-found__desc {
    font-size: 14px;
  }
  .not-found-hero .search {
    padding: 10px 12px;
    border-radius: 32px;
  }
}

/* -----------------------------
   PAGE NOT FOUND (404) styles
   Append this at the end of assets/css/style.css
   ----------------------------- */

.page-not-found {
  width: 100%;
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 16px;
  box-sizing: border-box;
  background: var(--white);
}

.page-not-found__inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 40px;
  box-sizing: border-box;
}

/* Left content */
.page-not-found__left {
  flex: 1 1 48%;
  max-width: 48%;
  padding-right: 20px;
}

.page-not-found__title {
  font-size: 34px;
  line-height: 1.1;
  color: var(--color-text-main);
  font-weight: 700;
  margin-bottom: 18px;
}

.page-not-found__desc {
  font-size: 16px;
  color: var(--color-text-sub);
  margin-bottom: 28px;
  max-width: 540px;
  line-height: 1.7;
}

/* CTA button */
.page-not-found__cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, var(--color-primary) 0%, #f07a0c 100%);
  color: var(--white);
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(255, 133, 27, 0.14);
  transition: transform var(--transition-speed),
    box-shadow var(--transition-speed);
}

.page-not-found__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(255, 133, 27, 0.18);
}

/* Right illustration */
.page-not-found__right {
  flex: 1 1 52%;
  max-width: 52%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 20px;
}

.page-not-found__illustration {
  width: 520px;
  max-width: 100%;
  height: auto;
  display: block;
}

/* Smaller screens: stack vertically */
@media (max-width: 960px) {
  .page-not-found__inner {
    gap: 24px;
  }
  .page-not-found__left,
  .page-not-found__right {
    max-width: 100%;
    flex-basis: 100%;
    padding: 0;
  }
  .page-not-found__illustration {
    width: 420px;
    margin-top: 12px;
  }
}

@media (max-width: 640px) {
  .page-not-found {
    padding: 36px 16px;
    min-height: calc(100vh - 80px);
  }
  .page-not-found__title {
    font-size: 22px;
  }
  .page-not-found__desc {
    font-size: 14px;
    margin-bottom: 18px;
  }
  .page-not-found__illustration {
    width: 260px;
  }
  .page-not-found__cta {
    padding: 10px 16px;
    font-size: 14px;
  }
}

/* =========================
   IMAGE MODAL BASE
========================= */
.image-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

.image-modal.open {
  display: flex;
}

/* =========================
   OVERLAY
========================= */
.image-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 15, 0.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 180ms ease;
}

.image-modal.open .image-modal__overlay {
  opacity: 1;
}

/* =========================
   CONTENT
========================= */
.image-modal__content {
  position: relative;
  width: calc(100% - 48px);
  max-width: 580px;
  max-height: calc(100vh - 96px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(6, 10, 15, 0.4);
  overflow: hidden;
  z-index: 1202;
}

/* =========================
   HEADER
========================= */
.image-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 0 24px;
}

.image-modal__header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #222;
}

.image-modal__close {
  background: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* =========================
   IMAGE AREA
========================= */
.image-modal__imgwrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: #fff;
}

.image-modal__img {
  max-width: 100%;
  max-height: calc(100vh - 180px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(16, 24, 40, 0.08);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 640px) {
  .image-modal__content {
    width: calc(100% - 24px);
    max-width: 420px;
    border-radius: 10px;
  }

  .image-modal__header {
    padding: 12px 12px 0 16px;
  }

  .image-modal__header h3 {
    font-size: 14px;
  }
}

/* Allow horizontal scrolling on narrow viewports as a fallback */
.table-card {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
