/* =========================================================================
   DEEP HYUNDAI — style.css
   Single stylesheet, no framework. Mobile-first. Breakpoints: 640 / 1024 / 1280.
   ========================================================================= */

:root {
  --primary: #002C5F;
  --primary-dark: #001b3d;
  --accent: #00AAD2;
  --text: #1A1A1A;
  --muted: #6B7280;
  --bg: #FFFFFF;
  --bg-alt: #F5F7FA;
  --border: #E5E7EB;
  --danger: #C0152F;
  --danger-bg: #FDECEE;
  --success-bg: #ECFDF5;

  --container-width: 1280px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.2);
  --transition: 200ms ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

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

h1, h2, h3, h4, p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: 1rem;
}

body.modal-open {
  overflow: hidden;
}

/* ---------------------------- Focus states ------------------------------ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 48px 0;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  margin-bottom: 8px;
}

.section-subtitle {
  text-align: center;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto 32px;
}

/* ------------------------------- Buttons -------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: #0090b3;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ============================== HEADER ================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
}

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-img {
  height: 32px;
  width: auto;
  display: block;
}

@media (min-width: 640px) {
  .logo-img {
    height: 42px;
  }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.wordmark {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

@media (min-width: 640px) {
  .wordmark {
    font-size: 1.15rem;
  }
}

.call-cta {
  flex-shrink: 0;
  font-size: 0.85rem;
  padding: 10px 16px;
}

.call-cta .call-cta__full {
  display: none;
}

@media (min-width: 640px) {
  .call-cta {
    font-size: 0.95rem;
  }
  .call-cta .call-cta__full {
    display: inline;
  }
  .call-cta .call-cta__short {
    display: none;
  }
}

/* =============================== HERO =================================== */
.hero {
  position: relative;
}

.hero-carousel {
  position: relative;
  width: 100%;
  height: 56vw;
  min-height: 260px;
  max-height: 640px;
  overflow: hidden;
  background: var(--primary);
}

.hero-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 600ms ease;
}

.hero-slide.is-active {
  opacity: 1;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
  padding: 24px;
  background: linear-gradient(180deg, rgba(0, 44, 95, 0.15) 0%, rgba(0, 44, 95, 0.55) 100%);
}

.hero-title {
  color: #fff;
  font-size: 1.75rem;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  max-width: 720px;
}

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  color: var(--primary);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition), transform var(--transition);
}

.hero-arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.05);
}

.hero-arrow--prev {
  left: 12px;
}

.hero-arrow--next {
  right: 12px;
}

.hero-dots {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 5;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: transparent;
  padding: 0;
  transition: background-color var(--transition);
}

.hero-dot.is-active {
  background: #fff;
}

@media (min-width: 640px) {
  .hero-title {
    font-size: 2.25rem;
  }
}

@media (min-width: 1024px) {
  .hero-title {
    font-size: 2.75rem;
  }
}

/* =========================== "OUR MODELS" GRID =========================== */
.car-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (min-width: 640px) {
  .car-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

@media (min-width: 1024px) {
  .car-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.car-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 0 0 16px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.car-card:hover,
.car-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.car-card__image-wrap {
  display: block;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #F5F7FA 0%, #E5EAF0 100%);
  padding: 12px;
}

.car-card__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.car-card__name {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  padding: 14px 14px 4px;
}

.car-card__tagline {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0 14px;
}

/* ========================= WHY CHOOSE DEEP HYUNDAI ======================= */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.feature-card {
  text-align: center;
  padding: 28px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.feature-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  color: var(--accent);
}

.feature-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--primary);
}

.feature-desc {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ============================ SHOWROOM INFO ============================== */
.showroom-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}

.showroom-tab {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

.showroom-tab:hover {
  border-color: var(--accent);
}

.showroom-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.showroom-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
}

@media (min-width: 1024px) {
  .showroom-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.showroom-info h3 {
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 12px;
}

.showroom-info p {
  margin-bottom: 12px;
  color: var(--text);
}

.showroom-info .label {
  font-weight: 600;
  color: var(--muted);
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.showroom-map {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-alt);
}

.showroom-map iframe {
  width: 100%;
  height: 320px;
  border: 0;
  display: block;
}

/* ================================ FOOTER ================================= */
.site-footer {
  background: var(--primary);
  color: #fff;
  padding: 40px 0 24px;
}

.footer-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  text-align: center;
}

@media (min-width: 640px) {
  .footer-grid {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-brand {
  font-weight: 700;
  font-size: 1.1rem;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  opacity: 0.85;
  transition: opacity var(--transition);
}

.footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

.social-links {
  display: flex;
  gap: 14px;
}

.social-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition);
}

.social-icon:hover {
  background: var(--accent);
}

.social-icon svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

.footer-bottom {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
  font-size: 0.82rem;
  opacity: 0.75;
}

/* ================================ MODAL =================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 920px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: sticky;
  top: 12px;
  left: 100%;
  transform: translateX(0);
  margin: 12px 12px -40px auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.modal-close:hover {
  background: var(--primary);
}

.modal-banner {
  width: 100%;
  height: 320px;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-banner[hidden] {
  display: none;
}

.modal-banner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (min-width: 640px) {
  .modal-banner {
    height: 420px;
  }
}

@media (min-width: 1024px) {
  .modal-banner {
    height: 600px;
  }
}

.modal-body {
  padding: 24px 24px 32px;
}

.modal-body h2 {
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 6px;
}

.modal-tagline {
  color: var(--muted);
  margin-bottom: 20px;
}

.modal-tagline[hidden] {
  display: none;
}

/* ------------------------------ Form ------------------------------------ */
.form-error-banner {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.form-error-banner[hidden] {
  display: none;
}

.test-drive-form[hidden] {
  display: none;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

@media (min-width: 640px) {
  .form-row--two {
    grid-template-columns: 1fr 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group input,
.form-group textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

.form-group input[readonly] {
  background: var(--bg-alt);
  color: var(--muted);
}

.form-group input[aria-invalid="true"],
.form-group textarea[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  display: block;
  min-height: 1.1em;
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 4px;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
}

.checkbox-group input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.checkbox-group label {
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text);
}

.submit-btn {
  width: 100%;
  margin-top: 20px;
  position: relative;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  display: none;
  animation: spin 700ms linear infinite;
}

.submit-btn.is-loading .spinner {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.thank-you-panel {
  text-align: center;
  padding: 32px 8px;
}

.thank-you-panel[hidden] {
  display: none;
}

.thank-you-panel p {
  font-size: 1.05rem;
  margin-bottom: 20px;
}

/* ============================ STATIC PAGES ================================ */
.page-hero {
  background: var(--bg-alt);
  padding: 48px 0;
  text-align: center;
}

.page-hero h1 {
  color: var(--primary);
  font-size: 2rem;
}

.prose {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px;
}

.prose h2 {
  color: var(--primary);
  font-size: 1.3rem;
  margin: 32px 0 12px;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p {
  margin-bottom: 14px;
  color: var(--text);
}

.prose ul {
  list-style: disc;
  padding-left: 22px;
  margin-bottom: 14px;
}

.prose ul li {
  margin-bottom: 6px;
}

@media (min-width: 1024px) {
  .section-title {
    font-size: 2.1rem;
  }
  .page-hero h1 {
    font-size: 2.5rem;
  }
}
