/* ===== BULLETPROOF MOBILE RESPONSIVENESS ===== */
/* This file contains aggressive, defensive mobile overrides */
/* Priority: Prevent ALL horizontal overflow and ensure readability */

@media (max-width: 768px) {

    /* ===== GLOBAL OVERFLOW PREVENTION ===== */
    html,
    body {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    * {
        max-width: 100% !important;
    }

    img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* ===== CONTAINER FIXES ===== */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        width: 100% !important;
    }

    /* ===== HEADER MOBILE FIX ===== */
    .site-header {
        position: fixed !important;
        top: 0.5rem !important;
        width: calc(100% - 1rem) !important;
        padding: 0.5rem 0.75rem !important;
        z-index: 9999 !important;
    }

    .site-header .container {
        padding: 0 !important;
    }

    .logo {
        font-size: 1.1rem !important;
    }

    .site-header .btn-primary {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.75rem !important;
    }

    /* ===== HERO MOBILE FIX ===== */
    .hero {
        min-height: 60vh !important;
        margin-top: 4rem !important;
        border-radius: 0 0 1.5rem 1.5rem !important;
    }

    .hero-content {
        padding: 1.5rem 1rem !important;
    }

    .hero-title {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }

    .hero-subtitle {
        font-size: 1rem !important;
    }

    /* ===== SECTION TITLES ===== */
    .section-title {
        font-size: 1.8rem !important;
        padding: 0 1rem !important;
        margin-bottom: 2rem !important;
        overflow: visible !important;
        word-wrap: break-word !important;
    }

    /* ===== BENTO GRID MOBILE ===== */
    .bento-grid {
        grid-template-columns: 1fr !important;
        grid-auto-rows: 250px !important;
        gap: 1rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    .bento-large,
    .bento-card {
        grid-column: 1 / -1 !important;
        grid-row: span 1 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .bento-card img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .bento-overlay {
        padding: 1.5rem !important;
    }

    .bento-overlay h3 {
        font-size: 1.2rem !important;
        line-height: 1.3 !important;
    }

    .bento-overlay h4 {
        font-size: 1rem !important;
    }

    /* ===== CARD MOBILE FIX ===== */
    .card {
        max-width: 100% !important;
        width: 100% !important;
        text-decoration: none !important;
    }

    .card * {
        text-decoration: none !important;
    }

    .card-image-wrapper {
        height: 0 !important;
        padding-bottom: 60% !important;
        /* 5:3 aspect ratio - optimal for cards */
        position: relative !important;
        overflow: hidden !important;
        max-height: none !important;
    }

    .card-image-wrapper img,
    .card-image {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        max-width: 100% !important;
    }

    .card-content {
        padding: 1.25rem !important;
    }

    .card h3 {
        font-size: 1.1rem !important;
        line-height: 1.3 !important;
        -webkit-line-clamp: 2 !important;
    }

    .card p {
        font-size: 0.9rem !important;
    }

    /* ===== SWIMLANE MOBILE FIX ===== */
    .swimlane {
        margin-bottom: 3rem !important;
        overflow: hidden !important;
    }

    .swimlane-title {
        font-size: 1.3rem !important;
        padding: 0 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    .swimlane-track {
        display: flex !important;
        gap: 1rem !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 0 1rem !important;
        margin: 0 -1rem !important;
    }

    .swimlane-track .card {
        flex: 0 0 85% !important;
        max-width: 85% !important;
        scroll-snap-align: start !important;
    }

    .swimlane-nav {
        display: none !important;
    }

    /* ===== GRID MOBILE FIX ===== */
    .grid {
        gap: 1.5rem !important;
    }

    .grid-cols-3 {
        grid-template-columns: 1fr !important;
    }

    /* ===== FOOTER MOBILE FIX ===== */
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .footer-bottom {
        flex-direction: column !important;
        gap: 1.5rem !important;
        text-align: center !important;
    }

    .footer-bottom>div {
        width: 100% !important;
    }

    /* ===== MAGIC PAGE MOBILE ===== */
    .magic-grid-v3 {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .pick-img-wrap {
        height: 300px !important;
        max-height: 300px !important;
    }

    .pick-overlay {
        padding: 1.5rem !important;
    }

    .pick-title-large {
        font-size: 1.5rem !important;
    }

    .magic-ai-reason {
        padding: 1rem !important;
        gap: 1rem !important;
    }

    .reason-text {
        font-size: 0.9rem !important;
    }

    .sub-pick-card {
        flex-wrap: nowrap !important;
    }

    .sub-pick-img img {
        width: 80px !important;
        height: 80px !important;
    }

    /* ===== UTILITY OVERRIDES ===== */
    .section {
        padding: 3rem 0 !important;
    }

    .ambient-glow::before {
        width: 300px !important;
        height: 300px !important;
    }

    /* ===== TEXT OVERFLOW PROTECTION ===== */
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
    }

    p {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
}