/* Main CSS for CK Tech Site Template */
@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap');

body {
    color: #1c1b1b;
    font-family: var(--font-family-global);
}

.bg-primary {
    background-color: var(--primary) !important;
}

.text-primary,
.text-light,
.footer .btn.btn-link,
.navbar-light .navbar-nav .nav-link {
    color: var(--primary-text) !important;
}

.service-item .service-icon,
.service-item:hover h5,
.service-item:hover p,
.service-item:hover a.btn {
    color: var(--primary-text) !important;
}

.bg-secondary {
    background-color: var(--secondary) !important;
}

.text-secondary {
    color: var(--secondary) !important;
}

.btn-primary {
    color: #fff;
    background-color: var(--primary);
    border-color: var(--primary);
}

.rich-content {
    font-family: var(--font-family-global);
}

.whatsapp-button {
    position: fixed;
    bottom: 30px;
    /* Increased spacing */
    right: 30px;
    /* Aligned with back-to-top */
    width: 60px;
    height: 60px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #25D366;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.whatsapp-button:hover {
    transform: scale(1.1);
}

.whatsapp-button img {
    width: 35px;
    height: 35px;
    display: block;
    /* Ensure it's a block for better centering */
    margin: 0;
    /* Clear any default margins */
}

.back-to-top {
    right: 30px;
    /* Aligned with whatsapp button */
    bottom: 100px;
    /* Positioned above whatsapp button */
}

.tawk-min-container .tawk-button-circle.tawk-button-large {
    width: 50px !important;
    height: 50px !important;
}

/* SEO Optimization */
img {
    max-width: 100%;
    height: auto;
}

/* Main Navigation & Dropdowns */
.navbar-nav .nav-link.active {
    font-weight: bold;
    color: var(--secondary) !important;
}

.dropdown-menu {
    border: none;
    border-radius: 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    padding: 8px 20px;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--secondary);
    color: var(--secondary-text);
}

/* Mobile Overlay Menu */
.overlay {
    z-index: 9999999;
    background-color: var(--primary);
    color: var(--secondary);
    height: 0%;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    overflow: auto;
    transition: 0.5s;
}

.overlay-content {
    position: relative;
    top: 25%;
    text-align: center;
}

.overlay a {
    display: block;
    font-size: 2rem;
    color: white;
    padding: 15px;
    text-decoration: none;
    transition: 0.3s;
}

.overlay a:hover {
    color: var(--secondary);
}

.overlay .closebtn {
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 3rem;
    color: white;
}

/* Mega Menu Styles */
.mega-menu {
    border-radius: 0;
    margin-top: 0;
    border: none;
    padding: 20px 0;
}

.mega-menu .title {
    margin-bottom: 20px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    font-size: 1rem;
}

.mega-menu .dropdown-item {
    padding: 5px 0;
    font-size: 0.9rem;
}

/* Specific Component Styles inside Menus */
.mega-menu .card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.mega-menu .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: var(--primary);
        padding: 20px;
    }

    .mega-menu {
        background-color: transparent;
        box-shadow: none;
        padding: 0;
    }

    .sticky-top.navbar-light {
        background-color: var(--primary) !important;
    }
}

@media (min-width: 992px) {
    .sticky-top.navbar-light {
        background-color: var(--primary) !important;
    }
}

.sticky-top.navbar-light .navbar-nav .nav-link {
    color: var(--primary-text) !important;
}

.sticky-top.navbar-light .navbar-nav .nav-link:hover,
.sticky-top.navbar-light .navbar-nav .nav-link.active {
    color: var(--secondary) !important;
}

/* ============================================================
   MOBILE-FIRST RESPONSIVE ADDITIONS
   ============================================================ */

/* --- Global overflow guard --- */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* --- Rich-content: tables, iframes, code blocks --- */
.rich-content table,
.rich-content iframe,
.rich-content pre {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}
.rich-content img {
    max-width: 100%;
    height: auto;
}

/* --- Service card icon: responsive size --- */
.service-item .service-icon i {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
}

/* --- Breadcrumb: truncate long leaf labels on small screens --- */
.breadcrumb-bar .breadcrumb-item.active {
    max-width: 50vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Navbar logo: cap size, never overflow --- */
#navBar .navbar-brand img {
    max-height: 48px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

/* --- Navbar toggler: minimum touch target (44×44px) --- */
#navBar .navbar-toggler {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem;
}

/* --- Navbar dropdown: full width on mobile --- */
@media (max-width: 991.98px) {
    .navbar-nav .dropdown-menu {
        width: 100%;
    }

    /* SPECIAL-L/R buttons: stack vertically, full width inside mobile menu */
    .navbar-special-left,
    .navbar-special-right {
        width: 100%;
        justify-content: center;
        margin: 0.5rem 0;
    }

    /* Overlay menu links: tighter on very small screens */
    .overlay a {
        font-size: 1.5rem;
        padding: 10px;
    }

    .overlay .closebtn {
        font-size: 2.25rem;
        right: 20px;
        top: 15px;
    }
}

/* --- Slider: responsive height, cover instead of contain --- */
#home-container .carousel-item img,
#home-container .carousel-item video {
    object-fit: cover;
    width: 100%;
    max-height: clamp(220px, 60vw, 700px);
}

/* Floating card boxes: safe positioning on all screen sizes */
@media (max-width: 575.98px) {
    .floating-boxes-container {
        position: static;
        transform: none;
        width: 100%;
        padding: 1rem;
        margin-top: -2rem;
        background: transparent;
    }

    .floating-boxes-container a {
        flex: 0 0 45%;
        min-width: 130px;
        aspect-ratio: 1 / 1;
    }

    .floating-box {
        padding: 12px;
    }

    .floating-box .icon img {
        width: 28px;
        height: 28px;
    }

    .floating-box .icon i {
        font-size: 22px;
    }

    .floating-box .text p {
        font-size: 12px;
    }
}

/* --- Breadcrumb: remove px overflow on small screens --- */
@media (max-width: 575.98px) {
    .breadcrumb-bar .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* --- Card grids: single column base, responsive up --- */
@media (max-width: 575.98px) {
    .card-img-top {
        height: 180px !important;
        object-fit: cover;
    }
}

/* --- Blog detail share buttons: wrap on mobile --- */
@media (max-width: 575.98px) {
    .blog-share-links {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
}

/* --- Back-to-top & WhatsApp: reduce size on mobile to avoid overlap --- */
@media (max-width: 575.98px) {
    .whatsapp-button {
        width: 48px;
        height: 48px;
        bottom: 20px;
        right: 20px;
    }

    .whatsapp-button img {
        width: 26px;
        height: 26px;
    }

    .back-to-top {
        bottom: 80px;
        right: 20px;
    }
}

/* --- Section headings: scale down on mobile --- */
@media (max-width: 575.98px) {
    .section-title h1,
    .section-title h2,
    .section-title h6 {
        font-size: clamp(1rem, 5vw, 1.5rem);
    }
}