/* ============================================================
   César Carreira Auto – Main CSS
   ============================================================ */

/* ─── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #111827;
  background: #f9fafb;
}

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

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

/* ─── Brand Colors (CSS vars) ───────────────────────────── */
:root {
  --brand-50:  #fff4ed;
  --brand-100: #ffe6d4;
  --brand-200: #ffc9a8;
  --brand-300: #ffa471;
  --brand-400: #ff7a38;
  --brand-500: #FF6F20;
  --brand-600: #f04e06;
  --brand-700: #c73807;
  --brand-800: #9e2e0d;
  --brand-900: #7f280e;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.1);
}

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: #f1f5f9; }
::-webkit-scrollbar-thumb  { background: var(--brand-500); border-radius: 3px; }

/* ─── Utility ──────────────────────────────────────────── */
.brand-gradient {
  background: linear-gradient(135deg, #FF6F20 0%, #ff4500 100%);
}

.btn-brand {
  background: linear-gradient(135deg, #FF6F20 0%, #ff4500 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
}
.btn-brand:hover   { opacity: .9; transform: translateY(-1px); }
.btn-brand:active  { transform: translateY(0); }

.btn-outline {
  border: 2px solid var(--brand-500);
  color: var(--brand-500);
  background: transparent;
  cursor: pointer;
  transition: all .2s;
}
.btn-outline:hover { background: var(--brand-500); color: #fff; }

/* ─── Navbar ────────────────────────────────────────────── */
nav a.nav-link {
  position: relative;
  padding-bottom: 2px;
}
nav a.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand-500);
  transition: width .3s ease;
}
nav a.nav-link:hover::after,
nav a.nav-link.active::after { width: 100%; }

/* ─── Mobile menu transitions ───────────────────────────── */
.mobile-menu {
  transform: translateX(100%);
  transition: transform .3s ease;
}
.mobile-menu.open { transform: translateX(0); }
.overlay { opacity: 0; pointer-events: none; transition: opacity .3s; }
.overlay.show { opacity: 1; pointer-events: all; }
.overlay.open { opacity: 1; pointer-events: all; }

/* ─── Ficha de Viatura – Sidebar Sticky ────────────────── */
.sticky { position: -webkit-sticky; position: sticky; }
.top-20 { top: 5rem; }

/* Ficha Técnica – tabela dividida */
.ficha-col {
  border-right: 1px solid #f9fafb;
}
.ficha-row {
  border-bottom: 1px solid #f9fafb;
  padding: 0.6rem 1rem;
}
.ficha-row:last-child { border-bottom: none; }

/* Hover na galeria de thumbs */
.thumb { cursor: pointer; }
.thumb img { transition: transform .3s ease; }
.thumb:hover img { transform: scale(1.05); }

/* Hover cards semelhantes */
.card-hover {
  transition: transform .25s ease, box-shadow .25s ease;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0,0,0,.1);
}
.img-zoom { overflow: hidden; }
.img-zoom img { transition: transform .4s ease; }
.img-zoom:hover img { transform: scale(1.04); }

/* ─── Hero Section ──────────────────────────────────────── */
.hero-bg {
  background: linear-gradient(160deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
  position: relative;
  overflow: hidden;
}
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/assets/img/hero-bg.jpg') center/cover no-repeat;
  opacity: .15;
}

/* ─── Cards de Viatura ──────────────────────────────────── */
.viatura-card {
  background: #fff;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid #f3f4f6;
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
}
.viatura-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.viatura-card .card-img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: #f3f4f6;
  transition: transform .4s ease;
}
.viatura-card:hover .card-img { transform: scale(1.03); }

.card-img-wrapper {
  overflow: hidden;
  position: relative;
}

/* Badge destaque */
.badge-destaque {
  position: absolute;
  top: .6rem;
  left: .6rem;
  background: linear-gradient(135deg, #FF6F20, #ff4500);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  padding: .25rem .6rem;
  border-radius: .4rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  z-index: 2;
}

/* Estado badge */
.badge-estado {
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: .4rem;
}
.badge-disponivel  { background: #dcfce7; color: #166534; }
.badge-reservada   { background: #fef9c3; color: #854d0e; }
.badge-vendida     { background: #fee2e2; color: #991b1b; }

/* Preço anterior riscado */
.preco-anterior {
  text-decoration: line-through;
  color: #9ca3af;
  font-size: .8rem;
}

/* ─── Filtros ───────────────────────────────────────────── */
.filter-card {
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #e5e7eb;
  box-shadow: var(--shadow-sm);
}

.filter-input {
  width: 100%;
  border: 1.5px solid #e5e7eb;
  border-radius: .75rem;
  padding: .65rem 1rem;
  font-size: .875rem;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  color: #111827;
  appearance: none;
}
.filter-input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(255,111,32,.1);
}

/* ─── Ficha de Viatura ──────────────────────────────────── */
.viatura-detail-img {
  border-radius: 1.25rem;
  overflow: hidden;
  aspect-ratio: 16/10;
  background: #f3f4f6;
}
.viatura-detail-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: .5rem;
  margin-top: .75rem;
}
.thumb-item {
  aspect-ratio: 1;
  border-radius: .5rem;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .2s;
}
.thumb-item:hover,
.thumb-item.active { border-color: var(--brand-500); }
.thumb-item img    { width: 100%; height: 100%; object-fit: cover; }

/* Specs grid */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .5rem;
}
@media (min-width: 640px) { .specs-grid { grid-template-columns: repeat(3, 1fr); } }

.spec-item {
  background: #f9fafb;
  border-radius: .75rem;
  padding: .75rem;
  text-align: center;
  border: 1px solid #f3f4f6;
}
.spec-item i     { font-size: 1.2rem; color: var(--brand-500); margin-bottom: .4rem; display: block; }
.spec-value      { font-weight: 700; font-size: .9rem; color: #111827; }
.spec-label      { font-size: .7rem; color: #9ca3af; margin-top: .15rem; }

/* Extras chips */
.extras-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.extra-chip {
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-100);
  border-radius: .4rem;
  padding: .25rem .65rem;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ─── Formulário de Contacto / Lead ─────────────────────── */
.form-input {
  width: 100%;
  border: 1.5px solid #e5e7eb;
  border-radius: .75rem;
  padding: .75rem 1rem;
  font-size: .875rem;
  transition: border-color .2s, box-shadow .2s;
  background: #fff;
  color: #111827;
  font-family: inherit;
}
.form-input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(255,111,32,.1);
}

/* ─── Reviews ───────────────────────────────────────────── */
.review-card {
  background: #fff;
  border-radius: 1.25rem;
  padding: 1.5rem;
  border: 1px solid #f3f4f6;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}
.review-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stars { color: #facc15; letter-spacing: .1rem; }

/* ─── Toast ─────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.toast {
  padding: .75rem 1.25rem;
  border-radius: .75rem;
  font-size: .875rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  animation: toastIn .3s ease;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.toast.success { background: #22c55e; color: #fff; }
.toast.error   { background: #ef4444; color: #fff; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Skeleton loading ──────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: .5rem;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Seção Destaques (Homepage) ────────────────────────── */
.section-title {
  font-size: 1.75rem;
  font-weight: 900;
  color: #111827;
  letter-spacing: -.02em;
}
.section-subtitle {
  color: #6b7280;
  font-size: .9375rem;
  margin-top: .35rem;
}
.section-divider {
  width: 3.5rem;
  height: 4px;
  background: var(--brand-500);
  border-radius: 2px;
  margin-top: .75rem;
}

/* ─── Lightbox / Galeria ────────────────────────────────── */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
#lightbox img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: .75rem;
  object-fit: contain;
}
.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-btn:hover { background: rgba(255,111,32,.6); }
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  font-size: 1.2rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background .2s;
}
.lightbox-close:hover { background: rgba(255,0,0,.5); }

/* ─── Pagination ────────────────────────────────────────── */
.page-btn {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: .5rem;
  font-size: .875rem;
  font-weight: 600;
  border: 1.5px solid #e5e7eb;
  cursor: pointer;
  transition: all .2s;
  background: #fff;
  color: #374151;
}
.page-btn:hover { border-color: var(--brand-500); color: var(--brand-500); }
.page-btn.active {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
}
.page-btn.disabled { opacity: .4; cursor: not-allowed; }

/* ─── Sobre page ────────────────────────────────────────── */
.team-card {
  background: #fff;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid #f3f4f6;
  text-align: center;
  padding: 1.5rem;
  transition: transform .25s;
}
.team-card:hover { transform: translateY(-3px); }
.team-avatar {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto .75rem;
  border: 3px solid var(--brand-100);
}

/* ─── Contacto page ─────────────────────────────────────── */
.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #f3f4f6;
}
.contact-info-item:last-child { border-bottom: none; }
.contact-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--brand-50);
  border-radius: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-500);
  flex-shrink: 0;
}

/* ─── WhatsApp FAB ──────────────────────────────────────── */
.whatsapp-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3.5rem;
  height: 3.5rem;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 16px rgba(37,211,102,.4);
  z-index: 999;
  transition: transform .3s, box-shadow .3s;
}
.whatsapp-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 22px rgba(37,211,102,.5);
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 640px) {
  .section-title { font-size: 1.4rem; }
  .specs-grid    { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Print ─────────────────────────────────────────────── */
@media print {
  nav, footer, .whatsapp-fab, #toast-container { display: none !important; }
  body { background: #fff; }
}
