/* CricFly — site-wide mobile improvements */

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
}

main,
.site-header,
.site-footer {
    overflow-x: clip;
}

img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

/* Touch-friendly controls */
a,
button,
.btn,
input,
select,
textarea,
.show-drawer,
.search-toggle {
    -webkit-tap-highlight-color: transparent;
}

.btn,
button,
.show-drawer,
.search-toggle {
    min-height: 44px;
    min-width: 44px;
}

/* ─── Header ─── */
@media (max-width: 1199px) {
    .premium-header .header-top {
        display: none;
    }

    .premium-header .header-main .container {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding-top: 0.65rem !important;
        padding-bottom: 0.65rem !important;
        gap: 0.75rem;
    }

    .premium-header .header-main .leading-1 {
        margin: 0 !important;
    }

    .premium-header .logo {
        width: 58px !important;
        height: 58px !important;
    }

    .premium-header .search-toggle {
        display: none;
    }

    .premium-header .header-main nav {
        display: none !important;
    }

    .premium-header .header-main .show-drawer {
        flex-shrink: 0;
        width: 48px !important;
        height: 48px !important;
        min-width: 48px;
        min-height: 48px;
        padding: 0 !important;
    }

    .premium-header .header-main .cf-hamburger span {
        background: #ffffff !important;
    }

    .drawer.mobile-menu {
        width: min(88vw, 320px) !important;
        left: 0 !important;
        transform: translateX(-105%);
    }

    .drawer.mobile-menu.active {
        transform: translateX(0) !important;
    }

    .drawer-overlay.active {
        opacity: 0.55 !important;
        visibility: visible !important;
        z-index: 1040 !important;
    }

    .drawer.mobile-menu {
        z-index: 1050 !important;
    }

    .drawer.mobile-menu,
    .drawer.mobile-menu * {
        color: #1b1b1b;
    }

    .mobile-menu a,
    .mobile-menu .accordion-controller {
        color: #1b1b1b !important;
        text-decoration: none;
    }

    .mobile-menu a:hover,
    .mobile-menu .accordion-controller:hover {
        color: #e10600 !important;
    }

    .mobile-menu .close-drawer {
        color: #1b1b1b !important;
    }

    .mobile-menu .mb-50px {
        display: none;
    }

    .mobile-menu .mobile-nav__link,
    .mobile-menu .mobile-nav__toggle {
        min-height: 48px;
        color: #1b1b1b !important;
    }

    .mobile-menu .mobile-nav__sublink {
        color: #333333 !important;
    }
}

/* ─── Hero / homepage ─── */
@media (max-width: 768px) {
    .hero {
        min-height: auto;
        min-height: 82svh;
    }

    .hero-inner {
        padding: 5.5rem 1rem 2.5rem !important;
    }

    .hero-title {
        font-size: clamp(2rem, 9vw, 2.6rem) !important;
        line-height: 1.1 !important;
    }

    .hero-subtitle {
        font-size: 0.98rem;
        line-height: 1.6;
    }

    .hero-actions {
        gap: 0.65rem;
    }

    .hero-actions .btn {
        width: 100%;
        max-width: 100%;
        padding: 0.85rem 1rem;
        font-size: 0.8rem;
    }

    .hero-meta {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        margin-top: 1.25rem;
    }

    .hero-meta-item {
        font-size: 0.75rem;
        padding: 0.35rem 0.75rem;
    }

    .home-premium section {
        padding-top: 2.75rem !important;
        padding-bottom: 2.75rem !important;
    }

    .section-heading {
        margin-bottom: 2rem;
    }

    .intro-grid,
    .values-grid {
        gap: 1.5rem;
    }

    .intro-image-wrap {
        margin: 0 auto;
        max-width: 100%;
    }

    .players-gallery {
        padding: 0 0.25rem !important;
    }

    .players-gallery__nav {
        width: 38px;
        height: 38px;
    }

    .player-showcase-card {
        max-width: 100%;
    }

    .pathways-panel {
        padding: 2rem 1.25rem !important;
        min-height: 280px !important;
    }

    .pathways-panel__title {
        font-size: 1.5rem !important;
    }

    .pathways-panel__btn {
        width: 100%;
        justify-content: center;
    }

    .instagram-embed {
        overflow: hidden;
    }
}

/* ─── Footer ─── */
@media (max-width: 991px) {
    .site-footer.premium-footer > div {
        padding-top: 3.5rem !important;
        margin-top: 2.5rem !important;
    }

    .premium-footer .container.absolute {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        width: 100% !important;
        margin-bottom: 1.5rem;
    }

    .premium-footer .container.absolute > div {
        padding: 1.5rem 1.25rem !important;
        text-align: center;
    }

    .premium-footer .grid {
        gap: 2rem !important;
    }

    .premium-footer .xl\\:col-span-3 {
        margin-bottom: 1.5rem !important;
        padding-right: 0 !important;
    }
}

/* ─── Inner pages ─── */
@media (max-width: 768px) {
    .container,
    .container-3 {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .main-heading {
        font-size: clamp(1.6rem, 7vw, 2.2rem) !important;
        line-height: 1.2;
    }

    .contact-us-section .row.align-items-start > [class*="col-"] {
        margin-bottom: 1.5rem;
    }

    .contact-us-section iframe {
        min-height: 280px;
    }

    .players-list-filters {
        padding: 1rem;
    }

    .players-list-filters__pills {
        gap: 0.45rem;
    }

    .players-list-filters__pill {
        font-size: 0.78rem;
        padding: 0.5rem 0.8rem;
    }

    #players-container .player-card {
        margin-bottom: 1rem;
    }

    .player-profile__hero {
        min-height: auto;
    }

    .player-profile__hero-content {
        padding: 1.25rem;
    }
}

/* ─── Registration forms ─── */
@media (max-width: 768px) {
    .form-floating-custom input,
    .form-floating-custom select,
    .form-floating-custom textarea {
        font-size: 16px !important;
    }

    .register-form-section .container,
    .club-form-section .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .register-form-section .btn,
    .club-form-section .btn {
        width: 100%;
    }
}

/* ─── Utility pages (privacy, terms) ─── */
@media (max-width: 768px) {
    .main-content,
    .policy-content,
    .terms-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .policy-content h1,
    .terms-content h1 {
        font-size: 1.75rem;
    }
}

/* ─── Scroll to top ─── */
@media (max-width: 768px) {
    .scroll-up {
        bottom: 1rem !important;
        right: 1rem !important;
        width: 42px !important;
        height: 42px !important;
    }
}

/* Prevent layout shift from wide tables */
.table-responsive {
    -webkit-overflow-scrolling: touch;
}
