/*
 * Mis Plus Temizlik - Responsive Layout Styles (responsive.css)
 * Fluid grids, responsive typography, custom mobile menu overrides,
 * responsive Bento grid structures and vertical timeline adjustments.
 */

/* --- LAPTOP / LARGE TABLET BREAKPOINT (max-width: 1200px) --- */
@media (max-width: 1200px) {
    :root {
        --spacing-huge: 90px;
        --spacing-xxl: 60px;
    }
    
    .container {
        max-width: 960px;
    }

    .bento-grid {
        gap: var(--spacing-sm);
    }
    
    .footer-top {
        gap: var(--spacing-lg);
    }
}

/* --- TABLET BREAKPOINT (max-width: 992px) --- */
@media (max-width: 992px) {
    :root {
        --spacing-huge: 80px;
        --spacing-xxl: 50px;
    }

    .container {
        max-width: 720px;
    }

    /* Navigation Mobile Conversion Prep */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        gap: var(--spacing-lg);
        padding: var(--spacing-xxl) var(--spacing-xl);
        z-index: 1005;
        transition: right 0.6s cubic-bezier(0.16, 1, 0.3, 1);
        border-left: 1px solid rgba(15, 23, 42, 0.08);
        box-shadow: -10px 0 30px rgba(15, 23, 42, 0.04);
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-item a {
        color: var(--color-navy);
        font-size: 1.25rem;
    }

    .hamburger {
        display: flex;
    }

    /* Active Hamburger states */
    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
        background-color: var(--color-navy);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
        background-color: var(--color-navy);
    }
    
    header.scrolled .hamburger.active span {
        background-color: var(--color-navy);
    }

    .nav-cta {
        display: none; /* In mobile menu, we'll embed this inside the side nav */
    }

    .nav-menu .mobile-nav-cta {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: var(--spacing-sm);
        margin-top: var(--spacing-md);
    }
    
    .nav-menu .mobile-nav-cta .btn {
        width: 100%;
        text-align: center;
    }

    /* Bento Grid adjustments */
    .bento-card {
        grid-column: span 6 !important;
    }
    
    .bento-card.wide {
        grid-column: span 12 !important;
    }

    /* Timeline Stack on mobile */
    .timeline-flow::before {
        left: 20px;
    }

    .timeline-item {
        width: 100%;
        padding-left: var(--spacing-xl) !important;
        padding-right: 0 !important;
        margin-bottom: var(--spacing-xl);
    }

    .timeline-item:nth-child(even) {
        margin-left: 0;
    }

    .timeline-badge {
        left: 0px !important;
        right: auto !important;
    }

    /* Footer adjustments */
    .footer-top {
        grid-template-columns: repeat(6, 1fr);
    }

    .footer-about-col {
        grid-column: span 6;
    }

    .footer-nav-col {
        grid-column: span 3;
    }

    .footer-contact-col {
        grid-column: span 3;
    }
}

/* --- MOBILE LARGE BREAKPOINT (max-width: 768px) --- */
@media (max-width: 768px) {
    :root {
        --spacing-huge: 60px;
        --spacing-xxl: 40px;
        --spacing-xl: 30px;
    }

    .container {
        max-width: 540px;
        padding: 0 var(--spacing-sm);
    }

    /* Bento Grid fully vertical */
    .bento-card {
        grid-column: span 12 !important;
    }

    /* Split Section Layouts stacked */
    .split-layout {
        flex-direction: column !important;
        gap: var(--spacing-lg);
    }

    .split-col {
        width: 100% !important;
    }

    /* Image grid / before-after resizing */
    .before-after-wrapper {
        aspect-ratio: 4/3;
    }

    /* Stats layout stacking */
    .stats-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Footer layout stacking */
    .footer-top {
        grid-template-columns: 1fr;
    }

    .footer-col, .footer-about-col, .footer-contact-col, .footer-nav-col {
        grid-column: span 1 !important;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }
}

/* --- MOBILE SMALL BREAKPOINT (max-width: 576px) --- */
@media (max-width: 576px) {
    .container {
        width: 100%;
        padding: 0 var(--spacing-sm);
    }

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

    .title-medium {
        font-size: 1.8rem;
    }

    .stats-container {
        grid-template-columns: 1fr !important;
    }

    /* Floating Widget adjustments for small screens */
    .fixed-widgets {
        bottom: var(--spacing-sm);
        right: var(--spacing-sm);
    }

    .floating-btn {
        width: 48px;
        height: 48px;
    }

    .floating-btn::before {
        display: none; /* Hide label tooltips on narrow screens to prevent clutter */
    }

    .btn {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
}

/* ============================================================
   GLOBAL MOBILE OVERFLOW / HORIZONTAL SCROLL FIX
   Prevents any element from causing horizontal page bleed.
   ============================================================ */

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Ensure no section or container bleeds wider than viewport */
section,
.container,
header,
footer {
    max-width: 100%;
}

/* Make sure images & media never overflow */
img, video, svg {
    max-width: 100%;
}

@media (max-width: 768px) {
    /* Inline style grids used in pages (3-col) → single col */
    [style*="grid-template-columns: repeat(3"] {
        grid-template-columns: 1fr !important;
    }

    [style*="grid-template-columns: repeat(2"] {
        grid-template-columns: 1fr !important;
    }

    /* Remove fixed widths on split col children */
    [style*="width: 55%"],
    [style*="width: 45%"],
    [style*="width: 50%"],
    [style*="width: 40%"],
    [style*="width: 60%"] {
        width: 100% !important;
    }

    /* Stats / value grid stacking for 4-col */
    [style*="grid-template-columns: repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Bento cards with flex-direction: row → stack */
    .bento-card[style*="flex-direction: row"] {
        flex-direction: column !important;
    }

    .bento-card[style*="flex-direction: row"] img {
        width: 100% !important;
        height: 200px !important;
        object-fit: cover !important;
    }

    .bento-card[style*="flex-direction: row"] div[style*="width"] {
        width: 100% !important;
    }

    /* Ensure blur circles don't create horizontal scroll */
    .blur-circle {
        max-width: 260px;
        max-height: 260px;
    }
}

@media (max-width: 576px) {
    /* Prevent large font headings from causing overflow */
    .title-large,
    .title-medium {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* Inline 3-col and 2-col grids → single column */
    [style*="grid-template-columns: repeat(3, 1fr)"],
    [style*="grid-template-columns: repeat(2, 1fr)"] {
        grid-template-columns: 1fr !important;
    }

    /* Blur circles smaller on very small screens */
    .blur-circle {
        max-width: 180px;
        max-height: 180px;
        filter: blur(80px);
    }
}
