/* Mobile First Responsive Design */

/* Extra small devices (portrait phones, less than 480px) */
@media (max-width: 479.98px) {
  .contact {
    padding: 2rem 0;
  }
  
  .contact-container {
    gap: 1.5rem;
  }
  
  .contact-content .section-title {
    font-size: 1.8rem;
    line-height: 1.2;
  }
  
  .contact-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .contact-info {
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }
  
  .contact-item {
    padding: 1rem 0.75rem;
    font-size: 1rem;
  }
  
  .contact-item i {
    font-size: 1.1rem;
  }
  
  .contact-cta {
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
  }
}

/* Small devices (landscape phones, 576px and up) */
@media (max-width: 575.98px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  
  .hero-buttons .btn {
    text-align: center;
  }
  
  .quote-form-wrapper {
    padding: 2rem 1rem;
  }
  
  .cookie-content {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 1rem;
  }
  
  .contact-info {
    text-align: center;
  }
  
  /* Contact section mobile styles */
  .contact {
    padding: 3rem 0;
  }
  
  .contact-container {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  
  .contact-content .section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
  }
  
  .contact-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
  }
  
  .contact-info {
    gap: 1rem;
    margin-bottom: 2rem;
  }
  
  .contact-item {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem 1rem;
    gap: 0.5rem;
  }
  
  .contact-item:hover {
    transform: translateY(-5px);
  }
  
  .contact-cta {
    padding: 1rem 2rem;
    font-size: 1rem;
    width: 100%;
    max-width: 280px;
  }
  
  .navbar-nav {
    text-align: center;
    padding-top: 1rem;
  }
  
  .language-switcher {
    justify-content: center;
    margin: 1rem 0;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
  .hero-title {
    font-size: 3rem;
  }
  
  .section-title {
    font-size: 2.25rem;
  }
  
  .hero-buttons {
    justify-content: center;
  }
  
  .service-card {
    margin-bottom: 2rem;
  }
  
  .value-card {
    margin-bottom: 2rem;
  }
  
  /* Contact section tablet styles */
  .contact-container {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  
  .contact-content .section-title {
    text-align: center;
  }
  
  .contact-item {
    justify-content: center;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .hero-title {
    font-size: 3.5rem;
  }
  
  .container {
    max-width: 720px;
  }
  
  .message-content {
    padding-right: 1rem;
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 992px) {
  .hero-title {
    font-size: 4rem;
  }
  
  .navbar-expand-lg .navbar-nav {
    flex-direction: row;
  }
  
  .navbar-expand-lg .navbar-collapse {
    display: flex !important;
    flex-basis: auto;
  }
}

/* Custom responsive utilities */
@media (max-width: 991.98px) {
  .hero {
    text-align: center;
  }
  
  .message-content {
    text-align: center;
    padding-right: 0;
    margin-bottom: 2rem;
  }
  
  .contact {
    text-align: center;
  }
  
  .contact-container {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .contact-content .section-title {
    text-align: center;
  }
  
  .values .row {
    justify-content: center;
  }
  
  .services .row {
    justify-content: center;
  }
}

/* Mobile menu styles */
@media (max-width: 991.98px) {
  .navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
  }
  
  .navbar-toggler:focus {
    box-shadow: none;
  }
  
  .navbar-collapse {
    background: var(--white);
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
  }
  
  .navbar-nav .nav-item {
    margin: 0.5rem 0;
  }
  
  .phone-number {
    display: inline-block;
    margin: 1rem 0;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .service-card:hover,
  .value-card:hover {
    transform: none;
  }
  
  .btn:hover {
    transform: none;
  }
  
  .social-link:hover {
    transform: none;
  }
}

/* High resolution displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero::before {
    background-image: url('https://bmrelo.com/wp-content/themes/wi/images/hero-bg@2x.jpg');
  }
}

/* Print styles */
@media print {
  .header,
  .cookie-banner,
  .hero-buttons,
  .quote,
  .footer {
    display: none;
  }
  
  .hero {
    min-height: auto;
    background: var(--white);
    color: var(--text-dark);
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
  
  h1, h2, h3 {
    page-break-after: avoid;
  }
  
  .section-title {
    font-size: 18pt;
    color: var(--text-dark);
  }
}

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

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  /* Keep light theme for brand consistency */
  /* This can be uncommented if dark mode is desired */
  /*
  :root {
    --text-dark: #f9fafb;
    --text-light: #d1d5db;
    --bg-light: #1f2937;
    --white: #111827;
    --border-color: #374151;
  }
  */
}

/* Landscape orientation on mobile */
@media (max-width: 767px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
    padding: 2rem 0;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .navbar {
    padding: 0.5rem 0;
  }
}

/* Focus styles for accessibility */
@media (prefers-reduced-motion: no-preference) {
  .btn:focus,
  .form-control:focus,
  .form-select:focus,
  .nav-link:focus,
  .lang-btn:focus {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
  }
}

/* Loading states for slower connections */
@media (max-width: 767px) {
  .hero-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    opacity: 0.1;
  }
}

/* Container max-widths for different screen sizes */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
}

/* Form responsive adjustments */
@media (max-width: 575px) {
  .quote-form .row > div {
    margin-bottom: 1rem;
  }
  
  .form-check-label {
    font-size: 0.8rem;
  }
  
  .hero-buttons .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
}

/* Navigation improvements for touch devices */
@media (max-width: 991px) {
  .nav-link {
    padding: 1rem !important;
    border-bottom: 1px solid var(--border-color);
  }
  
  .nav-link:last-child {
    border-bottom: none;
  }
  
  .navbar-nav .nav-item:last-child .nav-link {
    border-bottom: none;
  }
}

/* Cookie banner responsive */
@media (max-width: 575px) {
  .cookie-banner {
    padding: 1.5rem 0;
  }
  
  .cookie-content {
    gap: 1.5rem;
  }
  
  .cookie-buttons {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
}
