/* Responsive styles to preserve existing design while adapting layout */

/* Prevent horizontal scroll on small screens */
html, body { max-width: 100%; overflow-x: hidden; }

/* Utilities matching Bootstrap-like display helpers used in views */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }

@media (min-width: 576px) { .d-sm-flex { display: flex !important; } .d-sm-block { display: block !important; } .d-sm-none { display: none !important; } }
@media (min-width: 768px) { .d-md-flex { display: flex !important; } .d-md-block { display: block !important; } .d-md-none { display: none !important; } }
@media (min-width: 992px) { .d-lg-flex { display: flex !important; } .d-lg-block { display: block !important; } .d-lg-none { display: none !important; } }
@media (min-width: 1200px){ .d-xl-flex { display: flex !important; } .d-xl-block { display: block !important; } .d-xl-none { display: none !important; } }

/* Keep base container values from style.css; no override here to avoid design change */

/* Navigation: convert to mobile overlay */
.main-nav { transition: transform .3s ease, opacity .3s ease; }
.mobile-nav-toggle { position: relative; width: 44px; height: 38px; border: 0; background: #242E45; border-radius: 5px; cursor: pointer; display: none; align-items: center; justify-content: center; z-index: 9999; }
.mobile-nav-toggle span { position: absolute; width: 28px; height: 3px; left: 8px; background: #ffffff; }
.mobile-nav-toggle span:nth-child(1){ top: 10px; }
.mobile-nav-toggle span:nth-child(2){ top: 18px; }
.mobile-nav-toggle span:nth-child(3){ top: 26px; }
.site-header.scrolled .mobile-nav-toggle { background: #242E45; }
.site-header.scrolled .mobile-nav-toggle span { background: #ffffff; }

@media (max-width: 991.98px) {
  .mobile-nav-toggle { display: inline-flex !important; }
  .site-header .container { gap: 12px; }
  .main-nav { 
    position: fixed; 
    top: 0; 
    right: 0; 
    bottom: 0; 
    width: 80%; 
    max-width: 340px; 
    background: #ffffff; 
    color: #242E45; 
    transform: translateX(100%); 
    opacity: 0; 
    box-shadow: -10px 0 30px rgba(0,0,0,.08); 
    padding: 90px 24px 24px; 
    display: block; 
    z-index: 9998; 
    overflow: hidden; 
    -webkit-overflow-scrolling: touch;
    height: 100vh;
    min-height: 100vh;
  }
  .main-nav * { color: inherit; }
  .site-header .main-nav ul { margin: 0; padding: 0; list-style: none; }
  .site-header .main-nav li { list-style: none; }
  .site-header .main-nav ul { display: flex; flex-direction: column; gap: 16px; }
  .site-header .main-nav a { color: #242E45; font-size: 16px; }
  .site-header .main-nav.active { 
    transform: translateX(0); 
    opacity: 1; 
    visibility: visible;
    height: 100vh;
    min-height: 100vh;
  }
  .site-header.scrolled .main-nav a { color: #242E45; }
  /* New rule to hide slider pagination when nav is open */
  html.nav-open .main-slider-dot-archer {
    display: none !important;
  }
  /* Dim background when menu is open */
  /* 
  .main-nav.active::before { content: ""; position: fixed; top: 0; left: 0; right: 80%; bottom: 0; background: rgba(0,0,0,.35); z-index: -1; }
  */
  /* Prevent body scroll when nav is open */
  html.nav-open, body.nav-open { overflow: hidden; }
}

/* Header right column: modern responsive design */
@media (max-width: 1199.98px) {
  .header-right-col { 
    gap: 1.5rem; 
  }
  .header-contact {
    min-width: 180px;
    padding: 6px 12px;
  }
  .contact-icon {
    width: 32px;
    height: 32px;
  }
  .contact-icon i {
    font-size: 14px;
  }
  .contact-label {
    font-size: 10px;
  }
  .contact-number {
    font-size: 13px;
  }
  .header-cta-btn {
    padding: 10px 20px;
    font-size: 13px;
  }
}

@media (max-width: 991.98px) {
  .header-right-col { 
    gap: 1rem; 
    flex-wrap: nowrap;
    align-items: center;
  }
  .header-contact {
    min-width: 160px;
    padding: 6px 10px;
    gap: 8px;
  }
  .contact-icon {
    width: 28px;
    height: 28px;
  }
  .contact-icon i {
    font-size: 12px;
  }
  .contact-label {
    font-size: 9px;
  }
  .contact-number {
    font-size: 12px;
  }
  .header-cta-btn {
    padding: 8px 16px;
    font-size: 12px;
    gap: 6px;
  }
  .header-cta-btn i {
    font-size: 10px;
  }
}

@media (max-width: 767.98px) {
  .header-contact-wrapper { 
    display: none !important; 
  }
  .header-button-wrapper {
    display: none !important;
  }
}

/* Hero content resizing without design change */
@media (max-width: 1199.98px) {
  .hero-content h1 { font-size: 3.2rem; }
}
@media (max-width: 991.98px) {
  .hero-section { min-height: 80vh; }
  .hero-content { max-width: 560px; top: 20px; }
  .hero-content h1 { font-size: 2.6rem; }
  .hero-content p { font-size: 1.05rem; }
}
@media (max-width: 767.98px) {
  .hero-section { min-height: 80vh; }
  .hero-content { max-width: 100%; top: 0; padding-right: 12px; padding-left: 12px; overflow-wrap: anywhere; }
  .hero-content h1 { font-size: 2.1rem; }
  .hero-content p { font-size: 1rem; }
}

/* About section responsive grid */
.about-us-section .about-us-container { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 991.98px) {
  .about-us-section .about-us-container { grid-template-columns: 1fr; gap: 24px; padding: 0 16px; }
  .about-us-section .about-us-image img { height: auto !important; width: 100%; object-fit: cover; }
  .about-us-section .about-us-content p { font-size: 1rem; }
}
@media (max-width: 767.98px) {
  .about-us-section { padding-top: 3.5rem; padding-bottom: 3.5rem; }
  .about-us-section .about-us-content h2 { font-size: 2rem; }
  .about-us-section .about-us-button { margin-top: 8px; }
}
@media (max-width: 575.98px) {
  .about-us-section .about-us-content { text-align: left; }
  .about-us-section .about-us-button .btn { width: 100%; justify-content: center; }
}

/* Services CTA responsive rules (home.php) */
@media (max-width: 1199.98px) {
  .services-cta-section .cta-text h3 { font-size: 1.6rem; }
}
@media (max-width: 991.98px) {
  .services-cta-section { padding-top: 3.5rem; padding-bottom: 3.5rem; }
  .services-cta .cta-content { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
  .services-cta .cta-text p { font-size: 1rem; }
  .services-cta .cta-button { align-self: flex-start; }
}
@media (max-width: 575.98px) {
  .services-cta .cta-content { gap: 14px; }
  .services-cta .cta-text { text-align: center; width: 100%; }
  .services-cta .cta-button { width: 100%; text-align: center; }
  .services-cta .cta-icon { font-size: 1.8rem; }
}

/* Home Services (header + stats + carousel) */
@media (max-width: 1199.98px) {
  .services-header-wrapper { 
    grid-template-columns: 1fr; 
    gap: 2rem; 
    text-align: center; 
    justify-items: center;
  }
  .services-stats { 
    justify-content: center; 
  }
  .services-title {
    font-size: 2.4rem;
    line-height: 1.2;
    text-align: center;
  }
  .services-description {
    font-size: 1.1rem;
    line-height: 1.5;
    text-align: center;
  }
  .services-badge {
    justify-content: center;
  }
}
@media (max-width: 991.98px) {
  .services-header-wrapper { 
    grid-template-columns: 1fr; 
    gap: 1.5rem;
    padding: 0 16px;
    text-align: center;
    justify-items: center;
  }
  .services-stats { 
    display: grid; 
    grid-template-columns: repeat(3, minmax(0, 1fr)); 
    gap: 16px; 
    justify-items: center;
  }
  .services-title {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    text-align: center;
  }
  .services-description {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
  }
  .services-badge {
    margin-bottom: 1rem;
    justify-content: center;
  }
  .services-badge .pill {
    font-size: 0.9rem;
    padding: 8px 16px;
  }
}
@media (max-width: 767.98px) {
  .services-header-wrapper {
    gap: 1.25rem;
    padding: 0 12px;
    text-align: center;
    justify-items: center;
  }
  .services-title {
    font-size: 2rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    text-align: center;
  }
  .services-description {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
    text-align: center;
  }
  .services-stats {
    gap: 12px;
    justify-items: center;
  }
  .stat-item {
    padding: 12px 8px;
    text-align: center;
  }
  .stat-number {
    font-size: 1.8rem;
    line-height: 1.2;
  }
  .stat-label {
    font-size: 0.85rem;
    line-height: 1.3;
  }
  .services-badge .pill {
    font-size: 0.85rem;
    padding: 6px 14px;
  }
  .services-badge {
    justify-content: center;
  }
}
@media (max-width: 575.98px) {
  .services-stats { 
    grid-template-columns: 1fr; 
    gap: 12px; 
    justify-items: center;
  }
  .services-carousel-wrapper { 
    padding-left: 12px; 
    padding-right: 12px; 
  }
  .services-header-wrapper {
    gap: 1rem;
    padding: 0 8px;
    text-align: center;
    justify-items: center;
  }
  .services-title {
    font-size: 1.8rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    text-align: center;
  }
  .services-description {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    text-align: center;
  }
  .stat-item {
    padding: 10px 6px;
    text-align: center;
  }
  .stat-number {
    font-size: 1.6rem;
    margin-bottom: 4px;
  }
  .stat-label {
    font-size: 0.8rem;
  }
  .services-badge .pill {
    font-size: 0.8rem;
    padding: 5px 12px;
  }
  .services-badge {
    justify-content: center;
  }
}
@media (max-width: 375px) {
  .services-header-wrapper {
    gap: 0.75rem;
    padding: 0 4px;
    text-align: center;
    justify-items: center;
  }
  .services-title {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    text-align: center;
  }
  .services-description {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    text-align: center;
  }
  .stat-item {
    padding: 8px 4px;
    text-align: center;
  }
  .stat-number {
    font-size: 1.4rem;
  }
  .stat-label {
    font-size: 0.75rem;
  }
  .services-badge .pill {
    font-size: 0.75rem;
    padding: 4px 10px;
  }
  .services-badge {
    justify-content: center;
  }
}

/* Ensure single-slide and clean UI for services carousel on mobile */
@media (max-width: 767.98px) {
  .services-carousel-wrapper .swiper-button-next,
  .services-carousel-wrapper .swiper-button-prev { display: none !important; }
  .services-swiper { 
    padding-left: 0 !important; 
    padding-right: 0 !important; 
    margin: 0 auto;
    max-width: 320px;
  }
  .services-swiper .swiper-slide { 
    margin: 0 !important; 
    padding: 0 8px;
    display: flex;
    justify-content: center;
  }
  .services-carousel-wrapper {
    padding-left: 16px;
    padding-right: 16px;
    display: flex;
    justify-content: center;
  }
  .service-card {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
}
@media (max-width: 575.98px) {
  .services-swiper { 
    margin: 0 auto;
    max-width: 280px;
  }
  .services-swiper .swiper-slide { 
    padding: 0 4px;
  }
  .services-carousel-wrapper {
    padding-left: 12px;
    padding-right: 12px;
  }
  .service-card {
    max-width: 260px;
  }
}
@media (max-width: 375px) {
  .services-swiper { 
    margin: 0 auto;
    max-width: 260px;
  }
  .services-swiper .swiper-slide { 
    padding: 0 2px;
  }
  .services-carousel-wrapper {
    padding-left: 8px;
    padding-right: 8px;
  }
  .service-card {
    max-width: 240px;
  }
}

/* Service card content responsiveness */
@media (max-width: 1199.98px) {
  .service-card-title { font-size: 1.1rem; }
  .service-card { border-radius: 12px; }
}
@media (max-width: 991.98px) {
  .service-card-content { padding: 16px !important; }
  .service-card-title { font-size: 1.05rem; }
  .service-card-description { font-size: 0.95rem !important; }
  .service-card-link { padding: 10px 16px; font-size: 0.9rem; }
}
@media (max-width: 767.98px) {
  .service-card { 
    min-height: 260px; 
    max-height: none; 
    margin: 0 8px;
    border-radius: 10px;
  }
  .service-card-image { 
    height: 180px !important; 
    border-radius: 10px 10px 0 0;
  }
  .service-card-image img {
    border-radius: 10px 10px 0 0;
    object-fit: cover;
  }
  .service-card-content { 
    padding: 14px !important; 
    border-radius: 0 0 10px 10px;
  }
  .service-card-title { 
    font-size: 1rem; 
    line-height: 1.3;
    margin-bottom: 8px;
  }
  .service-card-description {
    font-size: 0.9rem !important;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
  }
  .service-card-footer { 
    margin-top: 8px; 
  }
  .service-card-link { 
    padding: 8px 14px; 
    font-size: 0.85rem;
    border-radius: 6px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }
  .service-card-link i {
    font-size: 0.8rem;
  }
}
@media (max-width: 575.98px) {
  .service-card { 
    margin: 0 4px;
    min-height: 240px;
  }
  .service-card-image { 
    height: 160px !important; 
  }
  .service-card-content { 
    padding: 12px !important; 
  }
  .service-card-title { 
    font-size: 0.95rem; 
    margin-bottom: 6px;
  }
  .service-card-description {
    font-size: 0.85rem !important;
    -webkit-line-clamp: 2;
    margin-bottom: 10px;
  }
  .service-card-link { 
    padding: 6px 12px; 
    font-size: 0.8rem;
    min-height: 32px;
  }
  .service-card-link i {
    font-size: 0.75rem;
  }
}
@media (max-width: 375px) {
  .service-card { 
    margin: 0 2px;
    min-height: 220px;
  }
  .service-card-image { 
    height: 140px !important; 
  }
  .service-card-content { 
    padding: 10px !important; 
  }
  .service-card-title { 
    font-size: 0.9rem; 
  }
  .service-card-description {
    font-size: 0.8rem !important;
    -webkit-line-clamp: 2;
  }
  .service-card-link { 
    padding: 5px 10px; 
    font-size: 0.75rem;
    min-height: 30px;
  }
}
/* Footer grid responsive */
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 1199.98px) { .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; } }
@media (max-width: 991.98px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 575.98px) { .footer-grid { grid-template-columns: 1fr; } }

/* Pre-footer alignment */
.pre-footer .pre-footer-container { display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
@media (max-width: 767.98px) { .pre-footer .pre-footer-container { gap: 16px; } }

/* Pagination dots position safeguard on small screens */
@media (max-width: 575.98px) {
  .main-slider-dot-archer { right: 12px !important; }
}

/* Ensure images scale down but not force large fixed widths */
img { max-width: 100%; height: auto; width: auto !important; }

/* Fix utility combo from base css */
.d-none.d-lg-block { display: none !important; }
@media (min-width: 992px) { .d-none.d-lg-block { display: block !important; } }

/* Prevent hero content from overflowing on small screens */
@media (max-width: 991.98px) { .hero-section .hero-content { right: 0; } }
@media (max-width: 767.98px) { .hero-section .hero-content { right: 0; } }

/* Mobile toggle animation to X */
.mobile-nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-nav-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-nav-toggle span { transition: transform .3s ease, opacity .2s ease; }

/* --- Iletisim Page (contact-layout) Responsive --- */
@media (max-width: 991.98px) {
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

/* --- Hakkimizda Page (about-company-grid) Responsive --- */
@media (max-width: 767.98px) {
    .about-company-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* --- Sayfa.php (Hakkimizda, etc.) Responsive --- */
@media (max-width: 991.98px) {
    .step-detail {
        padding: 3rem 0;
    }
    .links-section ul {
        gap: 1rem;
    }
}
@media (max-width: 767.98px) {
    .step-detail {
        padding: 2.5rem 0;
    }
    .step-detail .hero {
        font-size: 2rem;
    }
    .links-section {
        padding: 2.5rem 0;
    }
    .links-section ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}


/* --- Hizmetlerimiz Page (visual-service-grid) Responsive --- */
@media (max-width: 991.98px) {
    .visual-service-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 767.98px) {
    .visual-service-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Logo max width adjustments on very small screens */
@media (max-width: 575.98px) {
  .img-logo { max-width: 200px; height: auto; }
}

/* Touch-friendly improvements for mobile service cards */
@media (max-width: 767.98px) {
  .service-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .service-card:active {
    transform: scale(0.98);
  }
  .service-card-link {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .service-card-link:active {
    transform: scale(0.95);
  }
  /* Ensure proper touch targets */
  .service-card-link {
    min-height: 44px; /* iOS recommended minimum */
  }
}
@media (max-width: 575.98px) {
  .service-card-link {
    min-height: 40px;
  }
}
@media (max-width: 375px) {
  .service-card-link {
    min-height: 36px;
  }
}

/* Services carousel navigation and pagination styles */
.services-swiper .swiper-button-next,
.services-swiper .swiper-button-prev {
    color: var(--color-accent);
    background: rgba(255, 255, 255, 0.9);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.services-swiper .swiper-button-next:hover,
.services-swiper .swiper-button-prev:hover {
    background: var(--color-accent);
    color: white;
    transform: scale(1.1);
}

.services-swiper .swiper-button-next::after,
.services-swiper .swiper-button-prev::after {
    font-size: 18px;
    font-weight: bold;
}

.services-pagination .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: rgba(0, 0, 0, 0.3);
    opacity: 1;
    transition: all 0.3s ease;
}

.services-pagination .swiper-pagination-bullet-active {
    background: var(--color-accent);
    transform: scale(1.2);
}

/* Services Carousel Responsive Configuration */
/* Desktop: 3.5 cards (3 full + 1 half) */
@media (min-width: 1200px) {
  .services-carousel-wrapper {
    padding: 10px 0px;
    justify-content: flex-end !important; /* Force right alignment on desktop */
  }
  .services-swiper {
    padding: 0;
    margin: 0;
    justify-content: flex-end !important;
  }
  .services-swiper .swiper-wrapper {
    justify-content: flex-end !important;
  }
  .services-swiper .swiper-slide {
    padding: 0 15px;
  }
  .service-card {
    width: 100%;
    margin: 0;
  }
}

/* Tablet: 2 cards */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .services-carousel-wrapper {
    padding: 0 20px;
    justify-content: flex-end !important; /* Force right alignment on tablet */
  }
  .services-swiper {
    padding: 0;
    margin: 0;
    justify-content: flex-end !important;
  }
  .services-swiper .swiper-wrapper {
    justify-content: flex-end !important;
  }
  .services-swiper .swiper-slide {
    padding: 0 10px;
  }
  .service-card {
    width: 100%;
    margin: 0;
  }
}

/* Mobile: 1 card */
@media (max-width: 767.98px) {
  .services-carousel-wrapper .swiper-button-next,
  .services-carousel-wrapper .swiper-button-prev { 
    display: none !important; 
  }
  .services-swiper { 
    padding-left: 0 !important; 
    padding-right: 0 !important; 
    margin: 0 auto; /* Keep for centering single slide */
    max-width: 320px; /* Keep for single slide */
    justify-content: center; /* Center on mobile for single slide */
  }
  .services-swiper .swiper-wrapper {
    justify-content: center; /* Center on mobile */
  }
  .services-swiper .swiper-slide { 
    margin: 0 !important; 
    padding: 0 8px;
    display: flex;
    justify-content: center;
  }
  .services-carousel-wrapper {
    padding-left: 16px;
    padding-right: 16px;
    display: flex;
    justify-content: center; /* Center on mobile */
  }
  .service-card {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
}

/* Features Strip Responsive Styles */
@media (max-width: 1199.98px) {
  .features-strip {
    padding: 2rem 0;
  }
  .features-grid {
    gap: 1.25rem;
  }
  .feature-item i {
    font-size: 1.8rem;
  }
  .feature-item span {
    font-size: 0.95rem;
  }
}

@media (max-width: 991.98px) {
  .features-strip {
    padding: 1.75rem 0;
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  .feature-item {
    gap: 12px;
  }
  .feature-item i {
    font-size: 1.6rem;
  }
  .feature-item span {
    font-size: 0.9rem;
  }
}

@media (max-width: 767.98px) {
  .features-strip {
    padding: 1.5rem 0;
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  .feature-item {
    gap: 10px;
  }
  .feature-item i {
    font-size: 1.4rem;
  }
  .feature-item span {
    font-size: 0.85rem;
  }
}

@media (max-width: 575.98px) {
  .features-strip {
    padding: 1.25rem 0;
  }
  .features-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .feature-item {
    justify-content: center;
    gap: 12px;
  }
  .feature-item i {
    font-size: 1.5rem;
  }
  .feature-item span {
    font-size: 0.9rem;
  }
}

@media (max-width: 375px) {
  .features-strip {
    padding: 1rem 0;
  }
  .features-grid {
    gap: 0.875rem;
  }
  .feature-item {
    gap: 10px;
  }
  .feature-item i {
    font-size: 1.3rem;
  }
  .feature-item span {
    font-size: 0.85rem;
  }
}

/* Features strip - hide on mobile */
@media (max-width: 767.98px) {
  .features-strip {
    display: none !important;
  }
}


