/* ===== RESET ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== VARIABLES ===== */
:root {
  --primary: #ff6b35;
  --secondary: #004e89;
  --accent: #1dd1a1;
  --dark: #0f1419;
  --grey: #1a202c;
  --grey-light: #2d3748;
  --text: #e2e8f0;
  --text-dim: #a0aec0;
  --border: #2d3748;
  --success: #48bb78;
  --danger: #f56565;
  --font-display: 'Trebuchet MS', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

/* ===== BASE ===== */
html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: linear-gradient(135deg, var(--dark) 0%, #1a1f2e 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

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

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

main {
  flex: 1;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ===== SKIP LINK ===== */
.skip-link {
  position: absolute;
  top: -9999px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  font-weight: 700;
  z-index: 200;
}

.skip-link:focus {
  top: 0;
}

/* ===== CONTAINER ===== */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===========================
   NAVBAR
=========================== */
.navbar {
  background: rgba(15, 20, 25, 0.98);
  border-bottom: 2px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: auto;
  min-height: 60px;
  gap: 1.5rem;
}

.navbar__logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  flex-shrink: 0;
}

.navbar__logo span {
  color: var(--primary);
  -webkit-text-fill-color: var(--primary);
}

.navbar__nav {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.navbar__nav a {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.6rem 1rem;
  background: var(--grey-light);
  border-radius: 6px;
  transition: all 0.3s ease;
  border: none;
}

.navbar__nav a:hover,
.navbar__nav a[aria-current="page"] {
  background: var(--primary);
  color: white;
  box-shadow: 0 6px 20px rgba(179, 48, 0, 0.3);
  transform: translateY(-2px);
}

/* ===========================
   FOOTER
=========================== */
.footer {
  background: linear-gradient(135deg, var(--grey) 0%, var(--dark) 100%);
  border-top: 2px solid var(--primary);
  padding: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-top: auto;
}

.footer span {
  color: var(--primary);
  font-weight: 700;
}

/* ===========================
   HERO — PAGE ACCUEIL
=========================== */
.hero {
  padding: 4rem 0;
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero__tag {
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
  font-weight: 700;
}

.hero__title {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.hero__title span {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
}

.hero__desc {
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.8;
  max-width: 500px;
  margin-bottom: 2.5rem;
}

.hero__cta {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), #ff4d00);
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  box-shadow: 0 10px 30px rgba(179, 48, 0, 0.3);
  transition: all 0.3s ease;
}

.hero__cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(179, 48, 0, 0.5);
}

/* Stats panel */
.hero__panel {
  background: linear-gradient(135deg, rgba(45, 55, 72, 0.5) 0%, rgba(26, 32, 44, 0.3) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.hero__panel-header {
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
  font-weight: 700;
}

.hero__panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.hero__stat-val {
  font-size: 2.5rem;
  font-weight: 900;
  color: white;
  line-height: 1;
  font-family: var(--font-display);
}

.hero__stat-val sup {
  font-size: 1rem;
  color: var(--primary);
  margin-left: 0.3rem;
}

.hero__stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 0.8rem;
  font-weight: 600;
}

/* ===========================
   PAGE HERO (sous-pages)
=========================== */
.page-hero {
  background: linear-gradient(135deg, var(--grey) 0%, rgba(0, 78, 137, 0.1) 100%);
  border-bottom: 2px solid var(--primary);
  padding: 2.5rem 0;
}

.page-hero__breadcrumb {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.page-hero__title {
  font-size: clamp(1.75rem, 5vw, 3.5rem);
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.page-hero__title span {
  color: var(--primary);
}

/* ===========================
   BIKES GRID — CARDS
=========================== */
.bikes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 1rem;
}

.bike-card {
  background: linear-gradient(135deg, rgba(45, 55, 72, 0.6) 0%, rgba(26, 32, 44, 0.4) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.bike-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(255, 107, 53, 0.2);
  border-color: var(--primary);
}

.bike-card__image {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--grey) 0%, var(--grey-light) 100%);
}

.bike-card__image img,
.bike-card__image .img-placeholder {
  width: 100%;
  height: 200px;
  display: block;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid var(--border);
}

.bike-card__info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.bike-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.bike-card__brand {
  font-size: 0.7rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
  display: block;
}

.bike-card__id {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 700;
}

.bike-card__name {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.bike-card__category {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.2rem;
  font-weight: 600;
}

.bike-card__specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex: 1;
}

.spec-item {
  display: flex;
  flex-direction: column;
}

.spec-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.spec-value {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 700;
  font-family: var(--font-display);
}

.spec-unit {
  display: block;
  font-size: 0.55rem;
  color: var(--text-dim);
  font-weight: 400;
}

.bike-card__footer {
  display: flex;
  justify-content: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.bike-card__price {
  font-size: 1.3rem;
  color: var(--primary);
  font-weight: 700;
  font-family: var(--font-display);
}


/* ===========================
   FORMULAIRE
=========================== */
.form-section {
  padding: 3rem 0 4rem;
}

.search-form {
  background: linear-gradient(135deg, rgba(45, 55, 72, 0.4) 0%, rgba(26, 32, 44, 0.3) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 600px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.search-form__header {
  background: linear-gradient(135deg, var(--secondary) 0%, rgba(0, 78, 137, 0.8) 100%);
  padding: 1.2rem 1.5rem;
  border-bottom: 2px solid var(--primary);
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
}

.search-form__body {
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.6rem;
  font-family: var(--font-display);
}

.form-group input,
.form-group select {
  width: 100%;
  background: rgba(15, 20, 25, 0.6);
  border: 2px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.8rem 1rem;
  transition: all 0.3s ease;
  border-radius: 8px;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(29, 209, 161, 0.05);
  box-shadow: 0 0 15px rgba(29, 209, 161, 0.2);
}

.form-group input::placeholder {
  color: #666;
}

.form-group select option {
  background: var(--grey);
}

.form-submit {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), #ff4d00);
  border: none;
  color: white;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.9rem 2.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 50px;
  box-shadow: 0 10px 30px rgba(255, 107, 53, 0.3);
}

.form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(179, 48, 0, 0.5);
}

/* Alert boxes */
.alert-error {
  background: linear-gradient(135deg, rgba(245, 101, 101, 0.15) 0%, rgba(197, 102, 102, 0.1) 100%);
  border-left: 4px solid var(--danger);
  border-radius: 8px;
  color: #ffa0a0;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.result-info {
  background: linear-gradient(135deg, rgba(72, 187, 120, 0.15) 0%, rgba(72, 187, 120, 0.1) 100%);
  border-left: 4px solid var(--success);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  line-height: 1.8;
}

.result-error {
  background: linear-gradient(135deg, rgba(245, 101, 101, 0.15) 0%, rgba(197, 102, 102, 0.1) 100%);
  border-left: 4px solid var(--danger);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  line-height: 1.8;
}

.result-info strong {
  color: var(--accent);
  font-weight: 700;
}

/* ===========================
   RESPONSIVE — 768px
=========================== */
@media (max-width: 768px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero {
    min-height: auto;
    padding: 2.5rem 0;
  }

  .hero__panel {
    padding: 2rem;
  }

  .hero__panel-grid {
    gap: 1.5rem;
  }

  .hero__stat-val {
    font-size: 2rem;
  }

  .bikes-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
  }

  .bike-card__image img,
  .bike-card__image .img-placeholder {
    height: 160px;
  }

  .data-table {
    font-size: 0.85rem;
  }

  .data-table td {
    padding: 0.8rem;
  }

  .data-table th {
    padding: 0.8rem;
    font-size: 0.6rem;
  }
}

/* ===========================
   RESPONSIVE — 576px (Mobile)
=========================== */
@media (max-width: 576px) {
  :root {
    font-size: 14px;
  }

  .wrap {
    padding: 0 1rem;
  }

  /* Navbar mobile */
  .navbar__inner {
    flex-direction: column;
    gap: 0.8rem;
    padding: 0.8rem 0;
  }

  .navbar__nav {
    width: 100%;
    justify-content: center;
    gap: 0.4rem;
  }

  .navbar__nav li {
    flex: 1 1 auto;
    min-width: 0;
  }

  .navbar__nav a {
    width: 100%;
    text-align: center;
    padding: 0.5rem 0.4rem;
    font-size: 0.65rem;
    white-space: nowrap;
  }

  /* Hero mobile */
  .hero {
    padding: 2rem 0;
    min-height: auto;
  }

  .hero__title {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
    margin-bottom: 1rem;
  }

  .hero__desc {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }

  .hero__cta {
    display: block;
    text-align: center;
    width: 100%;
  }

  .hero__panel {
    padding: 1.5rem;
  }

  .hero__panel-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
  }

  .hero__stat-val {
    font-size: 1.5rem;
  }

  .hero__stat-label {
    font-size: 0.6rem;
    margin-top: 0.5rem;
  }

  /* Page hero mobile */
  .page-hero {
    padding: 1.5rem 0;
  }

  .page-hero__title {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }

  /* Table -> Cards */
  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }

  .data-table tbody tr {
    background: linear-gradient(135deg, var(--grey) 0%, var(--dark) 100%);
    border: 1px solid var(--border);
    margin-bottom: 1.2rem;
    padding: 1rem;
    border-radius: 8px;
    display: block;
  }

  .data-table tbody tr:hover {
    background: linear-gradient(135deg, var(--grey) 0%, var(--dark) 100%);
  }

  .data-table td {
    padding: 0.4rem 0;
    text-align: left;
    border: none;
    display: block;
    margin-bottom: 0.3rem;
  }

  .data-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 0.2rem;
  }

  .td-id {
    display: none;
  }

  .td-img {
    width: 100%;
    margin-bottom: 0.6rem;
  }

  .img-placeholder {
    height: 100px;
    aspect-ratio: auto;
  }

  .td-name {
    font-size: 0.95rem;
    margin-top: 0.2rem;
  }

  .td-num {
    display: inline-block;
    text-align: left;
    margin-right: 0.8rem;
    margin-bottom: 0.3rem;
  }

  .td-unit {
    display: inline;
    font-size: 0.5rem;
  }

  .td-price {
    text-align: left;
    font-size: 0.95rem;
    padding-top: 0.6rem;
    margin-top: 0.2rem;
    border-top: 1px solid var(--border);
  }

  .search-form__body {
    padding: 1.5rem;
  }

  .form-submit {
    width: 100%;
    text-align: center;
    padding: 0.9rem 1.5rem;
  }

  /* Sections */
  .listing-section {
    padding: 2rem 0 3rem;
  }

  .form-section {
    padding: 2rem 0 3rem;
  }

  .bikes-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .bike-card__specs {
    grid-template-columns: 1fr 1fr;
  }

  /* Footer */
  .footer {
    padding: 1.5rem 1rem;
    font-size: 0.7rem;
    margin-top: auto;
  }
}

/* ===========================
   RESPONSIVE — 380px (Petit mobile)
=========================== */
@media (max-width: 380px) {
  .navbar__logo {
    font-size: 1rem;
  }

  .navbar__nav a {
    font-size: 0.6rem;
    padding: 0.4rem 0.3rem;
  }

  .hero__title {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
  }

  .hero__desc {
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
  }

  .hero__stat-val {
    font-size: 1.3rem;
  }

  .hero__panel-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .page-hero__title {
    font-size: 1.5rem;
  }

  .data-table tbody tr {
    padding: 0.8rem;
    margin-bottom: 0.8rem;
  }

  .td-name {
    font-size: 0.9rem;
  }

  .search-form__body {
    padding: 1.2rem;
  }

  .bike-card__image img,
  .bike-card__image .img-placeholder {
    height: 140px;
  }
}