:root {
  --ink: #101828;
  --muted: #667085;
  --line: #d8e0ea;
  --surface: #ffffff;
  --soft: #f4f8fc;
  --blue: #0d5fa8;
  --blue-deep: #073a69;
  --blue-soft: #e8f3ff;
  --steel: #27384a;
  --green: #148f50;
  --green-soft: #e8f7ef;
  --amber: #b95f08;
  --amber-soft: #fff2df;
  --shadow: 0 18px 50px rgba(16, 24, 40, 0.14);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  overflow-x: hidden;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(216, 224, 234, 0.8);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  font-weight: 800;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 0.98rem;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.78rem;
}

.main-nav {
  display: flex;
  gap: 22px;
  color: var(--steel);
  font-weight: 700;
}

.main-nav a {
  padding: 8px 0;
}

.header-contact,
.btn,
.filter,
.icon-button {
  border: 0;
  cursor: pointer;
}

.header-contact {
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--blue-deep);
  color: white;
  font-weight: 800;
}

.hero {
  position: relative;
  min-height: min(640px, calc(100vh - 92px));
  overflow: hidden;
  background: var(--blue-deep);
}

.hero-media,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(5, 25, 45, 0.9), rgba(5, 25, 45, 0.58) 46%, rgba(5, 25, 45, 0.14)),
    linear-gradient(0deg, rgba(5, 25, 45, 0.7), rgba(5, 25, 45, 0) 42%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 36px));
  padding: clamp(72px, 10vw, 132px) 0 clamp(42px, 8vw, 72px);
  margin-left: clamp(18px, 6vw, 72px);
  color: white;
}

.eyebrow {
  margin: 0 0 12px;
  color: #a7d4ff;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.eyebrow.dark {
  color: var(--blue);
}

h1,
h2,
h3,
p,
dl,
dd {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: clamp(2.5rem, 8vw, 5.6rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.08;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.25rem;
  line-height: 1.2;
}

.hero-text {
  max-width: 650px;
  margin-bottom: 26px;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.7;
}

.hero-actions,
.card-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 8px;
  font-weight: 900;
}

.btn.primary {
  background: var(--blue);
  color: white;
}

.btn.light {
  background: rgba(255, 255, 255, 0.95);
  color: var(--blue-deep);
}

.btn.secondary {
  background: var(--blue-soft);
  color: var(--blue-deep);
}

.btn.full {
  width: 100%;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 150px));
  gap: 12px;
  max-width: 540px;
  margin: clamp(32px, 6vw, 54px) 0 0;
}

.hero-stats div {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
}

.hero-stats dt {
  font-size: 1.7rem;
  font-weight: 900;
}

.hero-stats dd {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.86rem;
}

.inventory-panel {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(42px, 7vw, 78px) 0;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 24px;
}

.section-heading h2 {
  color: var(--blue-deep);
}

.controls {
  display: grid;
  grid-template-columns: minmax(210px, 290px) 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(16, 24, 40, 0.06);
}

.search-box,
.control-group {
  display: grid;
  gap: 8px;
}

.search-box span,
.control-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  outline: none;
}

.search-box input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(13, 95, 168, 0.13);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--steel);
  font-weight: 800;
}

.filter.active {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.inventory-summary {
  margin: 18px 0;
  color: var(--muted);
  font-weight: 700;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 18px;
}

.machine-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(16, 24, 40, 0.07);
}

.card-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #dce8f3;
}

.card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status-chip,
.media-chip {
  position: absolute;
  top: 12px;
  z-index: 3;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 900;
}

.status-chip {
  left: 12px;
}

.status-chip.available {
  background: var(--green-soft);
  color: var(--green);
}

.status-chip.sold {
  background: #27384a;
  color: white;
}

.media-chip {
  right: 12px;
  background: rgba(7, 58, 105, 0.88);
  color: white;
}

.card-body {
  padding: 16px;
}

.sold-card {
  border-color: #aeb9c5;
  background: #f5f7fa;
}

.sold-card .card-media img {
  filter: grayscale(1) brightness(0.58);
}

.sold-card .card-body {
  color: #536273;
}

.sold-card h3,
.sold-card .price-row strong {
  color: #536273;
}

.sold-watermark {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background: rgba(8, 22, 36, 0.24);
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 900;
  text-transform: uppercase;
}

.more-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border-color: rgba(13, 95, 168, 0.35);
  background: #f8fbff;
}

.more-card-visual {
  display: grid;
  aspect-ratio: 4 / 3;
  place-items: center;
  align-content: center;
  gap: 8px;
  background:
    linear-gradient(135deg, rgba(7, 58, 105, 0.9), rgba(13, 95, 168, 0.78)),
    url("./assets/equipment/cat/320d2l/01.jpg") center / cover;
  color: white;
}

.more-card-visual span {
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.more-card-visual strong {
  font-size: clamp(3rem, 7vw, 4.8rem);
  line-height: 1;
}

.meta {
  margin-bottom: 6px;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.facts span {
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--soft);
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.price-row span {
  color: var(--muted);
  font-weight: 800;
}

.price-row strong {
  color: var(--blue-deep);
  font-size: 1.45rem;
  font-weight: 900;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.empty-state {
  padding: 36px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.contact-band {
  background: #eaf3fb;
  border-top: 1px solid var(--line);
}

.contact-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(38px, 7vw, 74px) 0;
}

.contact-inner h2 {
  color: var(--blue-deep);
}

.contact-inner p {
  max-width: 720px;
  color: var(--steel);
  line-height: 1.7;
}

.contact-actions {
  justify-content: flex-end;
}

#whatsappDisplay {
  width: 100%;
  margin: 0;
  color: var(--muted);
  text-align: right;
  font-weight: 800;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 22, 39, 0.72);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(290px, 0.8fr);
  width: min(1120px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.modal-media-shell {
  min-width: 0;
  padding: 16px;
  background: #0b1825;
}

.modal-media {
  display: grid;
  min-height: 440px;
  aspect-ratio: 16 / 10;
  width: 100%;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #07111c;
}

.modal-media.portrait-viewer {
  width: min(100%, 490px);
  min-height: 0;
  aspect-ratio: 3 / 4;
  justify-self: center;
}

.modal-panel.portrait-detail {
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.9fr);
}

.modal-media img,
.modal-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 30px 24px 24px;
}

.modal-kicker {
  margin: 0;
  color: var(--blue);
  font-weight: 900;
  text-transform: uppercase;
}

.modal-info h2 {
  margin-bottom: 0;
  color: var(--blue-deep);
}

.modal-status {
  display: flex;
}

.modal-status .status-chip {
  position: static;
  display: inline-flex;
}

.detail-list {
  display: grid;
  gap: 12px;
  margin-bottom: auto;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.detail-list dt {
  color: var(--muted);
  font-weight: 800;
}

.detail-list dd {
  color: var(--ink);
  font-weight: 900;
  text-align: right;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: white;
  color: var(--blue-deep);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
}

.icon-button.close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.18);
}

.media-nav {
  position: absolute;
  left: 24px;
  right: calc(24px + min(330px, 30vw));
  top: 50%;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  transform: translateY(-50%);
}

.media-nav .icon-button {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.9);
}

.thumb-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.thumb {
  position: relative;
  width: 82px;
  height: 62px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #132538;
  cursor: pointer;
}

.thumb.active {
  border-color: #69b8ff;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.thumb span {
  position: absolute;
  inset: auto 6px 6px;
  padding: 3px 5px;
  border-radius: 6px;
  background: rgba(7, 58, 105, 0.86);
  color: white;
  font-size: 0.66rem;
  font-weight: 900;
  text-align: center;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 1040px) {
  .controls {
    grid-template-columns: 1fr;
  }

  .control-group.compact {
    width: 100%;
  }

  .inventory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-panel {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .modal-media {
    min-height: 320px;
  }

  .media-nav {
    left: 24px;
    right: 24px;
  }
}

@media (max-width: 720px) {
  h1,
  h2,
  .hero-text {
    max-width: min(100%, 330px);
    overflow-wrap: break-word;
  }

  h1 {
    font-size: 2.15rem;
    line-height: 1.03;
  }

  h2 {
    font-size: 1.5rem;
    line-height: 1.12;
  }

  .site-header {
    align-items: flex-start;
    padding: 12px 16px;
    gap: 12px;
    overflow: hidden;
  }

  .brand-copy small,
  .main-nav,
  .header-contact {
    display: none;
  }

  .brand-copy strong {
    font-size: 0.94rem;
  }

  .hero {
    min-height: 650px;
  }

  .hero-overlay {
    background:
      linear-gradient(0deg, rgba(5, 25, 45, 0.92), rgba(5, 25, 45, 0.42)),
      linear-gradient(90deg, rgba(5, 25, 45, 0.82), rgba(5, 25, 45, 0.18));
  }

  .hero-content {
    width: auto;
    max-width: 100vw;
    margin: 0;
    padding-right: 16px;
    padding-left: 16px;
    padding-top: 82px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: min(100%, 320px);
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .inventory-grid,
  .contact-inner,
  .card-actions {
    grid-template-columns: 1fr;
  }

  .inventory-panel,
  .contact-inner {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    overflow: hidden;
  }

  .contact-actions,
  #whatsappDisplay {
    justify-content: flex-start;
    text-align: left;
  }

  .modal {
    padding: 10px;
  }

  .modal-panel {
    max-height: calc(100vh - 20px);
  }

  .modal-media-shell {
    padding: 10px;
  }

  .modal-info {
    padding: 22px 16px 18px;
  }

  .modal-media {
    min-height: 260px;
  }
}
