/* 
 * Responsive CSS for public-facing pages
 * This file contains responsive design styles for tablet and mobile devices
 * It excludes admin panel pages
 */

/* Common responsive adjustments */
@media (max-width: 1200px) {
    .container {
        width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Adjust section padding */
    .section {
        padding: 70px 0;
    }
    
    /* Adjust heading sizes */
    .section-title h2 {
        font-size: 2.2rem;
    }
    
    /* Hero slider adjustments */
    .hero-slider, .slide {
        height: 550px;
    }
    
    .slide-title {
        font-size: 2.8rem;
    }
}

/* Tablet devices (landscape) */
@media (max-width: 992px) {
    /* Header adjustments */
    .page-header {
        padding: 80px 0;
    }
    
    .page-title h1 {
        font-size: 2.3rem;
    }
    
    /* Hero slider adjustments */
    .hero-slider, .slide {
        height: 500px;
    }
    
    .slide-title {
        font-size: 2.3rem;
    }
    
    .slide-text {
        font-size: 1.1rem;
    }
    
    /* Timeline adjustments */
    .timeline::before {
        left: 40px;
    }
    
    .timeline-badge {
        left: 40px;
        margin-left: 0;
    }
    
    .timeline-content {
        width: calc(100% - 80px);
        float: right;
    }
    
    .timeline-item:nth-child(odd) .timeline-content::before {
        right: auto;
        left: -10px;
        border-width: 10px 10px 10px 0;
        border-color: transparent white transparent transparent;
    }
    
    /* Service boxes */
    .service-box {
        height: calc(100% - 30px);
    }
    
    /* Team section */
    .team-member {
        margin-bottom: 40px;
    }
    
    /* Contact page */
    .contact-info {
        margin-bottom: 30px;
    }
    
    .map-container {
        height: 350px;
    }
    
    /* Office cards */
    .office-card {
        height: calc(100% - 30px);
    }
}

/* Tablet devices (portrait) */
@media (max-width: 768px) {
    /* Header adjustments */
    .top-bar {
        /* Instead of hiding, adjust for mobile */
        padding: 8px 0;
        font-size: 0.85rem;
    }
    
    /* Create alternative for top bar on mobile */
    .mobile-contact-bar {
        display: flex;
        justify-content: center;
        padding: 10px 0;
        background-color: var(--primary-color);
        color: white;
    }
    
    .mobile-contact-bar a {
        color: var(--background-color);
        margin: 0 10px;
        font-size: 1rem;
    }
    
    /* Navbar adjustments */
    .navbar {
        padding: 10px 0;
    }
    
    .navbar-brand img {
        height: 45px;
    }
    
    /* Header padding */
    .page-header {
        padding: 60px 0;
    }
    
    .page-title h1 {
        font-size: 2rem;
    }
    
    /* Section adjustments */
    .section {
        padding: 50px 0;
    }
    
    .section-title {
        margin-bottom: 40px;
    }
    
    .section-title h2 {
        font-size: 1.8rem;
    }
    
    /* Hero slider adjustments */
    .hero-slider, .slide {
        height: 450px;
    }
    
    .slide-title {
        font-size: 2rem;
    }
    
    .slide-text {
        font-size: 1rem;
        margin-bottom: 20px;
    }
    
    /* About page adjustments */
    .mission-vision {
        padding: 25px;
    }
    
    .contact-info, .contact-form {
        padding: 25px;
    }
    
    /* Map container */
    .map-container {
        height: 300px;
    }
    
    /* Office cards */
    .office-card {
        padding: 25px;
    }
    
    /* Footer adjustments */
    footer {
        padding: 50px 0 0;
    }
    
    .footer-title {
        font-size: 1.2rem;
        margin-bottom: 20px;
    }
}

/* Mobile devices (landscape) */
@media (max-width: 576px) {
    /* Header adjustments */
    .page-title h1 {
        font-size: 1.8rem;
    }
    
    /* Hero slider adjustments */
    .hero-slider, .slide {
        height: 400px;
    }
    
    .slide-title {
        font-size: 1.7rem;
        margin-bottom: 10px;
    }
    
    .slide-text {
        font-size: 0.95rem;
        margin-bottom: 15px;
    }
    
    /* Section adjustments */
    .section {
        padding: 40px 0;
    }
    
    .section-title {
        margin-bottom: 30px;
    }
    
    .section-title h2 {
        font-size: 1.6rem;
        padding-bottom: 15px;
    }
    
    /* Contact info adjustments */
    .contact-info-item {
        flex-direction: column;
    }
    
    .contact-info-icon {
        margin-bottom: 15px;
        margin-right: 0;
    }
    
    /* Map container */
    .map-container {
        height: 250px;
    }
    
    /* Form adjustments */
    .contact-form {
        padding: 20px 15px;
    }
    
    .form-title, .contact-info-title, .office-card-title {
        font-size: 1.3rem;
    }
    
    /* Office cards */
    .office-card {
        padding: 20px 15px;
    }
    
    /* Department cards */
    .department-card {
        padding: 20px 15px;
    }
    
    /* CTA Section */
    .cta-title {
        font-size: 1.7rem;
    }
    
    .cta-text {
        font-size: 1rem;
    }
}

/* Mobile devices (portrait) */
@media (max-width: 480px) {
    /* Top bar */
    .top-bar {
        text-align: center;
    }
    
    .top-bar .col-md-6 {
        text-align: center !important;
        margin-bottom: 5px;
    }
    
    /* Navbar brand */
    .navbar-brand img {
        height: 40px;
    }
    
    /* Hero slider */
    .hero-slider, .slide {
        height: 350px;
    }
    
    .slide-title {
        font-size: 1.5rem;
    }
    
    /* Section adjustments */
    .section-title h2 {
        font-size: 1.5rem;
    }
    
    /* Service box */
    .service-box {
        padding: 20px 15px;
    }
    
    .service-icon {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }
    
    .service-title {
        font-size: 1.3rem;
    }
    
    /* Counter box */
    .counter-box {
        padding: 20px 15px;
    }
    
    .counter-number {
        font-size: 2rem;
    }
    
    /* Contact form */
    .form-control {
        padding: 10px;
    }
    
    .submit-btn {
        width: 100%;
    }
    
    /* Footer adjustments */
    .footer-social a {
        width: 35px;
        height: 35px;
        line-height: 35px;
    }
    
    /* Ensure form inputs are touch-friendly */
    input, select, textarea, button {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }
}

/* Fix for specific elements */

/* Make images responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Fix iframe responsiveness */
iframe {
    max-width: 100%;
    border: 0;
}

/* Ensure buttons are touch-friendly on mobile */
button, .btn, .submit-btn, [type="button"], [type="submit"] {
    min-height: 44px;
}

/* Fix for tables on mobile */
table {
    width: 100%;
    overflow-x: auto;
    display: block;
}

/* Fix for horizontal scrolling issues */
html {
    overflow-x: hidden;
}
/* Note: overflow-x on body breaks position: sticky, so only apply to html */
body {
    width: 100%;
}
/* Add zebra-striping to make tables more readable on small screens */
@media (max-width: 768px) {
    table tr:nth-child(even) {
        background-color: rgba(0,0,0,0.05);
    }
}

/* Improve touch targets for navigation */
@media (max-width: 768px) {
    .navbar .nav-link {
        padding: 10px 15px;
    }
    
    .footer-links li {
        padding: 8px 0;
    }
    
    .footer-links a {
        display: block;
    }
}

/* Make the collapsed navbar full width on mobile */
@media (max-width: 576px) {
    .navbar-collapse {
        background-color: var(--background-color);
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        padding: 10px;
        margin: 0 -15px;
    }
}

/* Fix for timeline on mobile */
@media (max-width: 576px) {
    .timeline-content {
        padding: 20px 15px;
    }
}

/* Fix for team members on mobile */
@media (max-width: 576px) {
    .team-member {
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Fix for contact info alignment on mobile */
@media (max-width: 576px) {
    .contact-info-content {
        text-align: center;
    }
    
    .contact-info-icon {
        margin-left: auto;
        margin-right: auto;
    }
}

/* Fix for social links on mobile */
@media (max-width: 576px) {
    .social-links {
        justify-content: center;
    }
}

/* ========================================
   Additional Global Responsive Rules
   ======================================== */

/* Feature icons responsive sizing */
@media (max-width: 768px) {
    .feature-icon {
        width: 65px;
        height: 65px;
    }

    .feature-icon i {
        font-size: 1.6rem;
    }

    .feature-title {
        font-size: 1.2rem;
    }

    .feature-box {
        padding: 30px 20px;
    }
}

@media (max-width: 576px) {
    .feature-icon {
        width: 55px;
        height: 55px;
    }

    .feature-icon i {
        font-size: 1.4rem;
    }

    .feature-title {
        font-size: 1.1rem;
    }

    .feature-description {
        font-size: 0.9rem;
    }

    .feature-box {
        padding: 25px 15px;
    }
}

/* Info icons responsive sizing */
@media (max-width: 768px) {
    .info-icon {
        width: 60px;
        height: 60px;
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .info-icon {
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }
}

/* Blog cards responsive */
@media (max-width: 768px) {
    .blog-card {
        margin-bottom: 20px;
    }

    .blog-card-image, .blog-image {
        height: 180px;
    }

    .blog-card-content, .blog-content {
        padding: 20px;
    }

    .blog-card-title, .blog-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .blog-card-image, .blog-image {
        height: 160px;
    }

    .blog-card-content, .blog-content {
        padding: 15px;
    }

    .blog-card-title, .blog-title {
        font-size: 1.1rem;
    }

    .blog-card-excerpt {
        font-size: 0.9rem;
    }

    .blog-date {
        font-size: 0.8rem;
    }
}

/* Value boxes responsive */
@media (max-width: 768px) {
    .value-box {
        padding: 25px;
        margin-bottom: 20px;
    }

    .value-icon {
        font-size: 2.5rem;
    }

    .value-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .value-box {
        padding: 20px 15px;
    }

    .value-icon {
        font-size: 2rem;
        margin-bottom: 15px;
    }

    .value-title {
        font-size: 1.2rem;
    }
}

/* CTA section responsive */
@media (max-width: 768px) {
    .cta-section {
        padding: 60px 0;
        background-attachment: scroll;
    }

    .cta-title {
        font-size: 2rem;
    }

    .cta-text {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .cta-section {
        padding: 50px 0;
    }

    .cta-title {
        font-size: 1.6rem;
    }

    .cta-text {
        font-size: 0.95rem;
        margin-bottom: 25px;
    }

    .cta-section .btn {
        padding: 12px 25px;
        font-size: 0.95rem;
    }
}

/* Mission/Vision boxes responsive */
@media (max-width: 768px) {
    .mission-vision {
        padding: 30px;
        margin-bottom: 20px;
    }

    .mission-vision h3 {
        font-size: 1.5rem;
    }

    .mission-vision .icon {
        font-size: 2.5rem;
    }
}

@media (max-width: 576px) {
    .mission-vision {
        padding: 25px 20px;
    }

    .mission-vision h3 {
        font-size: 1.3rem;
    }

    .mission-vision .icon {
        font-size: 2rem;
    }
}

/* Team member cards responsive */
@media (max-width: 768px) {
    .team-member {
        margin-bottom: 25px;
    }

    .team-name {
        font-size: 1.2rem;
    }

    .team-position {
        font-size: 0.85rem;
    }

    .team-social a {
        width: 35px;
        height: 35px;
        line-height: 35px;
    }
}

@media (max-width: 576px) {
    .team-info {
        padding: 15px;
    }

    .team-name {
        font-size: 1.1rem;
    }
}

/* Certification boxes responsive */
@media (max-width: 768px) {
    .certification-box {
        padding: 20px;
        margin-bottom: 20px;
    }

    .certification-icon {
        font-size: 2rem;
        min-width: 40px;
    }

    .certification-name {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .certification-box {
        flex-direction: column;
        text-align: center;
        padding: 20px 15px;
    }

    .certification-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }
}

/* Counter boxes responsive */
@media (max-width: 768px) {
    .counter-box {
        padding: 25px 15px;
        margin-bottom: 20px;
    }

    .counter-number {
        font-size: 2.2rem;
    }

    .counter-title {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .counter-box {
        padding: 20px 12px;
    }

    .counter-number {
        font-size: 1.8rem;
    }

    .counter-title {
        font-size: 0.9rem;
    }
}

/* Reference items responsive */
@media (max-width: 768px) {
    .reference-item {
        margin: 10px;
        padding: 15px;
        height: 100px;
    }

    .reference-item img {
        max-height: 60px;
    }
}

@media (max-width: 576px) {
    .reference-item {
        margin: 8px;
        padding: 12px;
        height: 80px;
    }

    .reference-item img {
        max-height: 50px;
    }
}

/* Breadcrumb responsive */
@media (max-width: 576px) {
    .breadcrumb {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    .breadcrumb-item + .breadcrumb-item::before {
        padding: 0 5px;
    }
}

/* Fixed position elements on mobile - prevent scroll lock */
@media (max-width: 768px) {
    .blog-sidebar {
        position: static !important;
    }

    [style*="position: fixed"],
    [style*="position:fixed"] {
        position: absolute !important;
    }
}

/* Swiper/Slider responsive navigation */
@media (max-width: 576px) {
    .swiper-button-next,
    .swiper-button-prev {
        width: 30px;
        height: 30px;
    }

    .swiper-button-next::after,
    .swiper-button-prev::after {
        font-size: 12px;
    }

    .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
    }
}

/* Form elements on mobile - prevent zoom */
@media (max-width: 576px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Gallery and lightbox responsive */
@media (max-width: 768px) {
    .gallery-item {
        margin-bottom: 15px;
    }

    .gallery-item img {
        height: auto;
        min-height: 150px;
        max-height: 200px;
    }
}

@media (max-width: 576px) {
    .gallery-item img {
        min-height: 120px;
        max-height: 160px;
    }
}

/* Filter buttons responsive */
@media (max-width: 576px) {
    .filter-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
        margin: 3px;
    }

    .filter-container {
        margin: 20px 0;
    }
}

/* Accordion/FAQ responsive */
@media (max-width: 576px) {
    .accordion-button,
    .faq-question {
        padding: 12px 15px;
        font-size: 0.95rem;
    }

    .accordion-body,
    .faq-answer-content {
        padding: 15px;
        font-size: 0.9rem;
    }
}

/* Testimonial cards responsive */
@media (max-width: 768px) {
    .testimonial-box,
    .testimonial-card {
        padding: 25px;
        margin: 10px;
    }

    .testimonial-text {
        font-size: 1rem;
    }

    .client-img {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 576px) {
    .testimonial-box,
    .testimonial-card {
        padding: 20px;
    }

    .testimonial-text {
        font-size: 0.95rem;
    }

    .client-name {
        font-size: 1rem;
    }

    .client-position {
        font-size: 0.8rem;
    }
}

/* Hero sections responsive */
@media (max-width: 576px) {
    .hero-section h1,
    .blog-hero h1,
    .faq-hero h1 {
        font-size: 1.8rem;
    }

    .hero-section p,
    .blog-hero p,
    .faq-hero p {
        font-size: 0.95rem;
    }
}

/* Project cards responsive */
@media (max-width: 768px) {
    .project-card {
        margin-bottom: 20px;
    }

    .project-card-image,
    .project-image {
        height: 180px;
    }
}

@media (max-width: 576px) {
    .project-card-image,
    .project-image {
        height: 150px;
    }

    .project-card-content,
    .project-content {
        padding: 15px;
    }

    .project-title {
        font-size: 1rem;
    }
}

/* Icon containers with fixed sizes */
@media (max-width: 768px) {
    [class*="-icon"][style*="width: 80px"],
    [class*="-icon"][style*="width:80px"] {
        width: 60px !important;
        height: 60px !important;
    }

    [class*="-icon"][style*="width: 70px"],
    [class*="-icon"][style*="width:70px"] {
        width: 55px !important;
        height: 55px !important;
    }
}

@media (max-width: 576px) {
    [class*="-icon"][style*="width: 80px"],
    [class*="-icon"][style*="width:80px"],
    [class*="-icon"][style*="width: 70px"],
    [class*="-icon"][style*="width:70px"] {
        width: 50px !important;
        height: 50px !important;
    }
}

/* ========================================
   COMPREHENSIVE RESPONSIVE FIXES
   Addresses all customer-facing page issues
   ======================================== */

/* --- Section Title Underline Bar --- */
.section-title h2::after {
    transition: width 0.3s ease;
}

@media (max-width: 768px) {
    .section-title h2::after {
        width: 80px !important;
    }
}

@media (max-width: 576px) {
    .section-title h2::after {
        width: 60px !important;
    }
}

@media (max-width: 480px) {
    .section-title h2::after {
        width: 50px !important;
    }
}

/* --- CTA Section Mobile Fixes --- */
@media (max-width: 992px) {
    .cta-section {
        background-attachment: scroll !important;
    }

    .cta-title {
        font-size: 2.2rem;
    }

    .cta-text {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .cta-section {
        padding: 40px 0;
    }

    .cta-title {
        font-size: 1.4rem;
    }

    .cta-text {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    .cta-section .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        width: 100%;
    }
}

/* --- Sticky Sidebar Mobile Fix --- */
@media (max-width: 992px) {
    .blog-sidebar,
    .search-sidebar,
    .page-sidebar,
    .toc-box,
    .blog-toc,
    [class*="sidebar"] {
        position: static !important;
        top: auto !important;
        margin-bottom: 30px;
    }
}

/* --- Blog Grid Mobile Fix --- */
@media (max-width: 768px) {
    .blog-grid,
    .results-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
}

@media (min-width: 576px) and (max-width: 768px) {
    .blog-grid,
    .results-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* --- Featured Post Image Fix --- */
@media (max-width: 576px) {
    .featured-post-image,
    .related-post-image {
        width: 70px !important;
        height: 50px !important;
    }
}

/* --- Blog Navigation Mobile Fix --- */
@media (max-width: 576px) {
    .blog-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .blog-navigation .btn {
        width: 100%;
        text-align: center;
    }
}

/* --- Pagination Mobile Fix --- */
@media (max-width: 576px) {
    .pagination {
        flex-wrap: wrap;
        gap: 3px;
    }

    .pagination .page-link {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .pagination .page-item:first-child .page-link,
    .pagination .page-item:last-child .page-link {
        padding: 6px 8px;
    }
}

/* --- Image Heights Mobile Fixes --- */
@media (max-width: 992px) {
    .service-image img,
    .service-card-image {
        height: 300px !important;
    }

    .main-image,
    .main-image-placeholder {
        height: 350px !important;
    }
}

@media (max-width: 768px) {
    .service-image img,
    .service-card-image {
        height: 250px !important;
    }

    .main-image,
    .main-image-placeholder {
        height: 300px !important;
    }

    .blog-featured-image {
        height: 280px !important;
    }

    .gallery-main {
        height: 350px !important;
    }
}

@media (max-width: 576px) {
    .service-image img,
    .service-card-image {
        height: 200px !important;
    }

    .main-image,
    .main-image-placeholder {
        height: 250px !important;
    }

    .blog-featured-image {
        height: 200px !important;
    }

    .gallery-main {
        height: 250px !important;
    }

    .related-card-image {
        height: 150px !important;
    }
}

@media (max-width: 480px) {
    .service-image img,
    .service-card-image {
        height: 180px !important;
    }

    .main-image,
    .main-image-placeholder {
        height: 200px !important;
    }

    .blog-featured-image {
        height: 170px !important;
    }

    .gallery-main {
        height: 200px !important;
    }

    .related-card-image {
        height: 130px !important;
    }
}

/* --- Product Page Fixes --- */
@media (max-width: 992px) {
    .product-image {
        height: 200px !important;
    }

    .product-title {
        font-size: 1.8rem !important;
    }

    .product-info {
        padding-left: 0 !important;
        margin-top: 20px;
    }

    .group-sidebar {
        position: static !important;
    }

    .stat-card h3 {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .product-image {
        height: 180px !important;
    }

    .product-title {
        font-size: 1.5rem !important;
    }

    .filter-card {
        padding: 20px !important;
    }

    .product-content {
        padding: 20px !important;
    }

    .stat-card h3 {
        font-size: 1.5rem;
    }

    .product-image-placeholder {
        font-size: 3rem !important;
    }
}

@media (max-width: 576px) {
    .product-image {
        height: 160px !important;
    }

    .product-title {
        font-size: 1.3rem !important;
    }

    .filter-card {
        padding: 15px !important;
    }

    .product-content {
        padding: 15px !important;
    }

    .stat-card h3 {
        font-size: 1.3rem;
    }

    .product-image-placeholder {
        font-size: 2.5rem !important;
    }

    .gallery-thumb {
        width: 60px !important;
        height: 60px !important;
    }

    .gallery-thumbs {
        gap: 6px !important;
    }

    .spec-list .spec-key {
        min-width: 100px !important;
        font-size: 0.85rem;
    }

    .action-buttons {
        gap: 8px !important;
    }

    .action-buttons .btn {
        padding: 10px 18px !important;
        font-size: 0.9rem;
    }

    .action-buttons .btn-lg {
        padding: 10px 18px !important;
        font-size: 0.9rem !important;
    }
}

/* --- Project Detail Fixes --- */
@media (max-width: 768px) {
    .info-card {
        padding: 20px !important;
    }

    .project-hero {
        height: 45vh !important;
        min-height: 280px;
    }
}

@media (max-width: 576px) {
    .info-card {
        padding: 15px !important;
    }

    .project-hero {
        height: 40vh !important;
        min-height: 250px;
    }

    .gallery-thumb {
        height: 50px !important;
    }
}

@media (max-width: 480px) {
    .project-hero {
        height: 35vh !important;
        min-height: 220px;
    }
}

/* --- Lightbox Mobile Fix --- */
@media (max-width: 576px) {
    .lightbox-nav {
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
    }

    .lightbox-close {
        top: 10px !important;
        right: 10px !important;
    }
}

/* --- Contact Page Fixes --- */
@media (max-width: 576px) {
    .captcha-input {
        max-width: 100% !important;
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .map-container {
        height: 200px;
    }

    .contact-info {
        padding: 15px !important;
    }
}

/* --- Category/Filter Buttons Mobile --- */
@media (max-width: 768px) {
    .group-btn,
    .category-btn,
    .filter-btn {
        padding: 8px 16px !important;
        font-size: 0.85rem;
        margin: 3px !important;
    }
}

@media (max-width: 480px) {
    .group-btn,
    .category-btn,
    .filter-btn {
        padding: 6px 12px !important;
        font-size: 0.8rem;
        margin: 2px !important;
    }
}

/* --- FAQ Page Fixes --- */
@media (max-width: 768px) {
    .faq-hero h1 {
        font-size: 2.2rem;
    }

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

    .contact-cta h2 {
        font-size: 2rem;
    }

    .contact-cta p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .faq-hero h1 {
        font-size: 1.6rem;
    }

    .faq-hero p {
        font-size: 0.9rem;
    }

    .contact-cta h2 {
        font-size: 1.5rem;
    }

    .contact-cta p {
        font-size: 0.9rem;
    }
}

/* --- References Page Fixes --- */
@media (max-width: 768px) {
    .reference-item {
        max-width: 100% !important;
    }

    .project-image {
        height: 150px !important;
    }

    .testimonial-client-img {
        width: 50px !important;
        height: 50px !important;
    }
}

@media (max-width: 576px) {
    .testimonial-client {
        flex-direction: column;
        text-align: center;
    }

    .testimonial-client-img {
        width: 45px !important;
        height: 45px !important;
        margin-right: 0 !important;
        margin-bottom: 10px;
    }

    .project-image {
        height: 130px !important;
    }
}

/* --- Error Pages (404/500) Fixes --- */
@media (max-width: 768px) {
    .error-code {
        font-size: 8rem !important;
    }

    .error-section {
        min-height: 100dvh;
        min-height: 100vh; /* fallback */
    }
}

@media (max-width: 576px) {
    .error-code {
        font-size: 6rem !important;
    }
}

@media (max-width: 480px) {
    .error-code {
        font-size: 4.5rem !important;
    }

    .search-input {
        padding-right: 50px !important;
    }
}

/* --- Quote View Fixes --- */
@media (max-width: 768px) {
    .totals-box {
        width: 100% !important;
        max-width: 100% !important;
    }

    .quote-header h1 {
        font-size: 1.6rem !important;
    }

    .quote-container {
        padding: 20px 10px !important;
    }

    .items-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 576px) {
    .quote-header h1 {
        font-size: 1.3rem !important;
    }
}

/* --- Blog Search (blog-arama) Fixes --- */
@media (max-width: 576px) {
    .advanced-search-form {
        margin-top: -20px !important;
        padding: 20px !important;
    }

    .tag-cloud-item {
        font-size: 13px !important;
        padding: 5px 10px !important;
    }
}

@media (max-width: 480px) {
    .advanced-search-form {
        margin-top: 0 !important;
        padding: 15px !important;
    }
}

/* --- Privacy Policy Page Fixes --- */
@media (max-width: 768px) {
    .privacy-hero h1 {
        font-size: 2rem !important;
    }

    .privacy-section h2 {
        font-size: 1.3rem !important;
    }

    .toc-box {
        position: static !important;
        top: auto !important;
    }
}

@media (max-width: 576px) {
    .privacy-hero h1 {
        font-size: 1.6rem !important;
    }

    .privacy-section h2 {
        font-size: 1.2rem !important;
    }
}

/* --- Dynamic Page (page.php) Fixes --- */
@media (max-width: 992px) {
    .page-header.dynamic h1 {
        font-size: 2.2rem;
    }

    .template-with-sidebar .page-sidebar {
        position: static !important;
        top: auto !important;
    }
}

@media (max-width: 576px) {
    .page-header.dynamic h1 {
        font-size: 1.6rem;
    }
}

/* --- Distributorships Page Fixes --- */
@media (max-width: 768px) {
    .distributorship-hero,
    [style*="padding: 80px 0"] {
        padding-top: 50px !important;
        padding-bottom: 50px !important;
    }
}

@media (max-width: 576px) {
    .distributorship-hero,
    [style*="padding: 80px 0"] {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }
}

/* --- Timeline Tablet Fix (about.php) --- */
@media (min-width: 769px) and (max-width: 991px) {
    .timeline::before {
        left: 40px;
    }

    .timeline-badge {
        left: 40px;
        margin-left: 0;
    }

    .timeline-content {
        width: calc(100% - 80px);
        float: right;
    }

    .timeline-item:nth-child(odd) .timeline-content::before {
        right: auto;
        left: -10px;
        border-width: 10px 10px 10px 0;
        border-color: transparent white transparent transparent;
    }
}

/* --- Footer Mobile Fix --- */
@media (max-width: 576px) {
    .footer-title {
        font-size: 1.1rem !important;
        margin-bottom: 15px;
    }

    .footer-links a:hover {
        padding-left: 0 !important;
    }
}

@media (max-width: 480px) {
    .footer-title {
        font-size: 1rem !important;
    }

    footer .col-lg-3 {
        margin-bottom: 25px;
    }
}

/* --- Table Responsive Wrapper Fix --- */
@media (max-width: 768px) {
    .table-responsive-custom,
    .project-details-table,
    .spec-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* --- General Mobile Typography --- */
@media (max-width: 480px) {
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.2rem; }
    h4 { font-size: 1.1rem; }

    .display-4 {
        font-size: 1.8rem !important;
    }

    .display-5 {
        font-size: 1.5rem !important;
    }

    p, .lead {
        font-size: 0.95rem;
    }

    .lead {
        font-size: 1rem !important;
    }
}

/* --- Inline Icon Size Responsive Fix --- */
@media (max-width: 576px) {
    [style*="font-size: 2.5rem"],
    [style*="font-size:2.5rem"] {
        font-size: 1.8rem !important;
    }

    [style*="font-size: 3rem"],
    [style*="font-size:3rem"] {
        font-size: 2rem !important;
    }
}

/* --- Search Input Group Mobile Fix --- */
@media (max-width: 576px) {
    .input-group-lg .form-control {
        font-size: 1rem !important;
        padding: 10px 15px !important;
    }

    .input-group-lg .btn {
        padding: 10px 15px !important;
        font-size: 0.95rem !important;
    }
}

/* --- btn-lg Mobile Size Reduction --- */
@media (max-width: 576px) {
    .btn-lg {
        padding: 10px 20px !important;
        font-size: 0.95rem !important;
    }
}

/* --- Activities CSS Grid Fix --- */
@media (max-width: 576px) {
    .activity-intro ul {
        grid-template-columns: 1fr !important;
    }
}

/* --- Mobile Language Switcher (Header) --- */
.mobile-lang-btn {
    padding: 5px 10px !important;
    font-size: 0.85rem;
    border-color: rgba(0,0,0,0.15);
    background: transparent;
}

.mobile-lang-btn:hover,
.mobile-lang-btn:focus {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.25);
}

.mobile-lang-btn img {
    border-radius: 2px;
}

@media (max-width: 576px) {
    .mobile-lang-btn {
        padding: 4px 8px !important;
        font-size: 0.8rem;
    }

    .mobile-lang-btn img {
        width: 16px !important;
        height: 16px !important;
    }
}

@media (max-width: 380px) {
    .mobile-lang-btn {
        padding: 3px 6px !important;
        font-size: 0.75rem;
    }

    .mobile-lang-btn .me-1 {
        margin-right: 0.15rem !important;
    }
}

/* --- Mobile Logo Sizing --- */
/* Yatay logolar için mobil boyutlandırma */
@media (max-width: 991px) {
    .navbar-brand {
        max-width: 60%;
    }

    .navbar-brand img {
        height: 55px;
        width: auto;
        max-width: 100%;
        object-fit: contain;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        max-width: 55%;
    }

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

@media (max-width: 420px) {
    .navbar-brand {
        max-width: 50%;
    }

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

@media (max-width: 360px) {
    .navbar-brand {
        max-width: 45%;
    }

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

/* --- Prevent Horizontal Overflow on All Elements --- */
@media (max-width: 480px) {
    .container,
    .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }

    .row {
        margin-left: -6px;
        margin-right: -6px;
    }

    .row > * {
        padding-left: 6px;
        padding-right: 6px;
    }
}

/* ========================================
   MOBILE FOOTER CENTERING
   ======================================== */
@media (max-width: 767px) {
    /* Footer genel ortalama */
    footer .col-lg-3,
    footer .col-md-6 {
        text-align: center;
        margin-bottom: 30px;
    }

    /* Footer logo ortalama */
    footer .footer-logo {
        display: block;
        margin-left: auto;
        margin-right: auto;
    }

    /* Footer aciklama metni */
    footer .col-lg-3:first-child p {
        text-align: center;
        color: rgba(255, 255, 255, 0.7);
        font-size: 0.9rem;
        line-height: 1.6;
    }

    /* Footer sosyal ikonlar ortalama */
    footer .footer-social {
        display: flex;
        justify-content: center;
        gap: 12px;
    }

    footer .footer-social a {
        width: 38px;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        color: #fff;
        font-size: 1rem;
        transition: all 0.3s ease;
    }

    footer .footer-social a:hover {
        background: var(--primary-color, #0077B6);
        transform: translateY(-2px);
    }

    /* ===== FOOTER BASLIKLAR - PROFESYONEL STIL ===== */
    footer .footer-title {
        text-align: center;
        font-size: 1rem !important;
        font-weight: 700 !important;
        color: #fff !important;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        margin-bottom: 20px !important;
        padding-bottom: 12px;
        position: relative;
        border-bottom: none !important;
    }

    /* Baslik alt cizgi - dekoratif */
    footer .footer-title::after {
        content: '' !important;
        display: block !important;
        width: 40px;
        height: 2px;
        background: var(--primary-color, #0077B6);
        margin: 10px auto 0;
        border-radius: 2px;
    }

    /* ===== FOOTER LINKLER ===== */
    footer .footer-links {
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }

    footer .footer-links li {
        text-align: center !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        background: none !important;
        list-style: none !important;
    }

    footer .footer-links li::before,
    footer .footer-links li::after {
        display: none !important;
        content: none !important;
    }

    footer .footer-links a,
    footer .footer-links li a {
        display: inline-block !important;
        text-decoration: none !important;
        border: none !important;
        border-bottom: none !important;
        box-shadow: none !important;
        background: none !important;
        color: rgba(255, 255, 255, 0.7) !important;
        padding: 7px 0 !important;
        margin: 0 !important;
        font-size: 0.9rem !important;
        transition: color 0.3s ease !important;
    }

    footer .footer-links a:hover,
    footer .footer-links li a:hover {
        text-decoration: none !important;
        border: none !important;
        color: #fff !important;
        padding-left: 0 !important;
        background: none !important;
    }

    /* Ok ikonlarini tamamen kaldir */
    footer .footer-links i,
    footer .footer-links .fa-angle-right,
    footer .footer-links .fas,
    footer .footer-links .fa,
    footer .footer-links .me-2 {
        display: none !important;
    }

    /* ===== FOOTER ILETISIM ===== */
    footer .footer-contact {
        text-align: center !important;
    }

    footer .footer-contact p {
        display: block !important;
        text-align: center !important;
        margin-bottom: 12px !important;
        color: rgba(255, 255, 255, 0.7) !important;
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
    }

    footer .footer-contact p i,
    footer .footer-contact i {
        color: var(--primary-color, #0077B6) !important;
        margin-right: 8px !important;
        width: auto !important;
        display: inline !important;
    }
}

/* Daha kucuk ekranlar */
@media (max-width: 480px) {
    footer .col-lg-3,
    footer .col-md-6 {
        margin-bottom: 25px;
    }

    footer .footer-title {
        font-size: 0.9rem !important;
        letter-spacing: 1px;
    }

    footer .footer-links a {
        font-size: 0.85rem;
        padding: 6px 0;
    }

    footer .footer-contact p {
        font-size: 0.85rem;
    }
}