/* Clean Mobile Styles - Simple and Effective */

/* Override existing navbar styles for mobile */
@media (max-width: 767px) {
    /* Force override any existing navbar styles */
    .navbar-expand-lg .navbar-nav {
        flex-direction: column !important;
    }
    
    .navbar-expand-lg .navbar-collapse {
        display: none !important;
    }
    
    /* Ensure our mobile menu takes precedence */
    .navbar-nav-container {
        position: fixed !important;
        top: 0 !important;
        right: -300px !important;
        transform: none !important;
    }
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 1rem;
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 1030;
        background: white !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    /* Add padding to body to account for fixed navbar */
    body {
        padding-top: 60px !important;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar-brand img {
        height: 30px;
    }
    
    /* Hamburger Menu Button */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 30px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001;
    }
    
    .hamburger-line {
        width: 25px;
        height: 3px;
        background-color: #28a745;
        border-radius: 2px;
        transition: all 0.3s ease;
        transform-origin: center;
    }
    
    /* Hamburger Animation */
    .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* Mobile Menu Overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Hide navigation by default on mobile */
    .navbar-nav-container {
        display: none !important;
    }
    
    /* Mobile Navigation Menu - Slide out panel */
    .navbar-nav-container {
        position: fixed !important;
        top: 0;
        right: -300px;
        width: 280px;
        height: 100vh;
        background: white;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        transition: right 0.3s ease;
        padding: 80px 0 20px 0;
        overflow-y: auto;
        display: block !important;
    }
    
    .navbar-nav-container.active {
        right: 0;
    }
    
    .navbar-nav {
        flex-direction: column !important;
        padding: 0 20px;
        gap: 0;
    }
    
    .navbar-nav .nav-link {
        padding: 15px 20px !important;
        font-size: 1rem;
        border-radius: 8px;
        margin: 5px 0;
        text-align: left;
        border-bottom: 1px solid #f0f0f0;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
    }
    
    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link.active {
        background: #28a745;
        color: white !important;
        transform: translateX(5px);
    }
    
    /* Hide mobile menu on desktop */
    .mobile-menu-toggle {
        display: none;
    }
}

/* Show hamburger only on mobile */
@media (max-width: 767px) {
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    /* Force hide navigation on mobile unless active */
    .navbar-nav-container:not(.active) {
        display: none !important;
    }
    
    .navbar-nav-container.active {
        display: block !important;
        right: 0 !important;
    }
}

/* Desktop - Always show navigation */
@media (min-width: 768px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .navbar-nav-container {
        display: flex !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        right: auto !important;
    }
    
    .navbar-nav {
        flex-direction: row !important;
    }
    
    .mobile-menu-overlay {
        display: none !important;
    }
}

/* Mobile Hero Section */
@media (max-width: 768px) {
    .hero-section {
        min-height: 50vh;
        padding: 2rem 0;
        text-align: center;
    }
    
    .hero-section .container {
        padding: 0 1rem;
    }
    
    .hero-section .row {
        flex-direction: column;
    }
    
    .hero-section .col-lg-6 {
        margin-bottom: 1.5rem;
    }
    
    .display-4 {
        font-size: 1.8rem !important;
        line-height: 1.3;
        margin-bottom: 1rem !important;
    }
    
    .lead {
        font-size: 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .btn-lg {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        margin: 0.25rem;
        display: block;
        width: 100%;
        max-width: 250px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Mobile Hero Slider - Vertical Animation */
@media (max-width: 768px) {
    .hero-product-slider {
        height: 220px !important;
        margin-top: 1rem;
        overflow: hidden !important;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        position: relative;
    }
    
    .slider-container {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    .slider-track {
        animation: slideUpInfinite 25s linear infinite !important;
        position: absolute !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .slider-product-card {
        margin: 10px auto !important;
        padding: 15px !important;
        width: calc(100% - 40px) !important;
        max-width: 90% !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
        display: flex !important;
        align-items: center !important;
        min-height: 100px !important;
        flex-shrink: 0 !important;
        white-space: normal !important;
    }
    
    .slider-product-image-container {
        flex-shrink: 0 !important;
        margin-right: 15px !important;
    }
    
    .slider-product-image {
        width: 70px !important;
        height: 70px !important;
        border-radius: 10px !important;
        flex-shrink: 0 !important;
        object-fit: cover !important;
    }
    
    .slider-product-content {
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    .slider-product-name {
        font-size: 0.95rem !important;
        font-weight: 600 !important;
        margin-bottom: 6px !important;
        color: #333 !important;
        line-height: 1.3 !important;
    }
    
    .slider-product-description {
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
        color: #666 !important;
        margin-bottom: 8px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
    
    .slider-product-badge {
        font-size: 0.7rem !important;
        padding: 4px 8px !important;
        border-radius: 12px !important;
        background: #28a745 !important;
        color: white !important;
        font-weight: 500 !important;
        display: inline-block !important;
    }
}

/* Mobile Footer */
@media (max-width: 768px) {
    .professional-footer {
        padding: 2rem 0 !important;
        overflow-x: hidden !important;
    }
    
    .professional-footer .container {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
        max-width: 100% !important;
    }
    
    .professional-footer .row {
        flex-direction: column;
        text-align: center;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .professional-footer .col-lg-4,
    .professional-footer .col-lg-2,
    .professional-footer .col-lg-3 {
        margin-bottom: 1.5rem !important;
        padding: 1.25rem !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* Remove inline background styles on mobile for better spacing */
    .professional-footer [style*="background"] {
        background: rgba(0,0,0,0.2) !important;
        padding: 1.25rem !important;
        border-radius: 8px !important;
        margin: 0 !important;
    }
    
    /* Fix for first column - Company Information */
    .footer-brand {
        width: 100% !important;
        overflow: hidden !important;
    }
    
    .footer-brand .d-flex {
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
    
    .footer-brand img {
        max-width: 45px !important;
        height: auto !important;
    }
    
    .footer-description {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
        text-align: center !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    .footer-social {
        width: 100% !important;
        text-align: center !important;
    }
    
    .footer-title {
        font-size: 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .social-links {
        justify-content: center !important;
        flex-wrap: wrap !important;
    }
    
    .social-btn {
        margin: 0.25rem !important;
    }
    
    .footer-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .footer-nav li {
        margin: 0;
    }
    
    .contact-info {
        text-align: center;
        width: 100% !important;
    }
    
    .contact-item {
        justify-content: center;
        margin-bottom: 1rem !important;
        display: flex !important;
        align-items: flex-start !important;
        text-align: left !important;
        max-width: 100% !important;
        word-wrap: break-word !important;
    }
    
    .contact-item i {
        flex-shrink: 0 !important;
        margin-top: 3px !important;
    }
    
    .contact-item div {
        flex: 1 !important;
        min-width: 0 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* Footer bottom section */
    .footer-bottom {
        padding: 1rem 0 !important;
    }
    
    .footer-bottom .container {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
    
    .footer-bottom .row {
        flex-direction: column !important;
        gap: 1rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .footer-bottom .col-md-6 {
        text-align: center !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .footer-legal {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .footer-legal-link {
        margin: 0 !important;
        padding: 0.5rem !important;
        display: inline-block !important;
    }
}

/* Mobile Forms */
@media (max-width: 768px) {
    .form-control {
        padding: 0.75rem;
        font-size: 1rem;
        border-radius: 8px;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        border-radius: 8px;
        min-height: 44px;
    }
    
    .card {
        margin-bottom: 1.5rem;
        border-radius: 12px;
    }
    
    .card-body {
        padding: 1.5rem;
    }
}

/* Mobile Product Cards */
@media (max-width: 768px) {
    .product-card {
        margin-bottom: 1.5rem;
    }
    
    .product-card .card-img-top {
        height: 200px;
    }
    
    .category-btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
        margin: 0.25rem;
        min-width: 120px;
    }
}

/* Mobile Typography */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

/* Very Small Screens */
@media (max-width: 480px) {
    .navbar-nav {
        flex-direction: column !important;
    }
    
    .navbar-nav .nav-link {
        width: 100%;
        margin: 0.1rem 0;
    }
    
    .hero-section {
        min-height: 40vh;
        padding: 1.5rem 0;
    }
    
    .display-4 {
        font-size: 1.5rem !important;
    }
    
    .hero-product-slider {
        height: 200px !important;
        margin-top: 1rem;
    }
    
    .slider-product-card {
        width: calc(100% - 30px) !important;
        max-width: 95% !important;
        padding: 12px !important;
        min-height: 90px !important;
        margin: 8px auto !important;
    }
    
    .slider-product-image {
        width: 60px !important;
        height: 60px !important;
        margin-right: 12px !important;
    }
    
    .slider-product-name {
        font-size: 0.85rem !important;
    }
    
    .slider-product-description {
        font-size: 0.75rem !important;
        -webkit-line-clamp: 2 !important;
    }
    
    .slider-product-badge {
        font-size: 0.65rem !important;
        padding: 3px 6px !important;
    }
}

/* Tablet Portrait - Medium screens */
@media (min-width: 481px) and (max-width: 768px) {
    .hero-product-slider {
        height: 240px !important;
    }
    
    .slider-product-card {
        min-width: 280px !important;
        max-width: 320px !important;
        height: 160px !important;
        padding: 1.25rem !important;
    }
    
    .slider-product-image {
        width: 60px !important;
        height: 60px !important;
    }
    
    .slider-product-name {
        font-size: 1rem !important;
    }
    
    .slider-product-description {
        font-size: 0.8rem !important;
    }
}

/* Mobile slider uses vertical animation (same as desktop) */
@media (max-width: 768px) {
    .hero-product-slider .slider-track {
        animation: slideUpInfinite 25s linear infinite !important;
        position: absolute !important;
        width: 100% !important;
    }
    
    .hero-product-slider .slider-product-card {
        display: flex !important;
        width: calc(100% - 30px) !important;
        margin: 10px 15px !important;
    }
}
/* ====
====================================
   FIX: Card Header Background on Mobile
   ======================================== */

@media (max-width: 768px) {
    .card-header.bg-success {
        background-color: #28a745 !important;
        color: white !important;
    }
    
    .card-header.bg-success * {
        color: white !important;
    }
}

/* ======================================== */

/* ========================================
   FIX: Scroll-to-Top Button Animation Speed on Mobile
   ======================================== */

@media (max-width: 768px) {
    .scroll-to-top,
    #scrollToTop,
    button[aria-label*="Scroll to top"],
    .back-to-top {
        transition: all 0.5s ease-in-out !important;
        animation-duration: 0.5s !important;
    }
    
    /* Smooth fade in/out */
    .scroll-to-top.visible,
    #scrollToTop.visible {
        animation: fadeInUp 0.5s ease-in-out !important;
    }
    
    .scroll-to-top:not(.visible),
    #scrollToTop:not(.visible) {
        animation: fadeOutDown 0.5s ease-in-out !important;
    }
    
    /* Smooth hover effect on mobile */
    .scroll-to-top:active,
    #scrollToTop:active {
        transform: scale(0.95) !important;
        transition: transform 0.2s ease !important;
    }
}

/* Keyframes for smooth animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* ======================================== */
