/* ============================================================
   BBM Technology - Responsive Styles
   ============================================================ */

/* --- Tablet (max-width: 1024px) --- */
@media (max-width: 1024px) {
    :root {
        --bbm-section-padding: 60px 0;
    }

    h1 { font-size: 2.5rem; }
    h2 { font-size: 1.8rem; }

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

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

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

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

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

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

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

    .bbm-team-card {
        width: calc((100% - 30px) / 2);
    }

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

    .bbm-about-intro {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .bbm-contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .bbm-service-detail-card {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .bbm-service-detail-card:nth-child(even) {
        direction: ltr;
    }

    .bbm-service-detail-image {
        min-height: 250px;
    }

    .bbm-hero-content h1 {
        font-size: 3.2rem;
    }

    .bbm-hero-content p {
        font-size: 1.15rem;
    }

    .bbm-cta-content h2 {
        font-size: 2rem;
    }

    .bbm-partners-track {
        gap: 30px;
    }
}

/* --- Mobile Large (max-width: 768px) --- */
@media (max-width: 768px) {
    :root {
        --bbm-section-padding: 50px 0;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    /* Header Mobile */
    .bbm-header {
        z-index: 9999 !important;
    }

    .bbm-hamburger {
        display: flex !important;
        z-index: 10000 !important;
    }

    .bbm-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: var(--bbm-primary-dark);
        flex-direction: column;
        padding: 80px 30px 30px;
        transition: var(--bbm-transition);
        box-shadow: -10px 0 30px rgba(0,0,0,0.3);
        z-index: 1000;
        overflow-y: auto;
    }

    .bbm-nav.active {
        right: 0;
    }

    .bbm-nav-menu {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0;
    }

    .bbm-nav-menu li a {
        padding: 16px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        border-radius: var(--bbm-radius-sm);
        font-size: 1.1rem;
        text-align: center;
    }
    
    .bbm-nav-menu li:last-child a {
        border-bottom: none;
    }

    .bbm-nav-cta {
        margin-left: 0;
        margin-top: 20px;
        width: 100%;
    }

    .bbm-nav-cta .bbm-btn {
        width: 100%;
        justify-content: center;
    }

    .bbm-mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }

    .bbm-mobile-overlay.active {
        display: block;
    }

    /* Hero */
    .bbm-hero {
        min-height: 90vh;
    }

    .bbm-hero-content {
        padding: 100px 0 60px;
    }

    .bbm-hero-content h1 {
        font-size: 2.4rem;
    }

    .bbm-hero-content p {
        font-size: 1.05rem;
    }

    .bbm-hero-buttons {
        flex-direction: column;
    }

    .bbm-hero-buttons .bbm-btn {
        width: 100%;
        justify-content: center;
    }

    /* Features */
    .bbm-features-row {
        margin-top: -40px;
    }

    .bbm-features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .bbm-feature-card {
        padding: 24px 16px;
    }

    .bbm-feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    /* Services */
    .bbm-services-grid {
        grid-template-columns: 1fr;
    }

    /* Projects */
    .bbm-projects-grid {
        grid-template-columns: 1fr;
    }

    .bbm-projects-filter {
        gap: 8px;
    }

    .bbm-filter-btn {
        padding: 6px 16px;
        font-size: 0.8rem;
    }

    /* Products */
    .bbm-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    /* Blog */
    .bbm-blog-grid {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .bbm-footer-grid {
        grid-template-columns: 1fr;
        gap: 45px;
    }

    .bbm-footer-col:first-child {
        text-align: center;
    }

    .bbm-footer-col:first-child .bbm-footer-logo {
        display: flex;
        justify-content: center;
    }

    .bbm-footer-col:first-child .bbm-footer-social {
        justify-content: center;
    }

    /* Partners */
    .bbm-partners-track {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .bbm-partners-nav {
        display: none;
    }

    /* Stats */
    .bbm-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .bbm-stat-number {
        font-size: 2rem;
    }

    /* Team */
    .bbm-team-grid {
        gap: 20px;
    }
    
    .bbm-team-card {
        width: calc((100% - 20px) / 2);
    }

    /* Values */
    .bbm-values-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    /* VM */
    .bbm-vm-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .bbm-vm-card {
        padding: 30px;
    }

    /* Contact */
    .bbm-contact-form {
        padding: 24px;
    }

    .bbm-form-row {
        grid-template-columns: 1fr;
    }

    /* Page Header */
    .bbm-page-header {
        padding: 120px 0 40px;
    }

    .bbm-page-header h1 {
        font-size: 1.8rem;
    }

    /* CTA */
    .bbm-cta-content h2 {
        font-size: 1.6rem;
    }

    /* Section header */
    .bbm-section-header {
        margin-bottom: 35px;
    }

    .bbm-section-header h2 {
        font-size: 1.5rem;
    }

    /* Single */
    .bbm-single-content {
        padding: 40px 16px;
    }

    .bbm-single-content h1 {
        font-size: 1.8rem;
    }

    .bbm-single-meta {
        flex-wrap: wrap;
        gap: 10px;
    }

    /* 404 */
    .bbm-404-content h1 {
        font-size: 5rem;
    }
}

/* --- Mobile Small (max-width: 480px) --- */
@media (max-width: 480px) {
    .bbm-features-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .bbm-feature-card {
        padding: 20px 12px;
    }

    .bbm-feature-card h4 {
        font-size: 0.85rem;
    }

    .bbm-feature-card p {
        font-size: 0.75rem;
    }

    .bbm-hero-content h1 {
        font-size: 2rem;
    }

    .bbm-features-grid {
        grid-template-columns: 1fr;
    }

    .bbm-products-grid {
        grid-template-columns: 1fr;
    }

    .bbm-product-card-image {
        height: 200px;
    }

    .bbm-team-card {
        width: 100%;
    }

    .bbm-btn {
        padding: 12px 24px;
        font-size: 0.85rem;
    }

    .bbm-btn-lg {
        padding: 14px 30px;
    }

    .bbm-stat-card {
        padding: 20px 12px;
    }

    .bbm-stat-number {
        font-size: 1.6rem;
    }
}

/* ============================================================
   BENTO GRID RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .bbm-bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bbm-bento-hero {
        grid-column: span 2;
        grid-row: span 2;
    }
    .bbm-bento-portrait {
        grid-column: span 1;
        grid-row: span 1;
    }
    .bbm-bento-cta {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    .bbm-bento-cta-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

@media (max-width: 768px) {
    .bbm-projects-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .bbm-filter-actions {
        width: 100%;
        justify-content: space-between;
    }
    .bbm-search-form {
        flex: 1;
    }
    .bbm-search-form input {
        width: 100%;
    }
    .bbm-bento-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 300px;
    }
    .bbm-bento-hero, .bbm-bento-portrait, .bbm-bento-square {
        grid-column: span 1;
        grid-row: span 1;
    }
    .bbm-bento-hero .bbm-bento-content h3 {
        font-size: 1.4rem;
    }
}

/* ============================================================
   SINGLE PROJECT RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .bbm-single-project-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .bbm-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .bbm-project-detail-header {
        padding: 40px 0;
    }
    
    .bbm-project-detail-header h1 {
        font-size: 2rem;
    }
    
    .bbm-project-main-title {
        font-size: 2rem;
    }
    
    .bbm-project-info-cards {
        flex-direction: column;
    }
    
    .bbm-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .bbm-gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .bbm-gallery-filter button {
        width: 100%;
        margin-bottom: 5px;
    }
}

/* ============================================================
   MOBILE HAMBURGER MENU REDESIGN
   ============================================================ */
@media (max-width: 768px) {
    .bbm-nav-mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 40px;
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .bbm-logo-mobile img {
        height: 35px;
    }

    .bbm-nav-close {
        background: transparent;
        border: none;
        color: var(--bbm-white);
        font-size: 1.5rem;
        cursor: pointer;
    }

    .bbm-nav-menu li a {
        text-align: left;
        padding: 15px 10px;
        display: flex;
        align-items: center;
        gap: 15px;
        border-bottom: none;
        color: rgba(255,255,255,0.9);
        font-size: 1.05rem;
        font-weight: 400;
    }

    .bbm-nav-menu li a i {
        width: 20px;
        text-align: center;
        color: var(--bbm-accent);
        font-size: 1.1rem;
    }

    .bbm-nav-menu li a:hover,
    .bbm-nav-menu li.current-menu-item > a {
        color: var(--bbm-white);
        background: rgba(255,255,255,0.05);
        border-radius: var(--bbm-radius-sm);
    }

    .bbm-nav-cta {
        margin-top: 30px;
    }

    .bbm-btn-outline-mobile {
        width: 100%;
        justify-content: center;
        border-color: rgba(255,255,255,0.3);
        color: var(--bbm-white);
    }

    .bbm-btn-outline-mobile:hover {
        background: var(--bbm-accent);
        border-color: var(--bbm-accent);
    }

    .bbm-nav-socials {
        display: flex;
        justify-content: center;
        gap: 20px;
        margin-top: 40px;
    }

    .bbm-social-link {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(255,255,255,0.1);
        color: var(--bbm-white);
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        transition: var(--bbm-transition);
    }

    .bbm-social-link:hover {
        background: var(--bbm-accent);
    }
}

/* ============================================================
   HOME MOBILE REDESIGN
   ============================================================ */
@media (max-width: 768px) {
    .bbm-hero-buttons {
        gap: 10px !important;
        flex-direction: row;
        flex-wrap: nowrap !important;
    }
    
    .bbm-hero-buttons .bbm-btn {
        width: 50%;
        padding: 12px 0;
        font-size: 0.9rem;
        display: flex;
        justify-content: center;
    }

    .bbm-features-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }

    .bbm-feature-card {
        padding: 20px 10px;
        text-align: center;
        border: 1px solid rgba(0,0,0,0.08);
        box-shadow: none;
        border-radius: var(--bbm-radius-sm);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 140px;
    }

    .bbm-feature-card p {
        display: none;
    }

    .bbm-feature-card h4 {
        font-size: 0.85rem;
        margin-bottom: 0;
    }

    .bbm-feature-icon {
        width: 50px !important;
        height: 50px !important;
        margin: 0 auto 15px auto !important;
    }
    
    .bbm-feature-icon i {
        font-size: 1.5rem;
    }
}

/* ============================================================
   ABOUT US MOBILE REDESIGN
   ============================================================ */
@media (max-width: 768px) {
    .bbm-stats-grid .bbm-stat-card {
        background: var(--bbm-white);
        border: 1px solid rgba(0,0,0,0.08);
        border-radius: var(--bbm-radius-sm);
        padding: 20px 10px;
    }
    .bbm-stats-grid .bbm-stat-number {
        font-size: 1.8rem;
    }
    .bbm-stats-grid .bbm-stat-label {
        font-size: 0.8rem;
    }
}

/* ============================================================
   PROJECTS MOBILE REDESIGN (From Mockup 4)
   ============================================================ */
@media (max-width: 768px) {
    .bbm-projects-filter-bar {
        background: transparent;
        box-shadow: none;
        padding: 0;
        margin-bottom: 20px;
        width: 100%;
        max-width: 100vw;
    }
    
    .bbm-filter-links {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        gap: 10px;
        width: 100%;
        min-width: 0;
    }
    
    .bbm-filter-links::-webkit-scrollbar {
        display: none;
    }

    .bbm-filter-link {
        white-space: nowrap;
        border: 1px solid rgba(0,0,0,0.1);
        border-radius: 30px;
        padding: 8px 20px;
        background: var(--bbm-white);
        color: var(--bbm-dark-gray);
        font-weight: 400;
    }

    .bbm-filter-link i {
        display: none;
    }

    .bbm-filter-link.active {
        background: var(--bbm-primary) !important;
        color: var(--bbm-white) !important;
        border-color: var(--bbm-primary) !important;
    }

    .bbm-filter-actions {
        display: flex;
        justify-content: space-between;
        width: 100%;
        margin-top: 15px;
    }
}

/* ============================================================
   SINGLE PROJECT MOBILE REDESIGN (From Mockup 5)
   ============================================================ */
.bbm-mobile-sticky-bar {
    display: none !important;
}

@media (max-width: 768px) {
    .bbm-mobile-sticky-bar {
        display: none !important;
    }

    /* Only add bottom padding on pages that have the sticky bar (single project) */
    .single-bbm_project body,
    body.single-bbm_project {
        padding-bottom: 0px !important; /* Add padding so sticky bar doesnt overlap content */
    }
}

/* ============================================================
   BLOG MOBILE REDESIGN (From Mockup 6)
   ============================================================ */
@media (max-width: 768px) {
    .bbm-blog-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .bbm-blog-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 10px;
        background: var(--bbm-white);
        border-radius: var(--bbm-radius-md);
        border: 1px solid rgba(0,0,0,0.05);
        box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    }

    .bbm-blog-card-image {
        width: 100px;
        height: 100px;
        border-radius: var(--bbm-radius-sm);
        flex-shrink: 0;
        margin-right: 15px;
        overflow: hidden;
    }

    .bbm-blog-card-content {
        padding: 0;
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .bbm-blog-card-tag {
        font-size: 0.7rem;
        padding: 2px 8px;
        margin-bottom: 5px;
        align-self: flex-start;
    }

    .bbm-blog-card-content h3 {
        font-size: 0.95rem;
        margin-bottom: 5px;
        line-height: 1.3;
    }

    .bbm-blog-card-meta {
        font-size: 0.75rem;
        margin-bottom: 0;
    }

    .bbm-blog-card-meta span:nth-child(2),
    .bbm-blog-card-content p,
    .bbm-read-more {
        display: none; /* Hide author, excerpt, and read more button to match mockup */
    }
}

/* ============================================================
   SINGLE PROJECT HEADER MOBILE FIX
   ============================================================ */
@media (max-width: 768px) {
    .bbm-page-header {
        padding-top: 160px !important;
    }
    .bbm-header-desc {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 20px;
        color: rgba(255,255,255,0.8);
    }
    .bbm-breadcrumb {
        flex-wrap: wrap;
        row-gap: 5px;
        line-height: 1.6;
    }
}

/* ============================================================
   FALLBACK MOBILE HEADER (When Elementor overrides header)
   ============================================================ */
.bbm-mobile-fallback-header {
    display: none;
}

@media (max-width: 768px) {
    .bbm-mobile-fallback-header {
        display: block;
        position: fixed;
        top: 15px;
        right: 15px;
        z-index: 99999;
    }

    .bbm-hamburger-fallback {
        display: flex !important;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        z-index: 99999 !important;
        padding: 10px;
        background: rgba(11, 25, 48, 0.9);
        border: none;
        border-radius: var(--bbm-radius-sm);
        box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    }

    .bbm-hamburger-fallback span {
        display: block;
        width: 25px;
        height: 2px;
        background: var(--bbm-white);
        transition: var(--bbm-transition);
        border-radius: 2px;
    }

    .bbm-hamburger-fallback.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .bbm-hamburger-fallback.active span:nth-child(2) {
        opacity: 0;
    }

    .bbm-hamburger-fallback.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .bbm-nav-fallback {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: var(--bbm-primary-dark);
        flex-direction: column;
        padding: 80px 30px 30px;
        transition: var(--bbm-transition);
        box-shadow: -10px 0 30px rgba(0,0,0,0.3);
        z-index: 99998;
        overflow-y: auto;
        display: flex;
    }

    .bbm-nav-fallback.active {
        right: 0;
    }
}
