/* ============================================
   Responsive Styles
   ============================================ */

/* Large Desktops */
@media (max-width: 1400px) {
  .container {
    max-width: 1200px;
  }
  .hero-title {
    font-size: 56px;
  }
  .section-title {
    font-size: 42px;
  }
}

/* Desktops */
@media (max-width: 1200px) {
  .container {
    max-width: 960px;
  }
  .hero-title {
    font-size: 48px;
  }
  .section-title {
    font-size: 38px;
  }
  .hero-nav {
    display: none;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
  .stat-number {
    font-size: 4rem;
  }
  .cta-hero-title {
    font-size: 34px;
  }
  .cta-hero-actions {
    gap: 24px;
  }
  .werkwijze-steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .werkwijze-step:nth-child(even) {
    margin-top: 40px;
  }
}

/* Tablets */
@media (max-width: 1024px) {
  .container {
    max-width: 720px;
  }
  .main-nav {
    display: none;
  }
  .mobile-menu-toggle {
    display: flex;
  }
  .header-cta {
    display: none;
  }
  .hero-title {
    font-size: 42px;
  }
  .section-title {
    font-size: 34px;
  }
  .feature-cards-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .about-wrap {
    flex-direction: column;
    gap: 60px;
  }
  .about-content {
    order: -1;
  }
  .about-images {
    flex: none;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
  }
  .services-top {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .services-top-right {
    text-align: left;
  }
  .services-top-right p {
    margin-left: 0;
  }
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  .projects-carousel-wrapper {
    height: 380px;
  }
  .pc-slide {
    flex: 0 0 250px;
    height: 250px;
  }
  .pc-slide.active {
    flex: 0 0 380px;
    height: 380px;
  }
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .contact-form-card {
    max-width: 100%;
  }
  .werkwijze-steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .news-grid {
    grid-template-columns: 1fr 1fr;
  }
  .testimonial-card {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .testimonial-img {
    width: 100%;
    height: 350px;
  }
  .about-company-wrap {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .about-company-content {
    order: -1;
  }
  .kern-grid {
    flex-direction: column;
    gap: 40px;
  }
  .kern-content {
    flex: 1 1 auto;
  }
  .kern-visual {
    order: 1;
    flex: 1 1 auto;
    width: 100%;
    transform: none;
  }
  .logo img {
    height: 40px;
    max-width: 170px;
  }
  .mobile-menu .logo img {
    height: 36px;
    max-width: 150px;
  }
  .contact-info-row {
    flex-direction: column;
    align-items: stretch;
    gap: 40px;
  }
  .contact-phone-visual img {
    max-width: 220px;
    margin: 0 auto;
  }
  .kern-card {
    left: -20px;
    bottom: -20px;
  }
  .kern-tabs {
    padding-left: 0;
  }
  .kern-tab {
    font-size: 34px;
  }
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .values-grid {
    grid-template-columns: 1fr 1fr;
  }
  .services-page-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
  }
  .projects-page-grid {
    grid-template-columns: 1fr 1fr;
  }
  .contact-page-wrap {
    grid-template-columns: 1fr;
  }
  .contact-page-heading {
    font-size: 34px;
  }
  .page-header-title {
    font-size: 42px;
  }
}

/* Tablet */
@media (max-width: 991px) {
  .who-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .who-card {
    order: 1;
    max-width: 280px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .container {
    max-width: 100%;
    padding: 0 20px;
  }
  :root {
    --section-padding: 60px 0;
  }

  /* --- Hero --- */
  .hero {
    min-height: 85vh;
  }
  .hero-title {
    font-size: 32px;
  }
  .hero-description {
    font-size: 15px;
    line-height: 1.6;
  }
  .hero-content {
    padding: 0 16px;
  }

  /* --- Section titles --- */
  .section-title {
    font-size: 28px;
  }

  /* --- Who section --- */
  .who-values {
    gap: 16px;
  }
  .who-card {
    max-width: 240px;
  }

  /* --- Feature cards --- */
  .feature-card {
    flex-direction: column;
    padding: 32px 24px;
  }
  .feature-card-img {
    width: 100%;
    min-width: auto;
    height: 180px;
  }

  /* --- About --- */
  .about-images {
    max-width: 400px;
  }
  .about-highlight {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .about-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  /* --- Services slider --- */
  .service-card {
    min-width: 260px;
    height: 360px;
  }
  .services-slider {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .service-card {
    scroll-snap-align: center;
  }

  /* --- Stats --- */
  .stat-number {
    font-size: 3rem;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px 24px;
  }
  .stat-item {
    padding: 16px;
  }
  .stat-item + .stat-item::before {
    display: none;
  }

  /* --- Projects carousel (use clamp for fluid sizing) --- */
  .projects-carousel-wrapper {
    height: 260px;
  }
  .pc-slide {
    flex: 0 0 160px;
    height: 160px;
  }
  .pc-slide.active {
    flex: 0 0 260px;
    height: 260px;
  }
  .pc-progress-bar,
  .services-progress-bar,
  .tc-progress-bar {
    flex: 0 0 100px;
  }
  .projects-carousel-controls,
  .services-controls,
  .testimonial-controls {
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
  }

  /* --- Arrow buttons: minimum 44px touch target --- */
  .services-arrow,
  .pc-prev,
  .pc-next,
  .tc-prev,
  .tc-next {
    min-width: 44px;
    min-height: 44px;
  }

  /* --- Bento --- */
  .bento-grid {
    grid-template-columns: 1fr;
  }
  .bento-image {
    aspect-ratio: 16 / 10;
  }

  /* --- Werkwijze --- */
  .werkwijze-steps {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .werkwijze-step:nth-child(even) {
    margin-top: 0;
  }
  .werkwijze-header {
    margin-bottom: 40px;
  }
  .werkwijze-step {
    padding: 24px;
  }
  .werkwijze-step-number {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  /* --- News --- */
  .news-grid {
    grid-template-columns: 1fr;
  }

  /* --- Footer --- */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer-bottom .container {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  .footer-legal {
    justify-content: center;
  }

  /* --- Page header --- */
  .page-header {
    padding: 120px 0 60px;
  }
  .page-header-title {
    font-size: 30px;
  }

  /* --- Header top bar --- */
  .header-top-bar .container {
    flex-direction: column;
    gap: 5px;
  }
  .header-top-info {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }

  /* --- CTA section --- */
  .cta-section-hero {
    padding: 56px 0;
  }
  .cta-hero-title {
    font-size: 26px;
  }
  .cta-hero-description {
    font-size: 15px;
  }
  .cta-hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .cta-hero-btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  /* --- Contact page --- */
  .contact-page-form-card {
    padding: 24px 16px;
  }
  .contact-page-form-card .form-row {
    grid-template-columns: 1fr;
  }
  .contact-page-heading {
    font-size: 26px;
  }

  /* --- Team & values --- */
  .team-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }
  .values-grid {
    grid-template-columns: 1fr;
  }

  /* --- Kern section --- */
  .kern-image-wrap {
    width: 100%;
  }
  .kern-image {
    height: 400px;
  }
  .kern-card {
    position: relative;
    left: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    margin-top: -40px;
  }
  .kern-tabs {
    padding-left: 0;
    gap: 12px;
  }
  .kern-tab {
    font-size: 24px;
  }

  /* --- Services page --- */
  .services-page-grid {
    grid-template-columns: 1fr;
  }
  .service-page-card-img {
    height: 180px;
  }
  .service-page-card-content {
    padding: 20px 20px 24px;
  }

  /* --- Projects page --- */
  .projects-page-grid {
    grid-template-columns: 1fr;
  }
  .project-page-card {
    height: 280px;
  }

  /* --- Testimonials --- */
  .testimonial-img {
    height: 260px;
  }

  /* --- Contact form --- */
  .contact-form-card {
    padding: 24px 16px;
  }
  .contact-form-text {
    max-width: 100%;
  }

  /* --- Buttons: ensure minimum 48px tap target on mobile --- */
  .btn-primary,
  .btn-outline {
    min-height: 48px;
    padding: 14px 28px;
    font-size: 14px;
  }

  /* --- Form inputs: minimum 48px height for easy tapping --- */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="url"],
  textarea,
  select {
    min-height: 48px;
    font-size: 16px;
  }

  /* --- Subtitle tag --- */
  .subtitle-tag {
    font-size: 13px;
  }

  /* --- Who section: remove wasted padding on mobile --- */
  .who-content {
    padding-right: 0;
  }

  /* --- Project cards: show overlay on mobile (no hover available) --- */
  .project-page-card-overlay {
    opacity: 1;
  }

  /* --- Service card link icon: show on mobile --- */
  .service-card-link-icon {
    opacity: 1;
    transform: translateY(0);
  }

  /* --- About company image: reduce height on mobile --- */
  .about-company-img {
    height: 280px;
  }

  /* --- Privacy section: override inline padding for mobile --- */
  .privacy-section {
    padding: 60px 0 !important;
  }

  /* --- Project filter buttons: touch-friendly size --- */
  .projects-filter-btn {
    min-height: 44px;
    padding: 10px 18px;
  }

  /* --- Contact & services page sections: reduce padding --- */
  .contact-page-section,
  .services-page-section,
  .projects-page-section {
    padding: 60px 0;
  }

  /* --- Footer copyright: prevent overflow on small screens --- */
  .footer-copyright {
    line-height: 1.6;
    word-break: break-word;
  }

  /* --- About section: fix secondary image overflow on mobile --- */
  .about-img-secondary {
    position: relative;
    bottom: auto;
    right: auto;
    margin-top: -40px;
    width: 65%;
    margin-left: auto;
  }

  /* --- Kern tabs: ensure touch-friendly tap targets --- */
  .kern-tab {
    min-height: 44px;
    padding: 8px 0;
  }

  /* --- Breadcrumb: smaller on mobile --- */
  .breadcrumb {
    font-size: 13px;
    padding: 8px 18px;
    gap: 8px;
  }

  /* --- CTA hero phone: stack vertically on mobile --- */
  .cta-hero-phone {
    width: 100%;
    justify-content: center;
  }

  /* --- Contact phone visual smaller on mobile --- */
  .contact-phone-visual img {
    max-width: 160px;
  }

  /* --- Testimonial carousel: more flexible height on mobile --- */
  .testimonial-carousel {
    min-height: auto;
  }
  .testimonial-quote p {
    font-size: 15px;
    line-height: 1.7;
  }
  .testimonial-author-info h5 {
    font-size: 17px;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
  .hero {
    min-height: 75vh;
  }
  .hero-title {
    font-size: 24px;
    line-height: 1.2;
  }
  .hero-description {
    font-size: 14px;
  }
  .section-title {
    font-size: 24px;
  }
  .header-main .container {
    height: 60px;
  }
  .logo {
    font-size: 20px;
  }
  .logo img {
    height: 34px;
    max-width: 140px;
  }
  .mobile-menu .logo img {
    height: 32px;
    max-width: 130px;
  }
  .contact-phone-visual img {
    max-width: 130px;
  }
  .logo-icon {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }
  .btn-primary {
    padding: 12px 20px;
    font-size: 13px;
    width: 100%;
    justify-content: center;
  }
  .btn-outline {
    padding: 12px 20px;
    font-size: 13px;
    width: 100%;
    justify-content: center;
  }
  .stat-number {
    font-size: 36px;
    letter-spacing: -0.02em;
  }
  .stat-suffix {
    font-size: 22px;
  }
  .stat-label {
    font-size: 14px;
  }
  .stat-description {
    font-size: 12px;
  }

  /* Carousel controls compact */
  .pc-progress-bar,
  .services-progress-bar,
  .tc-progress-bar {
    flex: 0 0 80px;
  }
  .pc-pagination {
    font-size: 14px;
  }

  /* Feature cards full width */
  .feature-card {
    padding: 24px 20px;
  }
  .feature-card-icon {
    width: 60px;
    height: 60px;
  }
  .feature-card-icon i {
    font-size: 24px;
  }

  /* Service cards smaller */
  .service-card {
    min-width: 240px;
    height: 320px;
  }
  .service-card-title {
    font-size: 20px;
  }

  /* Kern section */
  .kern-image {
    height: 300px;
  }
  .kern-tab {
    font-size: 20px;
  }

  /* Contact form compact */
  .contact-page-form-card {
    padding: 20px 14px;
  }
  .contact-page-heading {
    font-size: 22px;
  }

  /* Page header compact */
  .page-header {
    padding: 100px 0 50px;
  }
  .page-header-title {
    font-size: 26px;
  }

  /* Stats 1 column on very small screens */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  /* About highlight: prevent large number from overflowing */
  .about-highlight-left h2 {
    font-size: 36px;
  }

  /* About company image: even smaller on tiny screens */
  .about-company-img {
    height: 220px;
  }

  /* Project filter: compact on small screens */
  .projects-filter-btn {
    padding: 8px 14px;
    font-size: 13px;
  }

  /* Footer copyright: smaller text to prevent overflow */
  .footer-copyright {
    font-size: 12px;
  }

  /* Privacy section: tighter padding */
  .privacy-section {
    padding: 40px 0 !important;
  }
  .privacy-section h2 {
    font-size: 24px;
  }
  .privacy-section h3 {
    font-size: 18px;
    margin-top: 28px;
  }
}

/* ============================================
   Mobile Menu Enhancements
   ============================================ */
@media (max-width: 1024px) {
  /* Larger touch area for hamburger */
  .mobile-menu-toggle {
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 8px;
  }

  /* Full-width mobile menu on small screens */
  .mobile-menu {
    width: min(320px, 85vw);
  }

  /* Larger tap targets for mobile nav links */
  .mobile-nav li a {
    min-height: 48px;
    padding: 14px 0;
    font-size: 17px;
  }

  /* Close button bigger touch target */
  .mobile-menu-close {
    min-width: 44px;
    min-height: 44px;
  }

  /* Add CTA button in mobile menu */
  .mobile-menu-cta {
    display: block;
    margin-top: 24px;
    text-align: center;
  }
  .mobile-menu-cta .btn-primary {
    width: 100%;
    justify-content: center;
  }

  /* Hide header when mobile menu is open to avoid duplicate logos */
  body.mobile-menu-open .header {
    display: none;
  }
}

@media (min-width: 1025px) {
  .mobile-menu-cta {
    display: none;
  }
}

/* ============================================
   Sticky Mobile CTA Bar
   ============================================ */
.mobile-sticky-cta {
  display: none;
}

@media (max-width: 768px) {
  .mobile-sticky-cta {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 997;
    background-color: var(--color-bg-darker);
    border-top: 1px solid var(--color-border);
    padding: 10px 16px;
    gap: 10px;
    align-items: center;
    justify-content: center;
  }
  .mobile-sticky-cta a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--radius-md);
    min-height: 48px;
  }
  .mobile-sticky-cta .mobile-cta-call {
    background-color: var(--color-primary);
    color: var(--color-white);
  }
  .mobile-sticky-cta .mobile-cta-quote {
    background-color: transparent;
    color: var(--color-white);
    border: 2px solid var(--color-primary);
  }

  /* Add padding to body so sticky CTA doesn't overlap content */
  body {
    padding-bottom: 72px;
  }

  /* Move scroll-to-top above sticky CTA */
  .scroll-top {
    bottom: 85px;
  }
}

/* ============================================
   Touch & Interaction Optimizations
   ============================================ */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices (they cause sticky states) */
  .feature-card:hover {
    transform: none;
  }
  .service-card:hover .service-card-bg {
    filter: grayscale(0%);
    transform: none;
  }
  .btn-primary:hover {
    transform: none;
  }

  /* Make service cards show color by default on touch */
  .service-card .service-card-bg {
    filter: grayscale(0%);
  }

  /* Show service card link icon on touch devices */
  .service-card-link-icon {
    opacity: 1;
    transform: translateY(0);
  }

  /* Show project card overlay on touch (no hover available) */
  .project-page-card-overlay {
    opacity: 1;
  }

  /* Bento USP: remove hover transform on touch */
  .bento-usp:hover {
    transform: none;
  }

  /* Werkwijze step: remove hover transform on touch */
  .werkwijze-step:hover {
    transform: none;
  }

  /* Prevent text selection during swipe */
  .services-slider,
  .projects-carousel-track {
    -webkit-user-select: none;
    user-select: none;
  }
}

/* ============================================
   Safe area support (notch/home indicator)
   ============================================ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  @media (max-width: 768px) {
    .mobile-sticky-cta {
      padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
    body {
      padding-bottom: calc(72px + env(safe-area-inset-bottom));
    }
  }
}
