/* ==========================================================================
   RESPONSIVE STYLES — Kalaimagal Music Academy
   Production-level mobile-first responsive overrides
   Breakpoints: 1200px / 992px / 768px / 576px / 480px
   ========================================================================== */

/* --- Box-sizing & overflow safety --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

img {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   LARGE DESKTOP (max-width: 1349px)
   ========================================================================== */
@media only screen and (max-width: 1349px) {
    .header-logo:before {
        right: -1%;
    }

    .bef-co:before,
    .af-bg:after {
        width: 2000px;
    }

    .testimonial-one__carousel .owl-nav {
        position: relative;
        left: 0;
        bottom: 0;
        text-align: center;
        margin-top: 20px;
    }
}

/* ==========================================================================
   DESKTOP / SMALL LAPTOP (max-width: 1200px)
   ========================================================================== */
@media only screen and (max-width: 1200px) {
    .elementor-section-boxed > .elementor-container {
        max-width: 960px;
    }

    h1 {
        font-size: 42px;
    }

    h2 {
        font-size: 30px;
    }

    .subbanner2 .page-title {
        font-size: 50px;
    }

    .pl-70 {
        padding-left: 40px;
    }

    .pr-40 {
        padding-right: 20px;
    }

    .pl-40 {
        padding-left: 20px;
    }

    .pl-140,
    .pl-150 {
        padding-left: 40px;
    }

    /* Inline page grids */
    .intro-grid {
        gap: 40px;
    }

    .melody-timeline {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Carousel nav repositioning */
    .blog-carousel .owl-nav,
    .case-carousel .owl-nav,
    .service-carousel .owl-nav,
    .service-carousel-home-two .owl-nav,
    .testimonial-slide .owl-nav {
        position: relative;
        top: auto;
        right: auto;
        left: auto;
        text-align: center;
        margin-top: 20px;
    }
}

/* ==========================================================================
   TABLET (max-width: 992px)
   ========================================================================== */
@media only screen and (max-width: 992px) {
    h1 {
        font-size: 36px;
    }

    h2 {
        font-size: 28px;
    }

    h3 {
        font-size: 24px;
    }

    p {
        font-size: 15px;
        line-height: 24px;
    }

    /* --- Spacing scale-down --- */
    .pt-120 {
        padding-top: 60px;
    }

    .pb-120 {
        padding-bottom: 60px;
    }

    .pt-100 {
        padding-top: 50px;
    }

    .pb-100 {
        padding-bottom: 50px;
    }

    .pt-90 {
        padding-top: 45px;
    }

    .pb-90 {
        padding-bottom: 45px;
    }

    .pt-80 {
        padding-top: 40px;
    }

    .pb-80 {
        padding-bottom: 40px;
    }

    .pt-60 {
        padding-top: 30px;
    }

    .pb-60 {
        padding-bottom: 30px;
    }

    .pl-70 {
        padding-left: 20px;
    }

    .pr-40,
    .pr-50,
    .pr-60 {
        padding-right: 15px;
    }

    .pl-40,
    .pl-50,
    .pl-60 {
        padding-left: 15px;
    }

    .pl-140,
    .pl-150,
    .pl-100 {
        padding-left: 15px;
    }

    .pr-100 {
        padding-right: 15px;
    }

    /* --- Sub-banner --- */
    .subbanner2 {
        padding: 12% 0;
    }

    .subbanner2 .page-title {
        font-size: 40px;
    }

    .subbanners:before,
    .subbanners:after {
        width: 60%;
    }

    .subbanners h2,
    .subbanners h1 {
        font-size: 30px;
    }

    /* --- Header --- */
    div#ekit-megamenu-header-menu {
        z-index: 99999;
    }

    .header-logo:before {
        display: none;
    }

    /* --- Elementor columns stack --- */
    .elementor-col-25,
    .elementor-col-33,
    .elementor-col-50 {
        width: 50%;
    }

    /* --- Footer 4-col → 2-col --- */
    .elementor-element-0b89c55 > .elementor-container {
        flex-wrap: wrap;
    }

    .elementor-element-0b89c55 .elementor-col-25 {
        width: 50%;
        margin-bottom: 30px;
    }

    /* --- Service boxes --- */
    .service-icon-thumb {
        width: 60px;
        height: 60px;
        padding: 12px;
    }

    .service-items-title h4 a {
        font-size: 18px;
    }

    /* --- Overflow fixes --- */
    .bef-co:before,
    .af-bg:after {
        display: none;
    }

    .over-h {
        overflow: hidden;
    }

    /* --- Background images hidden on tablet --- */
    .img-w {
        background-image: none !important;
    }

    /* --- Owl Carousel nav — all centered --- */
    .doctor-carousel .owl-nav,
    .blog-carousel .owl-nav,
    .case-carousel .owl-nav,
    .service-carousel .owl-nav,
    .service-carousel-home-two .owl-nav,
    .testimonial-slide .owl-nav,
    .testimonial-one__carousel .owl-nav,
    .team-carousel .owl-nav {
        position: relative;
        top: auto;
        right: auto;
        left: auto;
        bottom: auto;
        text-align: center;
        margin-top: 20px;
    }

    /* --- Testimonials --- */
    .testimonial-one-user {
        float: left;
        padding-left: 0;
    }

    .testimonial-img-box {
        margin-bottom: 10px;
    }

    .testimonial-item-box {
        padding: 30px 25px;
    }

    span.testi-quit {
        right: 25px;
        bottom: 30px;
        font-size: 40px;
    }

    /* --- Contact form --- */
    .w-f-bg {
        padding: 30px 20px 10px;
    }

    /* --- Inline page sections (class.php, instrument pages) --- */
    .page-banner {
        padding: 100px 0;
    }

    .banner-title {
        font-size: 3rem;
    }

    .intro-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .intro-image img {
        box-shadow: -10px 10px 0 var(--primary-color, #800020);
    }

    .features-grid,
    .why-grid,
    .class-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

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

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

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

    .intro-features-grid {
        grid-template-columns: 1fr 1fr;
    }

    .quote-text h2 {
        font-size: 2.2rem;
    }

    .why-box {
        padding: 25px 15px;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 40px 0;
    }

    .cta-alert {
        font-size: 1.1rem;
        padding: 20px;
        border-radius: 20px;
        flex-direction: column;
    }

    /* --- Post cards --- */
    .post-content {
        padding: 1.2rem;
    }

    /* --- Swiper buttons (Elementor slides) --- */
    .btn-s .elementor-swiper-button-next,
    .btn-s .elementor-swiper-button-prev {
        position: relative;
        top: auto;
        bottom: auto;
        left: auto;
        right: auto;
    }

    .btn-s .elementor-swiper-button {
        width: 50px;
        height: 50px;
        line-height: 55px;
        font-size: 24px;
    }

    .btn-sw .elementor-swiper-button {
        width: 50px;
        height: 50px;
        line-height: 55px;
        font-size: 24px;
    }
}

/* ==========================================================================
   TABLET PORTRAIT / LARGE PHONE (max-width: 768px)
   ========================================================================== */
@media only screen and (max-width: 768px) {
    h1 {
        font-size: 30px;
    }

    h2 {
        font-size: 24px;
    }

    h3 {
        font-size: 20px;
    }

    p {
        font-size: 14px;
        line-height: 22px;
    }

    .container {
        padding: 0 15px;
    }

    .section-padding {
        padding: 50px 0;
    }

    /* --- Spacing scale-down --- */
    .pt-120 {
        padding-top: 40px;
    }

    .pb-120 {
        padding-bottom: 40px;
    }

    .pt-100,
    .pt-90,
    .pt-80 {
        padding-top: 35px;
    }

    .pb-100,
    .pb-90,
    .pb-80 {
        padding-bottom: 35px;
    }

    .mt-100,
    .mt-120 {
        margin-top: 40px;
    }

    .mb-100,
    .mb-120 {
        margin-bottom: 40px;
    }

    /* --- Elementor columns stack fully --- */
    .elementor-col-25,
    .elementor-col-33,
    .elementor-col-50 {
        width: 100%;
    }

    .elementor-section-boxed > .elementor-container {
        max-width: 100%;
        padding: 0 15px;
    }

    /* --- Footer → single column --- */
    .elementor-element-0b89c55 .elementor-col-25 {
        width: 100%;
        margin-bottom: 25px;
    }

    .elementor-element-0b89c55 .elementor-widget-container {
        text-align: center;
    }

    .elementor-element-0b89c55 .elementor-icon-list-items {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .elementor-element-0b89c55 .elementor-icon-list-item {
        justify-content: center;
    }

    .elementor-element-0b89c55 .ekit_social_media {
        justify-content: center;
    }

    /* --- Copyright bar --- */
    .hfe-copyright-wrapper {
        text-align: center;
        font-size: 13px;
        padding: 15px 10px;
    }

    .hfe-copyright-wrapper span {
        display: block;
        text-align: center;
    }

    /* --- Sub-banner --- */
    .subbanner2 {
        padding: 15% 0;
    }

    .subbanner2 .page-title {
        font-size: 32px;
        padding-right: 0;
    }

    .subbanner2 .breadcrumbs {
        font-size: 12px;
    }

    .flex-middle {
        flex-direction: column;
        text-align: center;
    }

    .subbanners h2,
    .subbanners h1 {
        font-size: 26px;
    }

    /* --- Inline page styles --- */
    .page-banner {
        padding: 70px 0;
    }

    .banner-title {
        font-size: 2.2rem;
        letter-spacing: 1px;
    }

    .breadcrumbs {
        font-size: 1rem;
        gap: 10px;
    }

    .intro-section {
        padding: 60px 0;
    }

    .intro-text h2 {
        font-size: 2.2rem;
    }

    .intro-image img {
        box-shadow: -8px 8px 0 var(--primary-color, #800020);
    }

    .features-section,
    .related-classes {
        padding: 60px 0;
    }

    .features-grid,
    .class-grid {
        grid-template-columns: 1fr;
    }

    .why-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .feature-card {
        padding: 35px 20px;
    }

    .feature-icon {
        font-size: 2.5rem;
    }

    .quote-section {
        padding: 60px 0;
    }

    .quote-text h2 {
        font-size: 1.8rem;
    }

    .why-choose-section {
        padding: 60px 0;
    }

    .melody-roadmap-section {
        padding: 50px 0;
    }

    .founder-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .affiliations-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    /* --- Service boxes → full width --- */
    .service-items-box-two {
        display: block;
        width: 100%;
    }

    .service-icon-thumb {
        float: none;
        margin: 0 auto 15px;
    }

    /* --- Blog / case cards --- */
    .case-block-one .image-box h3 {
        font-size: 15px;
        padding: 8px 14px 8px 8px;
        bottom: 15px;
    }

    /* --- Bringer portfolio cards --- */
    .bringer-portfolio-card-image img {
        height: 220px;
    }

    /* --- Contact form --- */
    .w-f-bg {
        padding: 25px 15px 10px;
    }

    .wpcf7-submit {
        font-size: 18px !important;
        height: 45px;
    }

    /* --- Testimonials --- */
    .testimonial-item-box {
        padding: 25px 20px;
    }

    .testimonial-info {
        flex-direction: column;
        text-align: center;
    }

    .testimonial-info .image-wrap {
        margin: 0 auto 10px;
    }

    span.testi-quit {
        position: relative;
        right: auto;
        bottom: auto;
        display: block;
        text-align: center;
        margin-top: 15px;
    }

    /* --- Carousel cards --- */
    .card-image-wrap {
        height: 220px;
    }

    .card-content-wrap {
        padding: 18px;
    }

    .card-content-wrap h4 a {
        font-size: 22px;
    }

    /* --- Instrument page image wraps --- */
    .instrument-img-wrap {
        width: 120px;
        height: 120px;
    }

    /* --- Swiper / slider enhancements --- */
    .btn-s .elementor-swiper-button,
    .btn-sw .elementor-swiper-button {
        width: 40px;
        height: 40px;
        line-height: 44px;
        font-size: 20px;
    }
}

/* ==========================================================================
   MOBILE (max-width: 576px)
   ========================================================================== */
@media only screen and (max-width: 576px) {
    h1 {
        font-size: 26px;
    }

    h2 {
        font-size: 22px;
    }

    h3 {
        font-size: 18px;
    }

    h4 {
        font-size: 18px;
    }

    p {
        font-size: 14px;
        line-height: 21px;
    }

    /* --- All large paddings collapsed --- */
    .pt-120,
    .pt-100,
    .pt-90,
    .pt-80 {
        padding-top: 30px;
    }

    .pb-120,
    .pb-100,
    .pb-90,
    .pb-80 {
        padding-bottom: 30px;
    }

    .pt-60,
    .pt-50 {
        padding-top: 25px;
    }

    .pb-60,
    .pb-50 {
        padding-bottom: 25px;
    }

    .pl-70,
    .pl-40,
    .pl-50,
    .pl-60 {
        padding-left: 12px;
    }

    .pr-40,
    .pr-50,
    .pr-60 {
        padding-right: 12px;
    }

    .pr-0 {
        padding-right: 12px !important;
    }

    .mt-50,
    .mt-60,
    .mt-70 {
        margin-top: 25px;
    }

    .mb-50,
    .mb-60,
    .mb-70 {
        margin-bottom: 25px;
    }

    /* --- Background images off on mobile --- */
    .bg-m-no {
        background-color: #1b1b1b !important;
        background-image: none !important;
    }

    .img-w {
        background-image: none !important;
    }

    /* --- Sub-banner --- */
    .subbanner2 {
        padding: 18% 0;
    }

    .subbanner2 .page-title {
        font-size: 26px;
    }

    .subbanners h2,
    .subbanners h1 {
        font-size: 22px;
    }

    /* --- Page banner (inline pages) --- */
    .page-banner {
        padding: 60px 0;
    }

    .banner-title {
        font-size: 1.8rem;
        letter-spacing: 0;
    }

    .breadcrumbs {
        font-size: 0.9rem;
        gap: 8px;
    }

    /* --- Intro section --- */
    .intro-section {
        padding: 40px 0;
    }

    .intro-text h5 {
        font-size: 0.95rem;
    }

    .intro-text h2 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }

    .intro-text p {
        font-size: 1rem;
    }

    .intro-image img {
        box-shadow: -5px 5px 0 var(--primary-color, #800020);
        border-radius: 12px;
    }

    /* --- Features, why, grids → single column --- */
    .features-section,
    .related-classes,
    .why-choose-section {
        padding: 40px 0;
    }

    .features-grid,
    .why-grid,
    .class-grid,
    .founder-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .affiliations-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .intro-features-grid {
        grid-template-columns: 1fr;
    }

    .feature-card {
        padding: 30px 18px;
    }

    .feature-icon {
        font-size: 2.2rem;
        margin-bottom: 15px;
    }

    .feature-card h3 {
        font-size: 1.3rem;
    }

    /* --- Quote section --- */
    .quote-section {
        padding: 40px 0;
    }

    .quote-text h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    /* --- Melody roadmap vertical --- */
    .melody-roadmap-section {
        padding: 40px 0;
    }

    .melody-card {
        width: calc(100% - 80px);
    }

    .melody-dot {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    /* --- Info grid / CTA --- */
    .info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 30px 0;
    }

    .info-box {
        padding: 25px 20px;
    }

    .cta-alert {
        font-size: 1rem;
        padding: 18px 15px;
        border-radius: 15px;
        margin: 30px auto 0;
    }

    /* --- Class cards --- */
    .class-thumb {
        height: 180px;
        padding: 15px;
    }

    .class-body {
        padding: 18px;
    }

    .class-body h4 {
        font-size: 1.2rem;
    }

    /* --- Service items --- */
    .service-items-box-two {
        padding: 15px 12px;
    }

    .service-icon-thumb {
        width: 50px;
        height: 50px;
        padding: 10px;
        margin-right: 12px;
    }

    .service-items-title h4 a {
        font-size: 16px;
        line-height: 22px;
    }

    .service-items-title h4 {
        padding-top: 10px;
    }

    .service-items-thumb-two img {
        height: 200px;
    }

    /* --- Post / blog cards --- */
    .post-inner {
        margin-bottom: 20px;
    }

    .post-content {
        padding: 1rem;
    }

    .entry-title {
        font-size: 16px;
    }

    /* --- Case cards --- */
    .case-block-one .image-box h3 {
        font-size: 14px;
        padding: 6px 10px 6px 6px;
        bottom: 10px;
    }

    /* --- Testimonials --- */
    .testimonial-item-box {
        padding: 20px 15px;
    }

    .testimonial-information .testimonial-name {
        font-size: 18px;
    }

    .testmonial-content {
        margin-bottom: 20px;
    }

    /* --- Contact form --- */
    .w-f-bg {
        padding: 20px 12px 10px;
    }

    .wpcf7-submit {
        font-size: 16px !important;
        height: 42px;
    }

    /* --- Owl Carousel nav buttons smaller --- */
    .blog-carousel .owl-nav button,
    .case-carousel .owl-nav button,
    .service-carousel .owl-nav button,
    .service-carousel-home-two .owl-nav button,
    .testimonial-one__carousel .owl-nav button,
    .testimonial-slide .owl-nav button,
    .team-carousel .owl-nav button {
        height: 42px !important;
        width: 42px !important;
        font-size: 18px !important;
        line-height: 42px !important;
        margin-left: 10px;
    }

    /* --- Bringer portfolio --- */
    .bringer-block {
        padding: 10px;
    }

    .bringer-portfolio-card-image img {
        height: 180px;
        margin-bottom: 12px;
    }

    .bringer-portfolio-card-title a {
        font-size: 17px;
    }

    /* --- Carousel cards --- */
    .card-image-wrap {
        height: 200px;
    }

    .card-content-wrap {
        padding: 15px;
    }

    .card-content-wrap h4 a {
        font-size: 20px;
    }

    .card-text {
        font-size: 13px;
    }

    /* --- Instrument images --- */
    .instrument-img-wrap {
        width: 100px;
        height: 100px;
    }

    /* --- Buttons / CTA --- */
    .btn-pro a {
        width: 36px;
        height: 36px;
        font-size: 16px;
        line-height: 24px;
        padding: 6px;
    }

    /* --- Swiper nav --- */
    .btn-s .elementor-swiper-button-next {
        position: absolute;
        bottom: 0;
        top: auto;
    }

    .btn-s .elementor-swiper-button-prev {
        position: absolute;
        bottom: 0;
        top: auto;
        right: 70px;
        left: auto;
    }

    .btn-s .elementor-swiper-button,
    .btn-sw .elementor-swiper-button {
        width: 36px;
        height: 36px;
        line-height: 38px;
        font-size: 18px;
        border-radius: 0 12px;
    }
}

/* ==========================================================================
   SMALL MOBILE (max-width: 480px)
   ========================================================================== */
@media only screen and (max-width: 480px) {
    .page-banner {
        padding: 45px 0;
    }

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

    .intro-text h2 {
        font-size: 1.5rem;
    }

    .quote-text h2 {
        font-size: 1.3rem;
    }

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

    .why-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .cta-alert {
        font-size: 0.9rem;
        padding: 12px 10px;
    }

    .melody-card {
        width: calc(100% - 60px);
        margin-left: 60px !important;
        padding: 12px;
    }

    .melody-dot {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }

    /* Footer copyright */
    .hfe-copyright-wrapper {
        font-size: 12px;
        padding: 10px 8px;
    }

    /* Carousel image cards */
    .card-image-wrap {
        height: 170px;
    }
}

/* ==========================================================================
   ORIENTATION: LANDSCAPE on short screens
   ========================================================================== */
@media only screen and (max-height: 500px) and (orientation: landscape) {
    .page-banner {
        padding: 40px 0;
    }

    .subbanner2 {
        padding: 8% 0;
    }

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

/* ==========================================================================
   ELEMENTOR SPECIFIC RESPONSIVE FIXES
   ========================================================================== */

/* Ensure Elementor containers don't overflow */
.elementor-container {
    max-width: 100%;
}

.elementor-section-full_width .elementor-container {
    max-width: 100%;
}

/* Fix for elementor inner sections on mobile */
@media only screen and (max-width: 768px) {
    .elementor-inner-section .elementor-container {
        flex-direction: column;
    }

    .elementor-inner-section .elementor-column {
        width: 100%;
    }

    /* Fix off-canvas sidebar hidden on mobile */
    .elementor-hidden-mobile {
        display: none !important;
    }

    /* Gallery columns responsive */
    .gallery-columns-2 .gallery-item,
    .gallery-columns-3 .gallery-item,
    .gallery-columns-4 .gallery-item,
    .gallery-columns-5 .gallery-item,
    .gallery-columns-6 .gallery-item,
    .gallery-columns-7 .gallery-item,
    .gallery-columns-8 .gallery-item,
    .gallery-columns-9 .gallery-item {
        width: 50%;
    }
}

@media only screen and (max-width: 480px) {
    .gallery-columns-2 .gallery-item,
    .gallery-columns-3 .gallery-item,
    .gallery-columns-4 .gallery-item,
    .gallery-columns-5 .gallery-item,
    .gallery-columns-6 .gallery-item,
    .gallery-columns-7 .gallery-item,
    .gallery-columns-8 .gallery-item,
    .gallery-columns-9 .gallery-item {
        width: 100%;
    }
}

/* ==========================================================================
   PRINT STYLES (production cleanup)
   ========================================================================== */
@media print {
    .scroll-top,
    .elementskit-menu-hamburger,
    .elementskit-menu-overlay,
    .loader-wrap {
        display: none !important;
    }
}