/*=========================================================
| Mobile Responsive Fixes
==========================================================*/

/* General Mobile Fixes */
@media (max-width: 991.98px) {
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Header fixes */
    .ecommerce-header {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .header-sticky {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    body {
        padding-top: 80px; /* Account for fixed header */
    }
    
    /* Logo responsive */
    .nav-logo {
        max-height: 35px !important;
        width: auto !important;
    }
    
    /* Cart icon improvements */
    .header-cart-1 .cart-icon {
        min-width: 35px;
        min-height: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .header-cart-count {
        font-size: 11px;
        min-width: 18px;
        height: 18px;
        line-height: 18px;
    }
    
    /* Mobile search bar styling */
    .mobile-search-bar {
        border-top: 1px solid #eee;
    }
    
    .mobile-search-bar .input-group {
        border-radius: 25px;
        overflow: hidden;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .mobile-search-bar .form-control {
        border: none;
        border-radius: 0;
        padding: 12px 15px;
    }
    
    .mobile-search-bar .btn {
        border: none;
        border-radius: 0;
        padding: 12px 20px;
    }
    
    /* Push navigation improvements */
    .push-nav-toggle {
        background: none !important;
        border: none !important;
        padding: 8px !important;
        margin-right: 10px;
    }
    
    .push-nav-toggle i {
        font-size: 18px !important;
    }
    
    .navbar-slide-push {
        width: 300px !important;
        max-width: 85vw !important;
        background: white !important;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .login-signup {
        background: var(--theme-primary-color) !important;
    }
    
    /* Navigation menu styling */
    .push-navbar .navbar-nav .nav-link {
        padding: 12px 20px !important;
        border-bottom: 1px solid #f0f0f0;
        color: #333 !important;
        font-weight: 500;
    }
    
    .push-navbar .navbar-nav .nav-link:hover {
        background: #f8f9fa;
        color: var(--theme-primary-color) !important;
    }
    
    /* Categories menu styling */
    .categories-menu .menu li a {
        padding: 12px 20px !important;
        border-bottom: 1px solid #f0f0f0;
        color: #333 !important;
        display: block;
        text-decoration: none;
    }
    
    .categories-menu .menu li a:hover {
        background: #f8f9fa;
        color: var(--theme-primary-color) !important;
    }
    
    /* Tab styling in mobile menu */
    .nav-pills .nav-link {
        border-radius: 0;
        border-bottom: 2px solid transparent;
        background: none !important;
        color: #666 !important;
        font-weight: 600;
    }
    
    .nav-pills .nav-link.active {
        background: none !important;
        color: var(--theme-primary-color) !important;
        border-bottom-color: var(--theme-primary-color);
    }
}

/* Small mobile devices */
@media (max-width: 575.98px) {
    .navbar-brand {
        flex-grow: 1;
        text-align: left;
    }
    
    .nav-logo {
        max-height: 30px !important;
    }
    
    .header-cart-1 {
        margin-left: 5px;
    }
    
    .header-cart-1 .cart-wrap {
        display: none !important;
    }
    
    .header-cart-1 .cart-icon {
        min-width: 30px;
        min-height: 30px;
    }
    
    .header-cart-count {
        font-size: 10px;
        min-width: 16px;
        height: 16px;
        line-height: 16px;
    }
    
    /* Account dropdown hide text on very small screens */
    .sign-in .has-dropdown i {
        margin: 0 !important;
    }
    
    /* Adjust mobile search */
    .mobile-search-bar {
        padding: 10px 0;
    }
    
    .mobile-search-bar .form-control {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .mobile-search-bar .btn {
        padding: 10px 15px;
    }
}

/* Medium screens */
@media (min-width: 768px) and (max-width: 991.98px) {
    .header-cart-1 .cart-wrap .cart-text {
        font-size: 12px;
    }
    
    .wishlist-view,
    .refresh-view {
        margin: 0 5px;
    }
}

/* Fix for dropdown menus on mobile */
@media (max-width: 991.98px) {
    .dropdown-menu {
        position: static !important;
        transform: none !important;
        box-shadow: none;
        border: none;
        background: #f8f9fa;
        margin-top: 0;
    }
    
    .dropdown-item {
        padding: 8px 20px;
        color: #666 !important;
    }
    
    .dropdown-item:hover {
        background: #e9ecef;
        color: var(--theme-primary-color) !important;
    }
}

/* Footer responsive fixes */
@media (max-width: 767.98px) {
    .footer-widget {
        margin-bottom: 30px;
        text-align: center;
    }
    
    .footer-widget ul {
        columns: 1;
    }
    
    .footer-widget h6 {
        margin-bottom: 15px;
    }
}

/* Product grid responsive */
@media (max-width: 575.98px) {
    .product-wrapper {
        margin-bottom: 20px;
    }
    
    .product-wrapper .product-image {
        height: 200px;
        overflow: hidden;
    }
    
    .product-wrapper .product-info {
        padding: 10px;
    }
    
    .product-wrapper .product-info h6 {
        font-size: 14px;
        line-height: 1.3;
        margin-bottom: 8px;
    }
}

/* Cart popup responsive */
@media (max-width: 575.98px) {
    .header-cart-1 .cart-popup {
        right: -10px;
        left: -10px;
        width: auto;
        max-width: none;
    }
}

/* Breadcrumb responsive */
@media (max-width: 575.98px) {
    .breadcrumb {
        font-size: 12px;
    }
    
    .breadcrumb-item {
        padding: 0 5px;
    }
}

/* General text responsiveness */
@media (max-width: 575.98px) {
    h1, .h1 {
        font-size: 24px !important;
    }
    
    h2, .h2 {
        font-size: 20px !important;
    }
    
    h3, .h3 {
        font-size: 18px !important;
    }
    
    h4, .h4 {
        font-size: 16px !important;
    }
    
    h5, .h5 {
        font-size: 14px !important;
    }
    
    h6, .h6 {
        font-size: 13px !important;
    }
}

/* Overlay fix for mobile menu */
.nav-leftpush-overlay.active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* Animation improvements */
.navbar-slide-push {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

.navbar-slide-push.show {
    transform: translateX(0);
}

/* Mobile search bar hide animation */
.mobile-search-bar {
    transition: transform 0.3s ease-in-out;
}

.mobile-search-bar.search-hidden {
    transform: translateY(-100%);
}

/* Touch feedback */
.touch-device .touch-active {
    background-color: rgba(0,0,0,0.05) !important;
    transform: scale(0.98);
}

/* Mobile cart popup */
.mobile-cart-popup {
    position: fixed !important;
    top: 80px !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 10000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3) !important;
}

/* Fix for form elements on mobile */
@media (max-width: 575.98px) {
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    select.form-control {
        font-size: 16px;
    }
}

/* Center align all table data - Global Rule */
table td {
    text-align: center !important;
}

/* Mobile specific table data centering */
@media (max-width: 991.98px) {
    table td {
        text-align: center !important;
        padding: 8px 4px !important;
        font-size: 12px !important;
    }
    
    /* Keep buttons and forms properly aligned on mobile */
    table td .btn,
    table td .badge,
    table td .dropdown,
    table td form,
    table td .action-btns {
        text-align: center;
        display: block;
        margin: 2px auto;
        width: auto;
    }
}
