/* ============================================
   PC-OBD Kft - Responsive CSS
   Mobile-first approach
   ============================================ */

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) {
  .container {
    padding: 0 var(--spacing-md);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .navbar-menu {
    gap: var(--spacing-md);
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero p {
    font-size: 1.125rem;
  }

  .section-title h2 {
    font-size: 2rem;
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile (320px - 767px) */
@media (max-width: 767px) {
  :root {
    --spacing-xl: 32px;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.375rem; }

  .container {
    padding: 0 var(--spacing-sm);
  }

  /* Grid - 1 column on mobile */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .col-1, .col-2, .col-3, .col-4,
  .col-6, .col-8, .col-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Header & Navigation */
  .navbar {
    flex-wrap: wrap;
  }

  .navbar-brand img {
    height: 40px;
  }

  .navbar-toggle {
    display: block;
  }

  .navbar-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding: var(--spacing-sm) 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-white);
    box-shadow: var(--shadow-md);
  }

  .navbar-menu.active {
    display: flex;
  }

  .navbar-menu li {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid var(--color-light-gray);
  }

  .navbar-menu a {
    display: block;
    padding: var(--spacing-sm);
  }

  /* Hero Section */
  .hero {
    padding: var(--spacing-lg) 0;
    /* Mobilon a teljes 1920 px-es hero felesleges: a kepernyo szelessege x a
       keperyofelbontas (DPR) hatarozza meg, mi kell. 1x-en 768, 2x-en 1536,
       3x-en 1920 - vagyis EGYIK eszkoz sem kap kisebb kepet, mint amennyi a
       lathato minoseghez kell, de az 1x-es telefon 121 KB helyett 23,6 KB-ot tolt.

       A tores (767px) es a valtozatok EGYEZNEK az include/fej.php elotolto
       sorainak media-feltetelevel es imagesrcset-jevel. Ha az egyiket atirod,
       a masikat IS at kell irni, kulonben a kep ketszer toltodik le. */
    background-image: -webkit-image-set(
      url('../images/hero-banner-768.webp') 1x,
      url('../images/hero-banner-1536.webp') 2x,
      url('../images/hero-banner-1920.webp') 3x);
    background-image: image-set(
      url('../images/hero-banner-768.webp') 1x,
      url('../images/hero-banner-1536.webp') 2x,
      url('../images/hero-banner-1920.webp') 3x);
  }

  .hero h1 {
    font-size: 1.875rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-buttons .btn {
    width: 100%;
  }

  /* Section Title */
  .section-title h2 {
    font-size: 1.75rem;
  }

  .section-subtitle {
    font-size: 1rem;
  }

  /* Buttons */
  .btn {
    padding: 12px 20px;
    font-size: 0.9375rem;
  }

  .btn-lg {
    padding: 14px 24px;
    font-size: 1rem;
  }

  /* Cards */
  .card-img {
    height: 180px;
  }

  .card-body {
    padding: var(--spacing-sm);
  }

  .card-title {
    font-size: 1.125rem;
  }

  /* Service Cards */
  .service-card {
    padding: var(--spacing-md);
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  /* Product Grid */
  .product-grid {
    grid-template-columns: 1fr;
  }

  /* Filters - Offcanvas style on mobile */
  .filters {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background-color: var(--color-white);
    box-shadow: var(--shadow-lg);
    transition: left var(--transition-normal);
    overflow-y: auto;
    z-index: 1001;
    padding: var(--spacing-md);
  }

  .filters.active {
    left: 0;
  }

  .filters-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
    z-index: 1000;
  }

  .filters-overlay.active {
    opacity: 1;
    pointer-events: all;
  }

  /* Modal */
  .modal-content {
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-body {
    padding: var(--spacing-md);
  }

  .modal-body .row {
    margin: 0;
  }

  .modal-body .col-12,
  .modal-body .col-md-6 {
    padding: 0;
  }

  .gallery-main {
    max-height: 250px;
    margin-bottom: var(--spacing-sm);
  }

  .image-gallery {
    margin-bottom: var(--spacing-sm);
  }

  /* Form */
  .form-row {
    flex-direction: column;
  }

  .form-group {
    margin-bottom: var(--spacing-sm);
  }
}

/* Touch-friendly buttons on mobile */
@media (max-width: 767px) {
  .btn,
  button,
  a.btn,
  input[type="submit"],
  input[type="button"] {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Large Screens (1200px+) */
@media (min-width: 1200px) {
  .container {
    max-width: 1200px;
  }

  .hero h1 {
    font-size: 3.5rem;
  }

  .section-title h2 {
    font-size: 2.75rem;
  }
}

/* Extra Large Screens (1400px+) */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
}

/* Low-height desktop/laptop tuning (e.g. 1280x768, 1366x768) */
@media (min-width: 768px) and (max-height: 820px) {
  .home-page .navbar {
    padding: 10px 0;
  }

  .home-page .navbar-brand img {
    height: 54px;
  }

  .home-page .hero {
    padding: clamp(18px, 3.2vh, 28px) 0;
    min-height: clamp(320px, 52vh, 420px);
    min-height: clamp(320px, 52dvh, 420px);
    background-position: center 45%;
  }

  .home-page .hero h1 {
    font-size: clamp(2rem, 3.2vw, 2.4rem);
    margin-bottom: 14px;
  }

  .home-page .hero p {
    font-size: clamp(0.95rem, 1.3vw, 1.05rem);
    margin-bottom: 18px;
  }

  .home-page .hero-buttons {
    gap: 12px;
  }

  .home-page .btn-lg {
    padding: 12px 28px;
    font-size: 1rem;
  }

  .home-page section {
    padding: 52px 0;
  }

  .home-page #services {
    padding-top: 40px;
  }

  .home-page #services .section-title {
    margin-bottom: 30px;
  }

  .home-page #services .section-title h2 {
    font-size: clamp(1.8rem, 2.8vw, 2.2rem);
  }

  .home-page #services .section-subtitle {
    margin-top: 8px;
    font-size: 1rem;
  }

  .home-page #services .service-card {
    padding: 22px;
  }

  .home-page #services .service-image {
    height: 250px;
    margin-bottom: 14px;
  }

  .home-page #services .service-card h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
  }

  .home-page #services .service-card p {
    font-size: 0.95rem;
    margin-bottom: 14px;
  }
}

/* Extra compact adjustments for very short desktop heights */
@media (min-width: 768px) and (max-height: 760px) {
  .home-page .navbar {
    padding: 8px 0;
  }

  .home-page .navbar-brand img {
    height: 50px;
  }

  .home-page .hero {
    padding: 16px 0;
    min-height: clamp(300px, 48vh, 370px);
    min-height: clamp(300px, 48dvh, 370px);
    background-position: center 42%;
  }

  .home-page .hero h1 {
    font-size: clamp(1.9rem, 3vw, 2.2rem);
    margin-bottom: 12px;
  }

  .home-page .hero p {
    margin-bottom: 16px;
  }

  .home-page section {
    padding: 44px 0;
  }

  .home-page #services {
    padding-top: 34px;
  }

  .home-page #services .section-title {
    margin-bottom: 24px;
  }

  .home-page #services .service-card {
    padding: 18px;
  }

  .home-page #services .service-image {
    height: 230px;
  }
}

/* Print Styles */
@media print {
  header,
  footer,
  .navbar,
  .hero-buttons,
  .btn,
  .filters {
    display: none;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* Landscape Mode on Mobile */
@media (max-width: 767px) and (orientation: landscape) {
  .hero {
    padding: var(--spacing-md) 0;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .hero p {
    font-size: 0.9375rem;
  }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
  /* Jelenleg nem használjuk, de előkészítve a jövőre */
  /* body {
    background-color: #1a1a1a;
    color: #e0e0e0;
  } */
}
