/* =========================================================
   J.R. MACHINERY INDIA
   Responsive Stylesheet
   ========================================================= */

/* ---------- TABLET ---------- */

@media (max-width: 1100px) {

    .container {
        width: min(94%, 1000px);
    }

    .main-nav {
        gap: 18px;
    }

    .main-nav > a,
    .nav-link {
        font-size: 13px;
    }

    .header-cta {
        padding: 0 15px;
    }

    .hero {
        min-height: 580px;
    }

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

    .product-programme-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-programme-grid .category-card {
        aspect-ratio: 1 / 1;
        min-height: 0;
        padding: 20px;
    }

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

    .applications-focus .industry-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

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


/* ---------- TABLET / SMALL LAPTOP ---------- */

@media (max-width: 900px) {

    .header-inner {
        min-height: 72px;
    }

    .menu-toggle {
        display: grid;
        place-items: center;
    }

    .header-cta {
        display: none;
    }

    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        max-height: calc(100vh - 72px);

        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;

        background: var(--bg-primary);
        border-top: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        z-index: 998;
        box-sizing: border-box;
        overflow-x: hidden;
        overflow-y: auto;
    }

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

    .main-nav > a,
    .nav-dropdown > .nav-link {
        display: flex;
        align-items: center;
        justify-content: space-between;

        padding: 16px 4%;
        border-bottom: 1px solid var(--border-color);

        font-size: 14px;
        font-weight: 700;
        color: var(--text-primary);
        background: none;
        border-left: none;
        border-right: none;
        border-top: none;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        text-align: left;
        cursor: pointer;
    }

    .main-nav > a::after,
    .nav-dropdown > .nav-link::after {
        display: none;
    }

    .main-nav > a.active,
    .main-nav > a[aria-current="page"],
    .nav-dropdown > .nav-link.is-current {
        color: var(--yellow);
        background: rgba(245, 196, 0, 0.08);
        border-left: 3px solid var(--yellow);
    }

    .nav-dropdown {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        display: block;
    }

    .nav-dropdown > .nav-link {
        width: 100%;
        max-width: 100%;
    }

    .nav-dropdown.open > .nav-link .dropdown-arrow {
        transform: rotate(180deg);
    }

    .dropdown-menu {
        position: static;
        left: auto;
        right: auto;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        padding: 0;

        transform: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;

        display: none;

        border-top: 0;
        border-bottom: 1px solid var(--border-color);
        box-shadow: none;
        overflow: visible;
    }

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

    .nav-dropdown:hover .dropdown-menu,
    .nav-dropdown:focus-within .dropdown-menu {
        transform: none;
    }

    .dropdown-menu a {
        display: block;
        padding: 12px 8%;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        font-size: 13px;
        color: var(--text-secondary);
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .dropdown-menu a:hover {
        padding-left: 8%;
        color: var(--text-primary);
        background: var(--bg-tertiary);
    }

    .about-grid,
    .featured-product,
    .quote-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-image {
        min-height: 380px;
    }

    .product-image-placeholder {
        min-height: 400px;
    }

    .quote-form {
        max-width: 700px;
    }
}


/* ---------- MOBILE ---------- */

@media (max-width: 600px) {

    .container {
        width: 92%;
    }

    .section {
        padding: 60px 0;
    }

    .topbar {
        font-size: 11px;
    }

    .topbar-right {
        width: 100%;
        justify-content: center;
        gap: 12px;
    }

    .logo-mark {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }

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

    .logo-subtitle {
        font-size: 7px;
        letter-spacing: 1px;
    }

    .header-inner {
        gap: 16px;
    }

    .hero-slider {
        height: min(72vh, 560px);
        min-height: 440px;
    }

    .hero-slide-content {
        left: 28px;
        bottom: 28px;
        right: 28px;
    }

    .hero-slide-title {
        font-size: clamp(24px, 6vw, 38px);
    }

    .hero-slide.is-active {
        flex-grow: 5;
    }

    .section-title {
        font-size: 34px;
    }

    .section-description {
        font-size: 15px;
    }

    .about-image {
        min-height: 280px;
    }

    .about-content h3 {
        font-size: 28px;
    }

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

    .product-programme-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-programme-grid .category-card {
        min-height: 0;
        padding: 22px;
    }

    .product-programme-grid .category-card h3 {
        font-size: 17px;
    }

    .category-card {
        min-height: 200px;
    }

    .featured-product {
        gap: 30px;
    }

    .product-image-placeholder {
        min-height: 300px;
    }

    .product-content h3 {
        font-size: 31px;
    }

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

    .sector-solutions .strength-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sector-solutions .strength-card {
        min-height: 220px;
        padding: 20px;
    }

    .strength-card-mark {
        margin-bottom: 15px;
    }

    .sector-icon {
        width: 42px;
        height: 42px;
    }

    .applications-focus .industry-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .applications-focus .industry-item {
        min-height: 175px;
        padding: 20px;
    }

    .industry-strip .container {
        grid-template-columns: 1fr;
    }

    .industry-strip-header {
        border-right: 0;
        border-bottom: 1px solid #d7d7d7;
        padding: 30px 0 24px;
    }

    .industry-strip-header h2 {
        max-width: 100%;
        font-size: 36px;
    }

    .industry-items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .industry-item {
        min-height: 120px;
        padding: 20px;
        font-size: 14px;
    }

    .quote-grid {
        gap: 30px;
    }

    .quote-content h2 {
        font-size: 36px;
    }

    .quote-form {
        padding: 24px 20px;
    }

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

    .form-group.full {
        grid-column: auto;
    }

    .cta-banner {
        padding: 50px 0;
    }

    .cta-banner-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .cta-banner h2 {
        font-size: 28px;
    }

    .footer-main {
        padding: 55px 0 35px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .footer-bottom-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .whatsapp-float {
        width: 52px;
        height: 52px;
        right: 17px;
        bottom: 17px;
    }
}


/* ---------- VERY SMALL MOBILE ---------- */

@media (max-width: 400px) {

    .hero-title {
        font-size: 38px;
        line-height: 1.02;
    }

    .hero-slider {
        height: min(68vh, 460px);
        min-height: 360px;
    }

    /* Keep the narrow vertical tabs horizontal on small screens.
       Active slide still expands; inactive tabs stay as thin
       columns showing their number and rotated title. */
    .hero-slide-content {
        left: 22px;
        bottom: 22px;
        right: 22px;
    }

    .hero-slide-title {
        font-size: clamp(22px, 7vw, 30px);
    }

    .hero-slide-vtitle {
        font-size: 11px;
        bottom: 18px;
    }

    .hero-slide-number {
        top: 16px;
        left: 16px;
        font-size: 13px;
    }

    .hero-slide.is-active {
        flex-grow: 5;
    }

    .product-programme-grid .category-card {
        aspect-ratio: 1 / 1;
        min-height: 0;
        padding: 18px;
    }

    .product-programme-icon {
        width: 44px;
        height: 44px;
        margin-bottom: 16px;
    }

    .industry-strip-header {
        padding-top: 24px;
    }

    .industry-strip-header h2 {
        font-size: 30px;
    }

    .industry-items {
        grid-template-columns: 1fr;
    }

    .btn {
        padding: 0 20px;
    }

    .page-hero {
        padding: 65px 0;
    }

    .page-hero h1 {
        font-size: 40px;
    }

    .main-nav > a,
    .nav-dropdown > .nav-link {
        padding-left: 18px;
        padding-right: 18px;
    }
}