/* ==========================================================================
   8th Fleet Pte Ltd - shared stylesheet
   Used by every page (index, rentals, parts, contact) so the whole site
   looks and behaves consistently. Edit colors in :root to re-theme site-wide.
   ========================================================================== */

:root {
  --primary: #f9c937;   /* gold - buttons, headings, accents */
  --highlight: #00ccff; /* blue - hover accents */
  --dark: #14161a;
  --darker: #0a0a0b;
  --card: #1e2127;
  --card-alt: #191c21;
  --border-soft: #2a2e35;
  --light: #fff;
  --gray: #ccc;
  --max-width: 1200px;
  --font-display: 'Sora', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--dark);
  color: var(--light);
  line-height: 1.6;
}

a {
  color: inherit;
}

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

.section-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  color: var(--primary);
  text-align: center;
}

.accent {
  color: var(--primary);
}

.section-subtitle {
  text-align: center;
  color: var(--gray);
  margin-bottom: 2rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  background-color: var(--primary);
  color: var(--darker);
  text-decoration: none;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(249, 201, 55, 0.35);
}
.btn-outline {
  background-color: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* ---------- Header / Nav ---------- */
header.site-header {
  background-color: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid var(--border-soft);
}

.nav-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}
.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.5px;
  color: var(--primary);
  line-height: 1.1;
}
.brand-text p {
  font-size: 0.7rem;
  color: var(--gray);
}

nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.8rem;
}
nav.main-nav a {
  text-decoration: none;
  color: var(--light);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
nav.main-nav a:hover,
nav.main-nav a[aria-current="page"] {
  color: var(--primary);
  border-color: var(--primary);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1.8rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }
  nav.main-nav {
    display: none;
    width: 100%;
    order: 3;
  }
  nav.main-nav.open {
    display: block;
  }
  nav.main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0 1rem;
  }
  nav.main-nav a {
    display: block;
    padding: 0.7rem 0.2rem;
    border-bottom: 1px solid var(--border-soft);
  }
  .nav-wrap {
    flex-wrap: wrap;
  }
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 5rem 1.2rem;
  background-image: linear-gradient(rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.75)), url('../images/background01.jpg');
  background-size: cover;
  background-position: center;
}
.hero.hero-compact {
  padding: 3rem 1.2rem;
}
.hero h2 {
  font-family: var(--font-display);
  font-size: 2.6rem;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}
.hero p {
  color: var(--gray);
  max-width: 600px;
  margin: 0 auto;
}
.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* ---------- Feature strip ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.8rem;
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}
.feature svg {
  width: 30px;
  height: 30px;
  stroke: var(--primary);
  margin-bottom: 0.7rem;
}
.feature p {
  color: var(--gray);
  font-size: 0.9rem;
  max-width: 220px;
  margin: 0 auto;
}

.features-compact {
  gap: 1rem;
}
.features-compact .feature {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-align: left;
}
.features-compact .feature svg {
  flex-shrink: 0;
  margin-bottom: 0;
}
.features-compact .feature h4 {
  font-size: 0.95rem;
}

/* ---------- Generic section ---------- */
section {
  padding: 4rem 1.2rem;
}
section.alt {
  background-color: var(--card-alt);
}
section.section-tight {
  padding: 2rem 1.2rem;
}
.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ---------- Vehicle grid (rentals) ---------- */
.vehicles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}
.vehicle {
  background-color: var(--card);
  border: 1px solid var(--border-soft);
  padding: 1.5rem;
  border-radius: 14px;
  transition: transform 0.25s, box-shadow 0.25s;
  text-align: center;
  overflow: hidden;
}
.vehicle:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}
.vehicle img {
  width: 100%;
  border-radius: 8px;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform 0.35s;
}
.vehicle:hover img {
  transform: scale(1.04);
}
.vehicle h4 {
  margin: 1rem 0 0.3rem;
  font-size: 1.2rem;
}
.vehicle p {
  color: var(--gray);
}

/* ---------- Parts table (catalog) ---------- */
.parts-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  margin-bottom: 2.5rem;
}
.parts-toolbar input[type="search"],
.parts-toolbar select {
  padding: 0.7rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: var(--card);
  color: var(--light);
  font-family: inherit;
  font-size: 0.95rem;
}
.parts-toolbar input[type="search"] {
  min-width: 220px;
  flex: 1 1 260px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
}
.parts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 640px;
}
.parts-table thead th {
  text-align: left;
  background: var(--card-alt);
  color: var(--primary);
  font-weight: 600;
  padding: 0.9rem 1rem;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.parts-table thead th:hover {
  color: var(--light);
}
.parts-table thead th.sort-asc::after {
  content: ' \2191';
}
.parts-table thead th.sort-desc::after {
  content: ' \2193';
}
.parts-table tbody tr {
  background: var(--card);
  cursor: pointer;
  transition: background-color 0.15s;
  border-top: 1px solid var(--border-soft);
}
.parts-table tbody tr:hover {
  background: var(--card-alt);
}
.parts-table td {
  padding: 0.8rem 1rem;
  vertical-align: top;
}
.parts-table .cell-part-number {
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}
.row-enquire {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}
.row-enquire:hover {
  text-decoration: underline;
}

.empty-state {
  text-align: center;
  color: var(--gray);
  padding: 3rem 1rem;
}

/* ---------- Modal (text-only part detail) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  z-index: 500;
}
.modal-overlay.open {
  display: flex;
}
.modal {
  background: var(--card);
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.8rem;
  position: relative;
}
.modal.modal-narrow {
  max-width: 500px;
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  background: none;
  border: none;
  color: var(--light);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover {
  color: var(--primary);
}
.modal h3 {
  color: var(--primary);
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
  padding-right: 2rem;
}
.modal .part-number {
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: block;
}
.modal dl {
  margin: 1rem 0;
  font-size: 0.9rem;
}
.modal dt {
  color: var(--gray);
  margin-top: 0.6rem;
}
.modal dd {
  color: var(--light);
}
.modal .notes {
  background: var(--card-alt);
  padding: 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--gray);
  margin-top: 1rem;
}
.modal .btn {
  margin-top: 1.3rem;
}

@media (max-width: 640px) {
  .parts-table {
    font-size: 0.85rem;
  }
  .parts-table td, .parts-table th {
    padding: 0.6rem 0.7rem;
  }
}

/* ---------- CTA ---------- */
.cta {
  text-align: center;
  background-color: var(--darker);
}
.cta h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}
.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* ---------- Contact ---------- */
.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}
.contact-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: transform 0.25s, box-shadow 0.25s;
}
.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}
.contact-card .icon {
  color: var(--primary);
  margin-bottom: 0.6rem;
  display: flex;
  justify-content: center;
}
.contact-card h4 {
  margin-bottom: 0.5rem;
  color: var(--primary);
}
.contact-card a.btn {
  margin-top: 1rem;
}

/* ---------- About page ---------- */
.about-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}
.about-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 1.3rem 1.4rem;
}
.about-card h4 {
  font-family: var(--font-display);
  color: var(--primary);
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}
.about-card p {
  color: var(--gray);
  font-size: 0.92rem;
}
@media (max-width: 768px) {
  .about-cards {
    grid-template-columns: 1fr;
  }
}

/* ---------- Sell to Us page ---------- */
.sell-box {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 1.8rem 2rem;
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}
.sell-box ul {
  list-style: none;
  text-align: left;
  color: var(--gray);
  font-size: 0.92rem;
  margin: 0 0 1.4rem;
}
.sell-box ul li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-soft);
}
.sell-box ul li:last-child {
  border-bottom: none;
}

/* ---------- Enquiry form ---------- */
.enquiry-form {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 1.8rem 2rem;
  max-width: 460px;
  margin: 0 auto;
}
.enquiry-form label {
  display: block;
  font-size: 0.85rem;
  color: var(--gray);
  margin-bottom: 0.3rem;
}
.enquiry-form .field {
  margin-bottom: 1rem;
}
.enquiry-form input,
.enquiry-form textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: var(--card-alt);
  color: var(--light);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}
.enquiry-form input:focus,
.enquiry-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.enquiry-form button.btn {
  width: 100%;
}
.form-note {
  text-align: center;
  color: var(--gray);
  font-size: 0.85rem;
  margin-top: 1rem;
}

/* ---------- Photo gallery ---------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}
.photo-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}
.photo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}
.photo-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform 0.35s;
}
.photo-card:hover img {
  transform: scale(1.04);
}
.photo-card figcaption {
  padding: 0.7rem 0.9rem;
  font-size: 0.88rem;
  color: var(--gray);
  text-align: center;
}

/* ---------- Footer ---------- */
footer.site-footer {
  background-color: var(--dark);
  text-align: center;
  padding: 2.2rem 1rem;
  color: var(--gray);
  font-size: 0.9rem;
  border-top: 1px solid var(--border-soft);
}
footer.site-footer a {
  color: var(--primary);
  text-decoration: none;
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--primary);
  color: var(--darker);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: bold;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 150;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .hero h2 {
    font-size: 1.6rem;
  }
  .hero-buttons, .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
  .hero-buttons .btn, .cta-buttons .btn {
    width: 100%;
    max-width: 280px;
  }
}
