/**
 * Website Responsive Overrides
 * Breakpoints: Mobile ≤480px | Tablet 481–768px | Small laptop 769–1024px | Desktop >1024px
 * QA: No horizontal scroll | Tappable buttons | Readable fonts | Images not broken | Menu works
 */

/* ========== 1. PREVENT HORIZONTAL SCROLL ========== */
html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}
body,
.page-wrapper {
    overflow-x: hidden;
    max-width: 100vw;
}
/* Ensure no fixed-width container causes overflow */
.auto-container,
.small-container {
    width: 100%;
    max-width: 1200px;
    padding-left: 15px;
    padding-right: 15px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* ========== 2. FLUID CONTAINERS & GRID ========== */
/* Grid wrap - no overflow; keep Bootstrap row gutters */
[class*="col-"] {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* ========== 3. TYPOGRAPHY - MOBILE READABILITY ========== */
/* Base - comfortable line length */
p, .text {
    max-width: 65ch;
}
/* Headings - not too large on small screens */
.sec-title h2,
.sec-title h3,
.page-title h1 {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ========== 4. IMAGES - SCALE NOT STRETCH ========== */
img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}
.main-header .logo img,
.mobile-header .logo img,
.sticky-header .logo img,
.main-footer img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}
/* Banner / hero - text and CTA visible */
.page-title .cws-image-bg,
.background-layers .cws-image-bg {
    background-size: cover;
    background-position: center;
}

/* About page: show full image (no crop) */
.about-section-three .background-layers .cws-image-bg{
    background-size: contain !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    clip-path: none !important;
    -webkit-clip-path: none !important;
}
.page-title--blog .cws-image-bg {
    /* Default: crop top strip of the background image where old template header is baked in */
    background-position: center bottom !important;
    position: relative;
}
/* Tablet layouts (e.g. iPad / iPad Air) need a stronger crop + overlay,
   otherwise the baked-in ELITECH header band reappears due to aspect ratio */
@media (min-width: 768px) and (max-width: 1024px) {
    .page-title--blog .cws-image-bg {
        background-position: center 95% !important;
    }
    .page-title--blog .cws-image-bg::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        height: 90px;
        background: linear-gradient(to bottom, #0b233d 0%, rgba(11,35,61,0.0) 100%);
        pointer-events: none;
    }
}
.page-title .auto-container {
    position: relative;
    z-index: 2;
}

/* ========== 5. BUTTONS & LINKS - FINGER FRIENDLY (min 44px tap) ========== */
a.theme-btn,
button.theme-btn,
.btn-box a,
.mobile-menu .navigation li > a {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.mobile-menu .navigation > li > a {
    padding: 14px 20px;
    min-height: 48px;
}

/* ========== 5b. MOBILE HEADER POSITION - NO WHITE STRIP, PROPER ALIGN ========== */
/* NOTE: Use mobile header up to 1199px to avoid tablet (landscape) menu overflow */
@media (max-width: 1199px) {
    /* Force desktop header sections off on tablet/mobile */
    .main-header .main-box,
    .main-header .sticky-header {
        display: none !important;
    }
    .main-header .nav-outer .main-menu {
        display: none !important;
    }

    /* Remove any top gap (white strip above header) */
    body.horizontal-layout,
    .page-wrapper {
        padding-top: 0 !important;
    }
    /* Header at top - no gap, full width */
    .main-header {
        margin: 0;
        padding: 0;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        box-sizing: border-box;
    }
    /* Single bar: logo left, hamburger right edge, vertically centered */
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        margin: 0;
        padding: 12px 8px 12px 16px;
        box-sizing: border-box;
        min-height: 56px;
    }
    .mobile-header .logo {
        flex: 0 0 auto;
        margin: 0;
        padding: 0;
        height: auto;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .mobile-header .logo a {
        display: flex;
        align-items: center;
    }
    .mobile-header .nav-outer {
        flex: 0 0 auto;
        float: none;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        margin: 0;
        margin-left: auto;
    }
    /* Mobile menu toggle (hamburger) - right side position, visible and tappable */
    .mobile-header .nav-outer .mobile-nav-toggler {
        float: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        width: 44px;
        height: 44px;
        border-radius: 4px;
        color: #333333;
        background-color: transparent;
        transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
    }
    .nav-outer .mobile-nav-toggler:hover {
        background-color: rgba(0,0,0,0.06);
        transform: translateY(-1px);
    }
}
@media (max-width: 480px) {
    .mobile-header {
        padding: 10px 8px 10px 12px;
        min-height: 52px;
    }
}

/* ========== 6. MOBILE MENU - READABLE, TOUCH FRIENDLY, CLOSE CLEAR ========== */
@media (max-width: 1199px) {
    .mobile-menu .close-btn {
        min-width: 48px;
        min-height: 48px;
        padding: 12px;
        right: 12px;
        top: 12px;
    }
    .mobile-menu .navigation li > a {
        padding: 12px 20px;
        font-size: 15px;
        line-height: 1.4;
    }
    .mobile-menu .nav-logo {
        padding: 16px 20px;
    }
    .mobile-menu .nav-logo img {
        max-width: 140px;
        height: auto;
    }
}
/* Sticky header height on mobile - avoid overlap */
.sticky-header .outer-box {
    min-height: 60px;
    display: flex;
    align-items: center;
}
.sticky-header .logo img {
    max-height: 50px;
    width: auto;
}

/* ========== 7. FORMS - ONE COLUMN, FULL WIDTH ON MOBILE ========== */
@media (max-width: 768px) {
    .default-form .form-group,
    .contact-form-section .form-group,
    .form-group {
        width: 100%;
        max-width: 100%;
    }
    .default-form input[type="text"],
    .default-form input[type="email"],
    .default-form input[type="tel"],
    .default-form input[type="search"],
    .default-form textarea,
    .contact-form-section input,
    .contact-form-section textarea {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .default-form .form-group input[type="submit"],
    .default-form .form-group button,
    .theme-btn[type="submit"] {
        width: 100%;
        max-width: 100%;
        min-height: 48px;
    }
}

/* ========== 8. TABLES - HORIZONTAL SCROLL WRAPPER ========== */
.table-responsive,
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 1rem;
}
.table-responsive table,
.table-wrapper table {
    min-width: 400px;
    width: 100%;
}
.table-responsive th,
.table-responsive td,
.table-wrapper th,
.table-wrapper td {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ========== 9. FOOTER - STACK ON MOBILE/TABLET ========== */
.main-footer .widgets-section .row {
    margin-left: -10px;
    margin-right: -10px;
}
.main-footer .footer-column,
.main-footer .col-lg-2,
.main-footer .col-lg-3,
.main-footer .col-md-4,
.main-footer .col-md-6 {
    margin-bottom: 24px;
}
.main-footer .footer-address-text,
.main-footer .widget-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ========== 10. STANDARD BREAKPOINTS ========== */

/* Mobile: ≤ 480px - 1 column, less padding */
@media (max-width: 480px) {
    .auto-container,
    .small-container {
        padding-left: 12px;
        padding-right: 12px;
    }
    /* Mobile header logo - lighter/smaller so header heavy na lage */
    .mobile-header .logo img {
        max-height: 32px;
        width: auto;
    }
    .sec-title h2,
    .sec-title h3 {
        font-size: 26px !important;
    }
    .page-title h1 {
        font-size: 28px !important;
    }
    .main-footer .widgets-section {
        padding-top: 30px;
        padding-bottom: 30px;
    }
    .main-footer .footer-bottom .copyright-text p {
        font-size: 13px;
        text-align: center;
        line-height: 1.5;
    }
    /* Cards / shop items - 1 column */
    .shop-item,
    .our-shop .col-sm-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .sidebar-page-container .content-side,
    .sidebar-page-container .sidebar-side {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Tablet: 481–768px - 2 columns where applicable */
@media (min-width: 481px) and (max-width: 768px) {
    .shop-item.col-md-6,
    .our-shop .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    .main-footer .col-md-4,
    .main-footer .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Small laptop: 769–1024px */
@media (min-width: 769px) and (max-width: 1024px) {
    .main-footer .col-lg-2,
    .main-footer .col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Desktop: > 1024px - 3/4 columns already in Bootstrap col-lg-* */

/* ========== 11. SECTION PADDING - LESS ON MOBILE ========== */
@media (max-width: 768px) {
    section {
        padding-top: 40px;
        padding-bottom: 40px;
    }
    .page-title {
        padding-top: 80px;
        padding-bottom: 60px;
    }
}
@media (max-width: 480px) {
    section {
        padding-top: 28px;
        padding-bottom: 28px;
    }
    .page-title {
        padding-top: 60px;
        padding-bottom: 40px;
    }
}

/* ========== 12. MEGA MENU - NO OVERFLOW ON MOBILE ========== */
@media (max-width: 1199px) {
    .mega-menu[data-width] {
        max-width: 100% !important;
    }
    .mobile-menu .mega-menu-bar .column {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ========== 13. SCROLL TO TOP - TAPPABLE ========== */
.scroll-to-top {
    min-width: 48px;
    min-height: 48px;
    padding: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ========== 14. SOCIAL ICONS / TEL LINKS - TAPPABLE ========== */
.main-footer .social-icon a,
.main-header .social-icon a {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
a[href^="tel:"] {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}
