/* Menu overlay & scroll lock */
body.menu-open {
    overflow: hidden;
}

.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    display: block;
}

@media (max-width: 1024px) {
    .casino-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Header */
    .menu-toggle {
        display: flex;
    }

    .nav-main {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-top: 1px solid var(--border-color);
        flex-direction: column;
        padding: var(--space-md);
        box-shadow: var(--shadow-lg);
    }

    .nav-main.open {
        display: flex;
    }

    .nav-main a {
        padding: var(--space-md);
        width: 100%;
        text-align: left;
    }

    .nav-main {
        align-items: flex-start;
    }

    .nav-dropdown-menu a {
        text-align: left;
        padding-left: calc(var(--space-md) + 1rem);
    }

    .nav-dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        background: var(--bg-surface);
        border-radius: var(--radius-sm);
        margin-top: var(--space-xs);
    }

    .nav-dropdown:hover .nav-dropdown-menu {
        display: none;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        display: block;
    }

    /* Dropdown: flex layout for link + toggle button */
    .nav-dropdown {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        position: relative;
        width: 100%;
    }

    .nav-dropdown-toggle {
        flex: 1;
        min-width: 0;
        padding-right: 48px !important;
    }

    /* Hide the CSS chevron on mobile - button replaces it */
    .nav-dropdown-toggle::after {
        display: none;
    }

    /* Mobile toggle button */
    .dropdown-toggle-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: transparent;
        border: none;
        color: var(--text-muted, #64748b);
        font-size: 14px;
        cursor: pointer;
        flex-shrink: 0;
        padding: 0;
        transition: color 0.3s;
        position: absolute;
        right: 0;
        top: 0;
    }

    .dropdown-toggle-mobile:hover {
        color: var(--accent-purple-light, #a78bfa);
    }

    .nav-dropdown.open > .dropdown-toggle-mobile {
        color: var(--accent-purple-light, #a78bfa);
    }

    .dropdown-toggle-mobile i {
        transition: transform 0.3s;
    }

    .nav-dropdown.open > .dropdown-toggle-mobile i {
        transform: rotate(180deg);
    }

    /* Submenu takes full width below */
    .nav-dropdown .nav-dropdown-menu {
        flex-basis: 100%;
    }

    /* Casino cards */
    .casino-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Article grid */
    .article-grid {
        grid-template-columns: 1fr;
    }

    /* Typography */
    .hero h1 {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

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

    /* Carousel */
    .kw-carousel-row {
        gap: var(--space-sm);
    }

    .kw-modal {
        padding: var(--space-md);
        max-height: 90vh;
    }
}

@media (max-width: 480px) {
    .casino-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

    .casino-card {
        padding: var(--space-sm);
    }

    .casino-card .casino-name {
        font-size: 0.85rem;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

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

    .container {
        padding: 0 var(--space-md);
    }

    /* Prevent horizontal overflow */
    .art-wrapper,
    .art-container {
        max-width: 100%;
        overflow-x: hidden;
        padding-left: 12px;
        padding-right: 12px;
    }

    .art-table-wrap {
        max-width: 100vw;
        margin-left: -12px;
        margin-right: -12px;
    }

    .art-stats-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .art-figure,
    .art-figure.art-img-float-left,
    .art-figure.art-img-float-right {
        float: none;
        width: 100%;
        margin: 1rem 0;
    }

    .art-toc {
        max-width: 100%;
    }

    .art-pullquote {
        margin-left: 0;
        margin-right: 0;
        padding: 1rem;
    }

    .art-author-card {
        flex-direction: column;
        text-align: center;
    }

    .testimonials-track {
        gap: 0;
    }

    .testimonial-card {
        min-width: 100%;
        flex: 0 0 100%;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .isometric-grid {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .stat-item {
        padding: 0.8rem;
    }

    .trust-grid,
    .bonus-grid,
    .game-cat-grid {
        grid-template-columns: 1fr;
    }

    .step-grid {
        grid-template-columns: 1fr;
    }

    .payment-logos {
        flex-wrap: wrap;
        justify-content: center;
    }

    .fc-card {
        min-width: 0;
    }

    .filtered-casinos-grid {
        grid-template-columns: 1fr;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .live-activity-feed {
        max-width: 100%;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

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

    .section {
        padding: var(--space-lg) 0;
    }

    pre, code {
        max-width: 100%;
        overflow-x: auto;
        word-break: break-all;
    }

    table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }
}