/* ==========================================================================
   SHRUSHTI METAL - MOBILE OPTIMIZED STYLESHEET
   Exclusively applies to viewports <= 768px.
   Desktop view (> 768px) is 100% UNTOUCHED and PRESERVED.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TABLET & MOBILE BASE (<= 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    /* Safe Bottom Space for the 3-Action Floating Sticky Bar */
    body {
        padding-bottom: calc(75px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Container Spacing for Small Screens */
    .container {
        padding: 0 16px;
    }

    /* --- Floating 3-Action Mobile Sticky Bar --- */
    .mobile-sticky-bar,
    .mobile-bottom-bar {
        display: block !important;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #ffffff;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        z-index: 9999;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid rgba(0, 0, 0, 0.08);
    }

    .mobile-sticky-inner,
    .mobile-bar-inner {
        display: flex;
        gap: 6px;
        max-width: 520px;
        margin: 0 auto;
        align-items: center;
        justify-content: space-between;
    }

    .mobile-sticky-inner .btn,
    .mobile-bar-inner .btn {
        flex: 1;
        min-height: 44px;
        padding: 10px 6px;
        font-size: 13.5px;
        font-weight: 700;
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        text-decoration: none;
        border: none;
        white-space: nowrap;
        box-shadow: 0 2px 5px rgba(0,0,0,0.08);
        transition: transform 0.15s ease, filter 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-sticky-inner .btn:active,
    .mobile-bar-inner .btn:active {
        transform: scale(0.97);
        filter: brightness(0.92);
    }

    .mobile-sticky-inner .btn-call,
    .mobile-bar-inner .btn-call {
        background: linear-gradient(135deg, #1a8f34, #15732a);
        color: #ffffff !important;
    }

    .mobile-sticky-inner .btn-whatsapp,
    .mobile-bar-inner .btn-whatsapp {
        background: linear-gradient(135deg, #25D366, #128C7E);
        color: #ffffff !important;
    }

    .mobile-sticky-inner .btn-quote,
    .mobile-bar-inner .btn-quote {
        background: linear-gradient(135deg, #f05a28, #e04815);
        color: #ffffff !important;
    }

    /* --- Technical Data Tables & Specs --- */
    .table-scroll-hint {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 12px;
        font-weight: 600;
        color: var(--primary-blue, #2657A6);
        background-color: #eaf0f8;
        padding: 6px 12px;
        border-radius: 6px;
        margin-bottom: 8px;
        border-left: 3px solid var(--primary-blue, #2657A6);
    }

    .table-scroll-hint .hint-arrow {
        animation: hintNudge 1.5s infinite ease-in-out;
        display: inline-block;
    }

    @keyframes hintNudge {
        0%, 100% { transform: translateX(0); }
        50% { transform: translateX(4px); }
    }

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 12px 0 20px;
        border-radius: 8px;
        border: 1px solid var(--border-color, #e2e8f0);
    }

    .tech-table {
        min-width: 500px; /* Ensures table doesn't get unreadably squashed horizontally */
    }

    .tech-table th, 
    .tech-table td {
        padding: 10px 12px;
        font-size: 13.5px;
        line-height: 1.4;
    }

    .tech-table thead th {
        font-size: 12px;
        padding: 10px 12px;
    }

    /* 2-Column Key Value Specs Table */
    .kv-table {
        margin: 14px 0;
    }

    .kv-table th,
    .kv-table td {
        padding: 11px 13px;
        font-size: 14px;
        line-height: 1.45;
    }

    .kv-table th {
        width: 38%;
        font-size: 13px;
    }

    /* --- Modal Usability & Anti-Zoom --- */
    .modal-overlay {
        padding: 12px;
        align-items: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-content {
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 22px 18px 20px;
        margin: auto;
        border-radius: 12px;
    }

    .close-btn {
        top: 10px;
        right: 12px;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 30px;
        color: #718096;
        -webkit-tap-highlight-color: transparent;
    }

    .modal-title {
        font-size: 20px;
        line-height: 1.25;
    }

    .modal-subtitle {
        font-size: 13px;
    }

    /* Crucial: 16px font size disables iOS Safari auto-zoom on field focus */
    .form-group input,
    .form-group textarea,
    .form-group select,
    .callback-form input,
    #callbackPhone,
    #userPhone {
        font-size: 16px !important;
        padding: 12px 14px;
    }

    .call-modal-content {
        padding: 28px 16px 20px;
    }

    .call-number-box {
        padding: 14px 10px;
    }

    .call-large-link {
        font-size: 21px;
    }

    .callback-form {
        flex-direction: column;
        gap: 10px;
    }

    .callback-form button {
        width: 100%;
        padding: 12px;
        min-height: 46px;
    }
}

/* --------------------------------------------------------------------------
   2. MOBILE PHONES (<= 640px)
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    /* --- Top Bar & Quick Strip --- */
    .top-bar {
        padding: 6px 0 !important;
        font-size: 11.5px !important;
    }

    .top-bar-inner {
        justify-content: center !important;
        padding: 0 10px !important;
    }

    .top-bar-left {
        display: none !important;
    }

    .top-bar-right {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 16px !important;
        width: 100% !important;
    }

    /* Hide long sales email in top bar on mobile (< 640px) so WhatsApp & Catalogue sit cleanly on ONE single centered line */
    .top-bar-right a[href^="mailto"] {
        display: none !important;
    }

    .top-bar-right a {
        font-size: 12px !important;
        font-weight: 600 !important;
        color: #e2e8f0 !important;
        white-space: nowrap !important;
        text-decoration: none !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 5px !important;
    }

    .top-bar-right a:hover {
        color: #ffffff !important;
    }

    /* --- Streamlined Sticky Header --- */
    header {
        padding: 7px 0 !important;
    }

    .header-content {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 6px !important;
        width: 100% !important;
        flex-wrap: nowrap !important;
        min-width: 0 !important;
    }

    .brand-link {
        display: flex !important;
        align-items: center !important;
        gap: 7px !important;
        text-decoration: none !important;
        min-width: 0 !important;
        flex: 0 1 auto !important;
        overflow: hidden !important;
    }

    .brand-logo-img {
        height: 32px !important;
        width: auto !important;
        max-width: 80px !important;
        padding: 2px 5px !important;
        background: #ffffff !important;
        border-radius: 5px !important;
        flex-shrink: 0 !important;
        object-fit: contain !important;
    }

    .brand-text {
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        overflow: hidden !important;
    }

    .brand-text h1 {
        font-size: 15px !important;
        font-weight: 800 !important;
        letter-spacing: -0.2px !important;
        line-height: 1.1 !important;
        margin: 0 !important;
        color: #ffffff !important;
        white-space: nowrap !important;
    }

    /* Hide long subtitle on phones to maintain clean single-line header */
    .brand-text span {
        display: none !important;
    }

    .header-actions {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex-shrink: 0 !important;
        margin-left: auto !important;
    }

    /* Hide 'All ' on mobile to save space */
    .nav-word-all {
        display: none !important;
    }

    .nav-dropdown-trigger {
        padding: 6px 10px !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        border-radius: 20px !important;
        gap: 4px !important;
        min-height: 32px !important;
        white-space: nowrap !important;
        background: rgba(255, 255, 255, 0.18) !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        color: #ffffff !important;
        display: inline-flex !important;
        align-items: center !important;
    }

    .dropdown-caret {
        font-size: 10px !important;
    }

    .header-quote-btn {
        padding: 6px 11px !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        border-radius: 20px !important;
        min-height: 32px !important;
        white-space: nowrap !important;
        background: linear-gradient(135deg, var(--cta-orange, #f05a28), #ff703d) !important;
        color: #ffffff !important;
        box-shadow: 0 2px 6px rgba(240, 90, 40, 0.35) !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 3px !important;
    }

    .header-call-pill {
        display: none !important;
    }

    .nav-dropdown-menu {
        position: absolute !important;
        top: calc(100% + 8px) !important;
        left: auto !important;
        right: 0 !important;
        width: 240px !important;
        max-width: calc(100vw - 20px) !important;
        border-radius: 8px !important;
        padding: 6px !important;
        box-shadow: 0 10px 25px rgba(0,0,0,0.2) !important;
    }

    .nav-dropdown-menu::before {
        left: auto !important;
        right: 22px !important;
    }

    .dropdown-item {
        padding: 10px 12px !important;
        font-size: 13.5px !important;
    }

    /* --- Breadcrumbs --- */
    .breadcrumb {
        font-size: 12px;
        margin: 10px 0 14px 0;
        white-space: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }

    /* --- Product Hero Section --- */
    .product-hero {
        padding: 16px 14px;
        gap: 20px;
        margin-bottom: 22px;
        border-radius: 10px;
    }

    .product-info h1 {
        font-size: 22px;
        line-height: 1.25;
        margin-bottom: 12px;
    }

    .product-badge {
        font-size: 11px;
        padding: 5px 10px;
        margin-bottom: 12px;
    }

    .product-meta {
        gap: 8px;
        margin-bottom: 16px;
    }

    .meta-tag {
        font-size: 12px;
        padding: 5px 10px;
    }

    .key-features {
        font-size: 13.5px;
        margin-bottom: 18px;
        padding-left: 20px;
    }

    .key-features li {
        margin-bottom: 8px;
    }

    /* 4-Thumbnail Gallery: Fits smoothly in 1 clean row */
    .thumbnail-gallery {
        display: flex;
        gap: 8px;
        justify-content: center;
        flex-wrap: nowrap;
        margin-top: 10px;
    }

    .thumbnail {
        width: 58px;
        height: 58px;
        flex-shrink: 0;
        border-radius: 6px;
    }

    .thumbnail img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .main-image {
        min-height: 220px;
    }

    .main-image img {
        max-height: 260px;
    }

    .badge-verified {
        font-size: 10px;
        padding: 3px 8px;
        top: 8px;
        left: 8px;
    }

    .hero-cta-wrap {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .hero-cta-wrap .btn {
        width: 100%;
        padding: 14px 16px;
        font-size: 16px;
        min-height: 48px;
    }

    .trust-strip {
        gap: 8px 14px;
        font-size: 12px;
    }

    /* --- Main Layout & Sidebar --- */
    .page-layout {
        gap: 24px;
    }

    .content-section {
        padding: 18px 14px;
        margin-bottom: 22px;
        border-radius: 10px;
    }

    .section-title {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .description-text {
        font-size: 14px;
        line-height: 1.55;
    }

    /* Component & Spec Grids */
    .component-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .component-card {
        padding: 14px;
    }

    .component-card h4 {
        font-size: 15px;
    }

    .industries-grid,
    .inspection-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .faq-question {
        padding: 14px;
        font-size: 14.5px;
    }

    .faq-answer {
        padding: 0 14px 14px;
        font-size: 13.5px;
    }

    /* Sidebar Form on Mobile */
    .sidebar {
        width: 100%;
    }

    .widget {
        padding: 18px 14px;
        margin-bottom: 20px;
        border-radius: 10px;
    }

    .widget-title {
        font-size: 17px;
    }

    /* --- Homepage Specific Elements --- */
    .hero-section {
        padding: 24px 0 35px 0;
    }

    .hero-title {
        font-size: 27px;
        line-height: 1.25;
    }

    .hero-subtitle {
        font-size: 15px;
        line-height: 1.5;
        margin-bottom: 20px;
    }

    .hero-card {
        padding: 16px;
        margin-top: 24px;
    }

    .hero-card-img-wrap img {
        max-height: 220px;
    }

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

    .stat-box {
        padding: 14px 10px;
    }

    .stat-number {
        font-size: 24px;
    }

    .stat-label {
        font-size: 11.5px;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .product-card {
        padding: 18px 14px;
    }

    .product-card-img-wrap img {
        height: 170px;
    }

    .cert-cards-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .cert-card {
        padding: 16px 14px;
    }

    .mid-cta {
        padding: 30px 16px;
    }

    .mid-cta-title {
        font-size: 22px;
    }

    .mid-cta-subtitle {
        font-size: 14px;
    }

    .mid-cta-buttons {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .mid-cta-buttons .btn {
        width: 100%;
    }

    /* --- Footer on Mobile --- */
    footer {
        padding: 40px 0 25px 0;
    }

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

    .footer-col h4 {
        font-size: 16px;
        margin-bottom: 14px;
    }

    .footer-col p,
    .footer-links li,
    .footer-contact-list li {
        font-size: 13.5px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        font-size: 12px;
    }
}

/* --------------------------------------------------------------------------
   3. EXTRA-NARROW SCREENS (<= 420px - iPhone SE, Galaxy, split inspection)
   -------------------------------------------------------------------------- */
@media (max-width: 420px) {
    .container {
        padding: 0 10px !important;
    }

    .top-bar-right {
        gap: 12px !important;
    }

    .top-bar-right a {
        font-size: 11px !important;
    }

    .brand-link {
        gap: 5px !important;
    }

    .brand-logo-img {
        height: 28px !important;
        max-width: 65px !important;
        padding: 2px 3px !important;
    }

    .brand-text h1 {
        font-size: 14px !important;
        letter-spacing: -0.3px !important;
    }

    .header-actions {
        gap: 4px !important;
    }

    .nav-dropdown-trigger {
        padding: 5px 8px !important;
        font-size: 11.5px !important;
        min-height: 30px !important;
    }

    /* Hide 'Get ' on screens <= 420px so button reads '📋 Quote' cleanly */
    .btn-word-get {
        display: none !important;
    }

    .header-quote-btn {
        padding: 5px 8px !important;
        font-size: 11.5px !important;
        min-height: 30px !important;
    }

    .mobile-sticky-inner .btn,
    .mobile-bar-inner .btn {
        font-size: 12px !important;
        padding: 9px 3px !important;
        gap: 2px !important;
    }

    .thumbnail {
        width: 50px !important;
        height: 50px !important;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}

/* Super narrow viewports (<= 330px - small split preview panes) */
@media (max-width: 330px) {
    .brand-text h1 {
        font-size: 12.5px !important;
    }

    .brand-logo-img {
        height: 25px !important;
        max-width: 55px !important;
    }

    .nav-dropdown-trigger {
        padding: 4px 6px !important;
        font-size: 10.5px !important;
    }

    .header-quote-btn {
        padding: 4px 6px !important;
        font-size: 10.5px !important;
    }
}
