/* Site-wide mobile / responsive fixes — loaded after wp-content.css */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html,
body {
    overflow-x: clip;
}

body.mx-nav-open {
    overflow: hidden;
    touch-action: none;
}

img,
video,
svg,
canvas,
iframe,
embed,
object {
    max-width: 100%;
    height: auto;
}

.mx-container {
    width: min(100% - 1.25rem, var(--mx-container, 1140px));
}

@media (max-width: 479px) {
    .mx-container {
        width: min(100% - 1rem, var(--mx-container, 1140px));
    }

    .mx-header-box {
        padding: 0.65rem 0.85rem;
        gap: 0.65rem;
    }

    .mx-logo img {
        height: 30px;
    }
}

/* Full-bleed sections — prevent horizontal scroll from 100vw */
@media (max-width: 991px) {
    .bs-premium-hero,
    .bs-faults,
    .bs-guide,
    .bs-guide__figure,
    [data-slug="bilgisayar-servisi"] .bs-faq,
    .faq-page-content .bs-faq,
    .faq-trust-band {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

/* Nav backdrop */
.mx-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(15, 23, 42, 0.45);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mx-nav-toggle:checked ~ .mx-nav-backdrop {
    display: block;
}

@media (max-width: 991px) {
    .mx-nav {
        z-index: 101;
        max-height: min(78vh, calc(100dvh - 6rem));
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .mx-nav-link {
        white-space: normal;
        word-break: break-word;
        min-height: 2.75rem;
    }

    .mx-nav-link--caret {
        min-width: 2.75rem;
        justify-content: center;
    }

    .mx-nav-toggle:checked + .mx-nav-toggle-btn span {
        background: transparent;
    }

    .mx-nav-toggle:checked + .mx-nav-toggle-btn span::before {
        top: 0;
        transform: rotate(45deg);
    }

    .mx-nav-toggle:checked + .mx-nav-toggle-btn span::after {
        top: 0;
        transform: rotate(-45deg);
    }
}

/* Touch-friendly controls */
@media (max-width: 991px) {
    .btn,
    .mx-btn,
    .mx-footer-btn,
    .wp-faq-toggle,
    .mx-topbar-link,
    .mx-topbar-ticker__item {
        min-height: 2.75rem;
    }
}

/* WordPress legacy content */
.wp-content img[width],
.wp-content img[height] {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
}

.wp-content .alignleft,
.wp-content .alignright,
.wp-content .aligncenter,
.wp-content img.alignleft,
.wp-content img.alignright {
    float: none !important;
    display: block;
    margin: 1.25rem auto !important;
    max-width: min(100%, 320px);
}

.wp-content .wp-caption {
    float: none !important;
    max-width: 100% !important;
    width: auto !important;
    margin: 1.25rem 0 !important;
}

.wp-content .wp-caption img {
    width: 100% !important;
    max-width: 100% !important;
}

.wp-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.5rem 0;
    border-radius: 0.75rem;
    border: 1px solid var(--mx-border, #e5e7eb);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.wp-table-wrap table {
    margin: 0;
    min-width: 36rem;
    font-size: 0.875rem;
}

@media (max-width: 639px) {
    .wp-table-wrap table {
        min-width: 32rem;
    }

    .wp-content {
        padding: 1.25rem 0.75rem 3rem;
    }

    .wp-brand-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.75rem !important;
    }

    .wp-brand-card img {
        height: 120px !important;
    }
}

.wp-content form,
.wp-content input[type="text"],
.wp-content input[type="email"],
.wp-content input[type="tel"],
.wp-content input[type="url"],
.wp-content input[type="search"],
.wp-content input[type="number"],
.wp-content textarea,
.wp-content select {
    max-width: 100%;
    box-sizing: border-box;
}

.wp-content [style*="min-height: 450px"],
.wp-content [style*="min-height:450px"] {
    min-height: 0 !important;
    height: auto !important;
}

.wp-content [style*="width:"][style*="px"] {
    max-width: 100% !important;
}

/* Elementor / legacy column stacks */
@media (max-width: 767px) {
    .wp-content .elementor-row,
    .wp-content .elementor-column,
    .wp-content [class*="elementor-col-"],
    .wp-content .e-con,
    .wp-content .e-con-inner {
        width: 100% !important;
        max-width: 100% !important;
        flex-basis: 100% !important;
    }

    .wp-content .elementor-widget-wrap {
        flex-wrap: wrap !important;
    }
}

/* Category legacy pages */
@media (max-width: 767px) {
    body.category-brand .wp-content,
    body.category-apple .wp-content,
    body.category-playstation .wp-content,
    body.category-location .wp-content {
        padding-top: 1.25rem;
    }

    body.category-brand .wp-hero,
    body.category-apple .wp-hero,
    body.category-playstation .wp-hero,
    body.category-location .wp-hero {
        gap: 1rem;
    }

    body.category-location .wp-content h1:first-child,
    body.category-brand .wp-content h1:first-child {
        font-size: clamp(1.45rem, 5vw, 2rem);
    }
}

/* Footer & CTA stacks */
@media (max-width: 639px) {
    .mx-footer-hero-actions,
    .mx-footer-cta-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .mx-footer-hero-actions .mx-footer-btn,
    .mx-footer-cta-actions .mx-footer-btn {
        width: 100%;
        justify-content: center;
    }
}
