/* ============================================
   Mobile Responsive Styles
   Only affects screens ≤ 768px
   ============================================ */

/* --- Top Bar --- */
@media (max-width: 768px) {
    .header-top-left {
        display: flex;
        flex-direction: column;
        line-height: 1.8;
        font-size: 12px;
    }
    .header-top-left span {
        margin: 0;
    }
}

/* --- Navigation: Hamburger Menu --- */
@media (max-width: 768px) {
    .main-navigation {
        position: static;
    }
    .main-navigation .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        z-index: 999;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        padding: 0;
        margin: 0;
        list-style: none;
        max-height: 80vh;
        overflow-y: auto;
    }
    .main-navigation .nav-menu > li {
        display: block;
        border-bottom: 1px solid #eee;
        margin: 0;
    }
    .main-navigation .nav-menu > li > a {
        display: block;
        padding: 14px 20px;
        font-size: 15px;
        color: #192a3d;
        text-decoration: none;
    }
    .main-navigation .nav-menu > li > a:hover {
        background: #f5f7fa;
    }
    /* Sub-menu */
    .main-navigation .sub-menu {
        display: none;
        background: #f8f9fa;
        padding: 0;
        margin: 0;
        list-style: none;
    }
    .main-navigation .sub-menu li a {
        display: block;
        padding: 10px 20px 10px 35px;
        font-size: 14px;
        color: #3A4F66;
        text-decoration: none;
        border-top: 1px solid #e8ecf0;
    }
    .main-navigation .menu-item-has-children > a::after {
        content: " ▾";
        float: right;
        font-size: 12px;
    }
    .main-navigation .menu-item-has-children.sub-menu-open > a::after {
        content: " ▴";
    }
    /* Hamburger button */
    .menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 8px;
    }
    .menu-toggle span {
        display: block;
        width: 24px;
        height: 2px;
        background: #192a3d;
        margin: 3px 0;
        transition: all 0.3s;
        border-radius: 1px;
    }
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }
}

/* --- Hero/Banner --- */
@media (max-width: 768px) {
    .page-banner {
        padding: 30px 15px !important;
    }
    .page-banner h1 {
        font-size: 20px !important;
    }
}

/* --- Product Detail Page --- */
@media (max-width: 768px) {
    .container div[style*="display:flex"][style*="align-items:flex-start"] {
        flex-direction: column !important;
    }
    .container div[style*="flex:0 0 40%;max-width:40%"] {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        margin-bottom: 20px;
    }
    .container h2[style*="font-size:22px"] {
        font-size: 18px !important;
    }
    /* Tables: horizontal scroll on mobile */
    div[style*="overflow-x:auto"] {
        -webkit-overflow-scrolling: touch;
    }
    table {
        font-size: 12px !important;
    }
    table td, table th {
        padding: 5px 6px !important;
    }
    /* Spec section heading */
    h3[style*="font-size:18px"] {
        font-size: 16px !important;
    }
    /* Inquire section */
    div[style*="background:#f2f5f7;border-radius:8px"] {
        padding: 20px 15px !important;
    }
}

/* --- Product Archive Grid --- */
@media (max-width: 768px) {
    .products-archive-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .product-archive-card h3 {
        font-size: 13px !important;
    }
    .product-archive-card .img-wrap,
    .product-archive-card > a:first-child {
        height: 160px;
    }
}

@media (max-width: 480px) {
    .products-archive-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    .product-archive-card > a:first-child {
        height: 130px;
    }
}

/* --- Footer --- */
@media (max-width: 768px) {
    footer .container div[style*="display:grid"] {
        grid-template-columns: 1fr !important;
    }
    footer .container div[style*="display:flex"] {
        flex-direction: column !important;
    }
}

/* --- General Text --- */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    .container p, 
    .container li,
    .container div[style*="font-size:14px"] {
        font-size: 14px !important;
    }
}

/* --- Header Main Area --- */
@media (max-width: 768px) {
    .header-main .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 15px;
    }
    .header-main .site-branding {
        flex: 1;
    }
    .header-main .header-search {
        margin-left: 10px;
    }
}

/* --- Contact page --- */
@media (max-width: 768px) {
    .wpcf7 form {
        padding: 15px;
    }
    .wpcf7 input[type="text"],
    .wpcf7 input[type="email"],
    .wpcf7 textarea {
        font-size: 16px !important; /* prevents iOS zoom */
    }
}