/* ============================================================
   CarsGanino – Public Stylesheet
   ============================================================ */
:root {
  --cg-dark:    #1a1a2e;
  --cg-accent:  #d4262b;
  --cg-accent2: #e63946;
  --cg-grey:    #6c757d;
  --cg-light:   #f4f6f9;
  --cg-border:  #e2e8f0;
  --cg-white:   #ffffff;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--cg-light);
  color: #2d3748;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Navbar ── */
.bg-dark-custom { background: var(--cg-dark) !important; }
.navbar { box-shadow: 0 2px 12px rgba(0,0,0,.25); }
.navbar-brand { padding: 0; }
.logo-img { object-fit: contain; filter: brightness(0) invert(1); }

.btn-accent {
  background: var(--cg-accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  transition: background .2s;
}
.btn-accent:hover { background: var(--cg-accent2); color: #fff; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--cg-dark) 0%, #16213e 60%, #0f3460 100%);
  color: #fff;
  padding: 90px 0 70px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--cg-light);
  clip-path: ellipse(55% 100% at 50% 100%);
}
.hero-badge {
  display: inline-block;
  background: var(--cg-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.15; }
.hero p.lead { opacity: .8; font-weight: 300; }

/* ── Search Box ── */
.search-box {
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 16px;
  padding: 28px 28px 22px;
}
.search-box .form-control, .search-box .form-select {
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.12);
  color: #fff;
  height: 44px;
}
.search-box .form-control::placeholder { color: rgba(255,255,255,.5); }
.search-box .form-control:focus, .search-box .form-select:focus {
  background: rgba(255,255,255,.2);
  box-shadow: 0 0 0 3px rgba(212,38,43,.3);
  border-color: var(--cg-accent);
  color: #fff;
}
.search-box .form-select option { background: var(--cg-dark); color: #fff; }
.btn-search {
  background: var(--cg-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  height: 44px;
  font-weight: 700;
  letter-spacing: .5px;
  transition: background .2s, transform .15s;
}
.btn-search:hover { background: var(--cg-accent2); transform: translateY(-1px); color: #fff; }

/* ── Section ── */
.section-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--cg-dark);
  position: relative;
  padding-bottom: 10px;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 48px; height: 4px;
  background: var(--cg-accent);
  border-radius: 2px;
}

/* ── Vehicle Card ── */
.vehicle-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  transition: transform .25s, box-shadow .25s;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.vehicle-card:hover { transform: translateY(-5px); box-shadow: 0 12px 32px rgba(0,0,0,.12); }
.vehicle-card a { text-decoration: none; color: inherit; }

.card-img-wrap {
  position: relative;
  overflow: hidden;
  background: #f0f0f0;
  aspect-ratio: 4/3;
}
/* Il badge di stato è fuori dal link, quindi il link deve riempire il wrapper */
.card-img-wrap > a { display: block; width: 100%; height: 100%; }
.card-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.vehicle-card:hover .card-img-wrap img { transform: scale(1.05); }

.card-badge {
  position: absolute;
  top: 12px; left: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 3px 10px;
  border-radius: 20px;
}
.badge-disponibile { background: #22c55e; color: #fff; }
.badge-riservato   { background: #f59e0b; color: #fff; }
.badge-venduto     { background: #ef4444; color: #fff; }
.badge-featured    { background: var(--cg-accent); color: #fff; }

.card-body-custom { padding: 18px 20px 14px; flex: 1; display: flex; flex-direction: column; }
.card-title-vehicle {
  font-size: 1rem;
  font-weight: 700;
  color: var(--cg-dark);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-version {
  font-size: .8rem;
  color: var(--cg-grey);
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-specs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.card-spec {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .78rem;
  color: var(--cg-grey);
}
.card-spec i { font-size: .85rem; }
.card-price {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--cg-accent);
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--cg-border);
}
.btn-card {
  background: var(--cg-dark);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  padding: 8px 16px;
  transition: background .2s;
  text-decoration: none;
  display: inline-block;
}
.btn-card:hover { background: var(--cg-accent); color: #fff; }

/* ── Filter Sidebar ── */
.filter-panel {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  position: sticky;
  top: 80px;
}
.filter-panel h6 { font-weight: 700; color: var(--cg-dark); font-size: .85rem; text-transform: uppercase; letter-spacing: 1px; }
.filter-panel .form-control,
.filter-panel .form-select { font-size: .875rem; border-radius: 8px; }
.btn-filter-apply {
  background: var(--cg-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  width: 100%;
  padding: 10px;
  transition: background .2s;
}
.btn-filter-apply:hover { background: var(--cg-accent2); color: #fff; }
.btn-filter-reset {
  background: transparent;
  color: var(--cg-grey);
  border: 1px solid var(--cg-border);
  border-radius: 8px;
  font-weight: 500;
  width: 100%;
  padding: 8px;
  font-size: .85rem;
  transition: all .2s;
}
.btn-filter-reset:hover { background: var(--cg-light); }

/* ── Sort Bar ── */
.sort-bar {
  background: #fff;
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
}

/* ── Vehicle Detail ── */
.vehicle-gallery .carousel-item img {
  width: 100%;
  height: 450px;
  object-fit: cover;
  border-radius: 14px;
}
.gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.gallery-thumb {
  width: 80px; height: 60px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  opacity: .7;
  transition: opacity .2s, outline .2s;
  border: 2px solid transparent;
}
.gallery-thumb:hover, .gallery-thumb.active { opacity: 1; border-color: var(--cg-accent); }

.spec-table { width: 100%; }
.spec-table td { padding: 8px 0; border-bottom: 1px solid var(--cg-border); font-size: .9rem; }
.spec-table td:first-child { color: var(--cg-grey); width: 45%; }
.spec-table td:last-child { font-weight: 600; color: var(--cg-dark); }

.price-box {
  background: linear-gradient(135deg, var(--cg-dark), #16213e);
  color: #fff;
  border-radius: 14px;
  padding: 28px;
}
.price-box .price-label { font-size: .85rem; opacity: .7; text-transform: uppercase; letter-spacing: 1px; }
.price-box .price-value { font-size: 2.4rem; font-weight: 800; color: #fff; }
.btn-contact-vehicle {
  background: var(--cg-accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 28px;
  font-weight: 700;
  font-size: 1rem;
  width: 100%;
  transition: background .2s;
}
.btn-contact-vehicle:hover { background: var(--cg-accent2); color: #fff; }

/* ── Contact Page ── */
.contact-card {
  background: #fff;
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.contact-info-item { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.contact-info-icon {
  width: 44px; height: 44px;
  background: var(--cg-light);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  color: var(--cg-accent);
  flex-shrink: 0;
}
.btn-submit {
  background: var(--cg-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 32px;
  font-weight: 700;
  font-size: 1rem;
  transition: background .2s;
}
.btn-submit:hover { background: var(--cg-accent2); color: #fff; }

/* ── About Strip ── */
.about-strip { background: var(--cg-dark); color: #fff; padding: 60px 0; }
.about-strip .stat-number { font-size: 2.5rem; font-weight: 800; color: var(--cg-accent); }
.about-strip .stat-label { font-size: .85rem; opacity: .7; }

/* ── Newsletter Strip ── */
.newsletter-strip { background: var(--cg-accent); color: #fff; padding: 60px 0; }
.newsletter-strip h2 { font-weight: 800; }
.newsletter-strip .form-control { border: none; border-radius: 8px 0 0 8px; height: 48px; }
.newsletter-strip .btn-nl { background: var(--cg-dark); color: #fff; border: none; border-radius: 0 8px 8px 0; height: 48px; font-weight: 700; padding: 0 24px; }

/* ── Pagination ── */
.pagination .page-link { border-radius: 8px !important; margin: 0 3px; border: none; color: var(--cg-dark); font-weight: 500; }
.pagination .page-item.active .page-link { background: var(--cg-accent); color: #fff; }

/* ── Footer ── */
.footer { margin-top: auto; }
.footer-top { background: var(--cg-dark); color: #aaa; padding: 60px 0 40px; }
.footer-bottom { background: #111; color: #666; padding: 16px 0; }
.footer-heading { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; margin-bottom: 16px; }
.footer-links { padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #aaa; text-decoration: none; font-size: .875rem; transition: color .2s; }
.footer-links a:hover { color: var(--cg-accent); }
.footer-links li:not(:has(a)) { font-size: .875rem; }
.footer .small { color: #f4f4f4 !important; font-size: .875rem; }
.logo-img-footer { filter: brightness(0) invert(1); opacity: .85; }
.social-link { color: #aaa; font-size: 1.3rem; transition: color .2s; }
.social-link:hover { color: var(--cg-accent); }

/* ── Alerts ── */
.alert-cg { border-radius: 10px; font-weight: 500; }

/* ── Breadcrumb ── */
.breadcrumb-bar { background: #fff; border-bottom: 1px solid var(--cg-border); padding: 12px 0; }
.breadcrumb { margin: 0; }
.breadcrumb-item a { color: var(--cg-accent); text-decoration: none; }

/* ── Misc ── */
.text-accent { color: var(--cg-accent) !important; }
.bg-accent { background: var(--cg-accent) !important; }
.no-image-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: #f0f2f5;
  color: #ccc; font-size: 3rem;
}

/* ── Container globale ── */
.container {
  max-width: none !important;
  width: 90% !important;
}
@media (max-width: 767px) {
  .container {
    width: 96% !important;
  }
}
