/* ==================================================
   CAR VAULT — MASTER STYLESHEET (CLEAN + BALANCED)
   ================================================== */

/* ---------- ROOT ---------- */
:root {
  --bg: #0b0b0b;
  --card: #161616;
  --border: #1f1f1f;
  --text: #ffffff;
  --muted: #9a9a9a;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  /* FIX #5: Inter loaded from Google Fonts, use it explicitly */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  padding-top: 110px;
}

/* ==================================================
   HEADER — DESKTOP
================================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 110px;
  background: rgba(11,11,11,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.header-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.header-logo img {
  height: 110px;
}

.header-left {
  position: absolute;
  left: 40px;
}

.header-actions {
  position: absolute;
  right: 40px;
  display: flex;
  gap: 30px;
}

.header-left a,
.header-actions a {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(255,255,255,0.6);
  transition: color .3s ease;
}

.header-left a:hover,
.header-actions a:hover {
  color: #fff;
}

/* FIX #3: Moved outside of any media query so it's correctly hidden on desktop */
.header-mobile-actions {
  display: none;
}

#sell {
  scroll-margin-top: 110px;
}

/* ==================================================
   HEADER — MOBILE (768px)
================================================== */

@media (max-width: 768px) {

  .header {
    height: auto;
    flex-direction: column;
    padding: 16px 0 12px;
  }

  .header-logo {
    position: static;
    transform: none;
  }

  .header-logo img {
    height: 72px;
    margin-bottom: 0;
  }

  .header-left,
  .header-actions {
    display: none;
  }

  /* FIX #3: Show correctly on mobile */
  .header-mobile-actions {
    display: flex;
    justify-content: center;
    gap: 30px;
  }

  .header-mobile-actions a {
    font-size: 10px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
  }

  .header-mobile-actions a:hover {
    color: #fff;
  }

}

/* ==================================================
   HERO
================================================== */

.vault-hero-elite {
  text-align: center;
  padding: 60px 20px 40px;
}

.vault-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(44px, 6vw, 64px);
  letter-spacing: 6px;
  margin-bottom: 22px;
}

.vault-subtitle {
  font-size: 16px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 50px;
}

.vault-triad {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 70px;
}

.vault-line {
  width: 60px;
  height: 1px;
  background: rgba(255,255,255,0.15);
}

/* ==================================================
   SEARCH
================================================== */

.vault-search {
  position: relative;
  max-width: 420px;
  margin: 40px auto 30px;
}

.vault-search input {
  width: 100%;
  padding: 14px 14px 14px 42px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 14px;
}

.vault-search input:focus {
  outline: none;
  border-bottom: 1px solid #fff;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: rgba(255,255,255,0.5);
  stroke-width: 1.5;
  fill: none;
}

/* ==================================================
   VAULT SECTIONS
================================================== */

.vault-section {
  margin-top: 40px;
  /* FIX #8: Added bottom padding so sections don't run into each other */
  padding-bottom: 80px;
}

.section-title {
  text-align: center;
  font-size: 20px;
  margin-bottom: 10px;
  font-family: 'Cinzel', serif;
}

.section-subtitle {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 25px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.section-divider {
  width: 60px;
  height: 1px;
  background: var(--border);
  margin: 0 auto 50px;
}

/* ==================================================
   INVENTORY GRID
================================================== */

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
  /* FIX #7: Prevent cards from sitting flush to viewport edge */
  padding: 0 40px;
}

.vault-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  aspect-ratio: 4/3;
  background-size: cover;
  background-position: center;
  transition: transform .4s ease, box-shadow .4s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  margin-bottom: 0;
}

.vault-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.85) 0%,
    rgba(0,0,0,0.45) 40%,
    rgba(0,0,0,0.15) 70%
  );
  z-index: 1;
}

.vault-card-title,
.vault-card-meta,
.vault-badge {
  position: absolute;
  z-index: 2;
}

.vault-card-title {
  bottom: 42px;
  left: 22px;
  font-size: 15px;
}

.vault-card-meta {
  bottom: 20px;
  left: 22px;
  font-size: 11px;
  color: rgba(255,255,255,0.75);
}

.vault-badge {
  top: 18px;
  right: 18px;
  padding: 6px 12px;
  font-size: 10px;
  letter-spacing: 1.5px;
  border: 1px solid rgba(255,255,255,0.5);
  background: rgba(0,0,0,0.6);
}

.vault-card.available:hover {
  transform: scale(1.04);
}

.vault-card.sold {
  filter: grayscale(70%) brightness(0.85);
}

/* ==================================================
   ARCHIVE SECTION — SPACING FIX
================================================== */

.vault-section.archive {
  /* FIX: Consistent padding, not 0 */
  padding-bottom: 80px;
}

/* Archive hidden: cards are removed from flow entirely until shown */
.archive-hidden {
  display: contents; /* slots children directly into parent grid */
}

.archive-hidden .vault-card {
  display: none;
  opacity: 0;
  transform: translateY(30px);
}

/* When shown: display cards and animate in */
.archive-hidden.show .vault-card {
  display: block;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.6s ease,
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.archive-hidden.show .vault-card:nth-child(1) { transition-delay: 0.05s; }
.archive-hidden.show .vault-card:nth-child(2) { transition-delay: 0.10s; }
.archive-hidden.show .vault-card:nth-child(3) { transition-delay: 0.15s; }
.archive-hidden.show .vault-card:nth-child(4) { transition-delay: 0.20s; }
.archive-hidden.show .vault-card:nth-child(5) { transition-delay: 0.25s; }

/* FIX: Archive button — proper spacing above and below */
.archive-cta {
  margin-top: 48px;
  margin-bottom: 0;
  text-align: center;
}

/* FIX #4: Scoped archive button so global button styles don't bleed in */
.archive-cta button {
  padding: 14px 42px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 11px;
  cursor: pointer;
  /* Override the global button margin-top: 60px */
  margin-top: 0;
  transition: all 0.35s ease;
}

.archive-cta button:hover {
  background: #fff;
  color: #000;
}

/* ==================================================
   PRIVATE SOURCING
================================================== */

.vault-sourcing {
  padding: 140px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: center;
}

.sourcing-inner {
  max-width: 800px;
  margin: 0 auto;
}

.sourcing-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(34px, 5vw, 48px);
  letter-spacing: 4px;
  margin-bottom: 24px;
}

.sourcing-line {
  width: 60px;
  height: 1px;
  background: rgba(255,255,255,0.15);
  margin: 0 auto 40px;
}

.sourcing-text {
  font-size: 15px;
  color: rgba(255,255,255,0.7);
  line-height: 1.9;
  margin-bottom: 50px;
}

.sourcing-button {
  display: inline-block;
  padding: 16px 50px;
  border: 1px solid rgba(255,255,255,0.5);
  text-decoration: none;
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 12px;
  transition: all .3s ease;
}

.sourcing-button:hover {
  background: #fff;
  color: #000;
}

/* ==================================================
   VAULT ACCESS
================================================== */

.vault-access {
  padding: 140px 20px;
  text-align: center;
}

.access-inner {
  max-width: 700px;
  margin: 0 auto;
}

.access-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(34px, 5vw, 48px);
  letter-spacing: 4px;
  margin-bottom: 24px;
}

.access-line {
  width: 60px;
  height: 1px;
  background: rgba(255,255,255,0.15);
  margin: 0 auto 40px;
}

.access-text {
  font-size: 15px;
  color: rgba(255,255,255,0.65);
  margin-bottom: 50px;
}

.access-button {
  display: inline-block;
  padding: 16px 50px;
  border: 1px solid rgba(255,255,255,0.5);
  text-decoration: none;
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 12px;
  transition: all .3s ease;
}

.access-button:hover {
  background: #fff;
  color: #000;
}

/* ==================================================
   SELL YOUR CAR
================================================== */

.sell-section {
  padding: 100px 20px 30px;
  text-align: center;
}

.sell-inner {
  max-width: 880px;
  margin: 0 auto;
}

.sell-mark {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sell-mark span {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255,255,255,0.22);
  transform: rotate(45deg);
}

.sell-mark::after {
  content: "";
  position: absolute;
  width: 65%;
  height: 65%;
  border: 1px solid rgba(255,255,255,0.10);
  transform: rotate(45deg);
}

.sell-mark img {
  width: 58px;
  height: auto;
  position: relative;
  z-index: 2;
  opacity: 0.9;
}

.sell-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(44px, 6vw, 64px);
  letter-spacing: 7px;
  margin-bottom: 24px;
}

.sell-line {
  width: 70px;
  height: 1px;
  background: rgba(255,255,255,0.14);
  margin: 0 auto 60px;
}

.sell-text {
  font-size: 16px;
  color: rgba(255,255,255,0.70);
  max-width: 640px;
  margin: 0 auto 60px;
  line-height: 1.9;
}

.sell-features {
  display: flex;
  justify-content: center;
  gap: 60px;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 40px;
}

.sell-features span {
  position: relative;
}

.sell-features span:not(:last-child)::after {
  content: "•";
  position: absolute;
  right: -32px;
  color: rgba(255,255,255,0.25);
}

.sell-button {
  display: inline-block;
  padding: 20px 60px;
  border: 1px solid rgba(255,255,255,0.35);
  text-decoration: none;
  color: #fff;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  transition: all .35s ease;
}

.sell-button:hover {
  background: #fff;
  color: #000;
}

/* ==================================================
   SUBMIT FORM
================================================== */

form {
  max-width: 900px;
  margin: 80px auto;
}

label {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  display: block;
  margin-bottom: 12px;
}

input,
select,
textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding: 14px 0;
  color: #fff;
  font-size: 15px;
  outline: none;
  appearance: none;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255,255,255,0.4);
}

select {
  background-color: transparent;
  color: #fff;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  background-size: 18px;
}

select option {
  background: #0b0b0b;
  color: #fff;
}

/* FIX #4: Scoped to form buttons only, not archive button */
form button {
  margin-top: 60px;
  padding: 14px 48px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.6);
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 12px;
  cursor: pointer;
  transition: all .3s ease;
}

form button:hover {
  background: #fff;
  color: #000;
}

/* ==================================================
   STANDARD SECTION
================================================== */

.vault-standard-elite {
  margin: 120px auto;
  padding: 120px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  /* FIX #6: Only headings use Cinzel, not the whole section */
  font-family: 'Inter', sans-serif;
}

.standard-inner {
  max-width: 1100px;
  margin: auto;
  text-align: center;
}

.standard-header {
  margin-bottom: 100px;
}

.standard-kicker {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

.standard-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(42px, 5vw, 58px);
  letter-spacing: 6px;
  font-weight: 600;
  margin-top: 20px;
}

.standard-line {
  width: 60px;
  height: 1px;
  background: rgba(255,255,255,0.15);
  margin: 30px auto 0;
}

.standard-line.small {
  margin-bottom: 30px;
}

.standard-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 100px;
  text-align: left;
}

.standard-item h3 {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 18px;
}

/* FIX #6: Body copy uses Inter, not Cinzel */
.standard-item p {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.9;
  color: rgba(255,255,255,0.75);
}

.standard-footer {
  margin-top: 120px;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  text-align: center;
}

/* ==================================================
   FOOTER
================================================== */

.vault-footer {
  padding: 80px 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  max-width: 1100px;
  margin: auto;
}

.footer-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
}

.footer-label {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.footer-brand {
  font-family: 'Cinzel', serif;
  letter-spacing: 4px;
  font-size: 18px;
  margin-top: 80px;
  text-align: center;
}

/* FIX #2: Removed duplicate .footer-meta, kept one clean version */
.footer-meta {
  margin-top: 10px;
  text-align: center;
  font-size: 11px;
  color: #777;
}

/* ==================================================
   CAR HERO (individual listing pages)
================================================== */

.car-hero {
  aspect-ratio: 4 / 3;
}

.car-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
}

/* ==================================================
   RESPONSIVE — 1024px
================================================== */

@media (max-width: 1024px) {
  .inventory-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==================================================
   RESPONSIVE — 768px
================================================== */

@media (max-width: 768px) {

  body {
    padding-top: 105px;
  }

  .vault-triad {
    flex-direction: column;
    gap: 10px;
  }

  /* Reduce hero padding on mobile */
  .vault-hero-elite {
    padding: 32px 20px 24px;
  }

  /* Tighten vault sections */
  .vault-section {
    margin-top: 20px;
    padding-bottom: 48px;
  }

  /* Archive button spacing */
  .archive-cta {
    margin-top: 32px;
  }

  /* Sourcing section */
  .vault-sourcing {
    padding: 64px 24px;
  }

  /* Access section */
  .vault-access {
    padding: 64px 24px;
  }

  /* Sell section */
  .sell-section {
    padding: 64px 24px 48px;
  }

  .sell-mark {
    margin-bottom: 40px;
  }

  .sell-line {
    margin: 0 auto 40px;
  }

  .sell-text {
    margin-bottom: 40px;
  }

  .sell-features {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
  }

  .sell-features span::after {
    display: none;
  }

  /* Standard section */
  .vault-standard-elite {
    margin: 0;
    padding: 64px 24px;
  }

  .standard-header {
    margin-bottom: 56px;
  }

  .standard-footer {
    margin-top: 64px;
  }

  /* Footer */
  .vault-footer {
    padding: 48px 20px;
  }

  .footer-brand {
    margin-top: 48px;
  }

}

/* ==================================================
   RESPONSIVE — 640px
================================================== */

@media (max-width: 640px) {

  .header {
    height: auto;
  }

  .header-logo img {
    height: 55px;
  }

  body {
    padding-top: 90px;
  }

  .inventory-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 18px;
  }

  .standard-columns {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Tighter footer cards on mobile */
  .footer-card {
    padding: 24px;
  }

  form {
    padding: 0 20px;
  }

}
