/* 
 * Mikrocum - Comprehensive Responsive Design System
 * Focus: Mobile First, Premium UI scaling
 */

/* 1. Global Responsive Base */
:root {
    --header-height: 70px;
}

@media (max-width: 1200px) {
    .container {
        max-width: 95% !important;
    }
}

@media (max-width: 991px) {
    body {
        font-size: 15px;
    }
    
    h1 { font-size: 28px !important; }
    h2 { font-size: 24px !important; }
    h3 { font-size: 20px !important; }
}

/* 2. Header & Navigation Fixes */
@media (max-width: 991px) {
    .navbar {
        padding: 12px 0 !important;
        background: #fff !important;
        box-shadow: 0 2px 15px rgba(0,0,0,0.08) !important;
    }
    
    .navbar-brand img {
        height: 38px !important;
    }
    
    /* Search Bar outside menu */
    .header-search-container {
        display: flex !important;
        width: 120px !important; /* Slightly smaller for tight spaces */
        padding: 5px 10px !important;
        margin: 0 8px 0 0 !important;
        border-radius: 30px !important;
        background: #f1f5f9 !important;
        position: relative;
    }
    
    .header-search-input {
        font-size: 11px !important;
    }

    .search-results-dropdown {
        width: 280px !important; /* Wider than container on mobile */
        left: auto !important;
        right: -50px !important;
    }

    .navbar-collapse {
        max-height: 85vh;
        padding: 30px 20px !important; /* More padding */
        margin-top: 10px;
        background: #fff;
        border-radius: 20px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    }

    .nav-item {
        margin-bottom: 12px !important; /* Increased spacing between items */
    }

    .nav-link {
        padding: 12px 0 !important; /* More touch target area */
        font-size: 18px !important; /* Slightly larger text for clarity */
    }

    .nav-teklif-btn {
        width: 100% !important;
        height: 50px !important;
        border-radius: 12px !important;
        font-size: 15px !important;
        margin-top: 20px !important;
        background: var(--primary-color) !important;
        border: none !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        color: #fff !important;
    }
}

/* 3. Hero Section Responsive */
@media (max-width: 991px) {
    .hero-section {
        padding-top: 120px !important; /* Increased to separate from header */
        padding-bottom: 60px !important;
        margin-bottom: 40px !important; /* Separate from section below */
        min-height: auto !important;
        background: #fff !important;
    }
    
    .hero-slide {
        padding: 0 !important;
    }

    .hero-title {
        font-size: 22px !important;
        line-height: 1.2 !important;
        margin-bottom: 15px !important;
        text-align: center;
    }
    
    .hero-description {
        font-size: 13px !important;
        margin-bottom: 25px !important;
        text-align: center;
    }
    
    .hero-illustration {
        margin-top: 30px !important;
        padding: 0 15px;
    }
}

/* 3.1 Tab Grid Fix: 2 Columns on Mobile */
@media (max-width: 768px) {
    .product-discovery-section .col-md-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    .discovery-card {
        padding: 20px 10px !important;
        min-height: 240px;
    }
    
    .discovery-card h4 {
        font-size: 14px !important;
        margin-bottom: 8px !important;
    }
    
    .discovery-card p {
        font-size: 11px !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* 4. Neden Mikro Section Fixes */
@media (max-width: 991px) {
    .neden-mikro-section {
        margin-top: 0 !important;
        padding-top: 20px !important;
    }
    
    .neden-mikro-box {
        padding: 30px 15px !important;
        border: none !important;
        box-shadow: none !important;
    }
}

/* WhatsApp & Sticky Bar & Back to Top */
@media (max-width: 991px) {
    .chat-widget {
        bottom: 85px !important;
        right: 15px !important;
    }
    
    .back-to-top-center {
        bottom: 145px !important; /* Moved higher to avoid covering logo */
    }
    
    .footer-bottom {
        padding-bottom: 80px !important; /* Space for sticky bar */
    }
}

/* 5. Product Discovery (Tabs) Fixes */
@media (max-width: 991px) {
    .discovery-tabs {
        gap: 15px !important;
        overflow-x: auto;
        white-space: nowrap;
        flex-wrap: nowrap !important;
        padding-bottom: 10px;
        justify-content: flex-start !important;
    }
    
    .discovery-tabs .nav-link {
        font-size: 14px !important;
    }
    
    .discovery-card {
        padding: 25px 20px !important;
    }
}

/* 6. Form & Newsletter Responsiveness */
.mikro-newsletter div[style*="padding: 48px"] {
    padding: 30px 20px !important;
    border-radius: 20px !important;
}

@media (max-width: 768px) {
    .mikro-newsletter h3 {
        font-size: 24px !important;
        text-align: center !important;
    }
    
    .mikro-newsletter p {
        font-size: 14px !important;
        text-align: center !important;
    }
    
    .form-check {
        align-items: flex-start !important;
        text-align: left !important;
    }

    .newsletter-section .row {
        flex-direction: column-reverse;
    }
    
    .newsletter-content {
        text-align: center;
        padding: 30px 15px !important;
    }
    
    .footer {
        padding: 40px 0 !important;
        text-align: center;
    }
    
    .footer h5::after {
        left: 50% !important;
        transform: translateX(-50%);
    }
}

/* 7. Utilities to fix overflow */
img {
    max-width: 100%;
    height: auto;
}

.row {
    margin-left: -10px !important;
    margin-right: -10px !important;
}

.col-12, .col-lg-4, .col-md-6, .col-lg-3, .col-lg-6 {
    padding-left: 10px !important;
    padding-right: 10px !important;
}

/* WhatsApp & Sticky Bar Alignment Fix */
@media (max-width: 991px) {
    .chat-widget {
        bottom: 75px !important; /* Move above sticky bar */
        right: 15px !important;
    }
    
    .chat-button {
        width: 48px !important;
        height: 48px !important;
        font-size: 22px !important;
    }
    
    .mega-premium-grid {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
        justify-content: space-between !important;
    }
    
    .mega-premium-item {
        flex: 0 0 48% !important; /* Side-by-side */
        max-width: 48% !important;
    }

    .mega-premium-img-wrapper {
        aspect-ratio: 1 / 1 !important; /* Square for mobile to save space */
    }

    .mega-premium-item h6 {
        font-size: 13px !important;
        text-align: left !important;
    }

    .mega-premium-item .mega-item-desc {
        display: none !important; /* Hide description on mobile to save space */
    }
    
    /* Ürünler / Mega Tabs Mobile Fix */
    .mega-group-items-grid {
        grid-template-columns: 1fr 1fr !important; /* 2 columns for sub-items too */
        gap: 15px 10px !important;
    }

    .mega-tab-item h6 {
        font-size: 14px !important;
    }

    .mega-item-desc {
        display: none !important; /* Hide sub-item descriptions on mobile */
    }

    .mega-tabs-sidebar {
        background: #f8f9fa !important;
        padding: 5px !important;
        border-bottom: 2px solid #eee !important;
    }
    
    .mega-tab-link {
        font-size: 13px !important;
        padding: 12px 15px !important; /* Increased padding for easier touch */
        border-bottom: 2px solid transparent;
        margin-right: 10px;
    }
    
    .mega-tab-link.active {
        background: #fff !important;
        color: var(--primary-color) !important;
        border-bottom-color: var(--primary-color) !important;
    }

    .mega-tabs-content-wrapper {
        padding: 15px 10px !important;
    }

    /* Sub-items list (3rd level) */
    .mega-group-items-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px 10px !important;
        padding: 10px 0;
    }

    .mega-tab-item {
        padding: 8px 0 !important;
        border-bottom: 1px solid #f8f9fa;
    }

    .mega-tab-item h6 {
        font-size: 13px !important;
        font-weight: 600 !important;
        color: #334155 !important;
    }

    .mega-tab-item h6::after {
        display: none !important; /* Remove arrow icon on mobile to save space */
    }
    
    .back-to-top-center {
        bottom: 135px !important; /* Move above WhatsApp button */
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        justify-content: center;
    }
    
    .mobile-sticky-bar {
        padding: 5px 0 !important;
        height: 60px !important;
    }
    
    .sticky-bar-item {
        padding: 5px 0 !important;
        font-size: 10px !important;
    }
    
    .mega-pane-footer {
        display: none !important; /* Hide footer links on mobile to focus on titles */
    }

    .sticky-bar-item i {
        font-size: 16px !important;
        margin-bottom: 2px !important;
    }
}

/* Navigation Dropdown Fix for Mobile */
@media (max-width: 991px) {
    .dropdown-menu {
        border: none !important;
        box-shadow: none !important;
        background: #f8f9fa !important;
        margin: 0 !important;
        padding: 10px 20px !important;
    }
    
    .dropdown-item {
        padding: 10px 0 !important;
        font-size: 14px !important;
    }
}
