/* Enhanced Mobile Navigation */
@media (max-width: 768px) {
    /* Mobile Menu - Full Screen Slide */
    .mobile-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
        z-index: 9999;
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        padding: 80px 25px 30px;
    }
    
    .mobile-menu.active {
        transform: translateX(0);
    }
    
    .mobile-menu::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="0.5"/></svg>');
        background-size: 30px 30px;
    }
    
    .mobile-menu > * {
        position: relative;
        z-index: 1;
    }
    
    .mobile-nav-links {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .mobile-nav-links li {
        margin-bottom: 8px;
    }
    
    .mobile-nav-links a {
        display: flex;
        align-items: center;
        padding: 18px 20px;
        color: rgba(255, 255, 255, 0.9);
        font-size: 1.25rem;
        font-weight: 500;
        text-decoration: none;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        transition: all 0.3s ease;
    }
    
    .mobile-nav-links a:hover,
    .mobile-nav-links a.active {
        background: rgba(255, 255, 255, 0.2);
        color: var(--white);
        transform: translateX(10px);
    }
    
    .mobile-nav-links a i {
        width: 30px;
        margin-right: 15px;
        font-size: 1.1rem;
    }
    
    /* Mobile Menu Close Button */
    .mobile-menu-close {
        position: absolute;
        top: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        border-radius: 50%;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-menu-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }
    
    /* Mobile Menu Header */
    .mobile-menu-header {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        padding: 20px 25px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: rgba(0, 0, 0, 0.1);
    }
    
    .mobile-menu-header .logo {
        color: white;
    }
    
    /* Search Bar - Mobile Enhanced */
    .search-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(26, 54, 93, 0.98);
        z-index: 10001;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 20px;
        animation: fadeIn 0.3s ease;
    }
    
    .search-overlay.active {
        display: flex;
    }
    
    .search-container {
        width: 100%;
        max-width: 600px;
        position: relative;
    }
    
    .search-input-large {
        width: 100%;
        padding: 20px 60px 20px 25px;
        font-size: 1.25rem;
        border: none;
        border-radius: 50px;
        background: white;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
        outline: none;
    }
    
    .search-input-large:focus {
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    }
    
    .search-close {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        background: var(--primary);
        border: none;
        width: 45px;
        height: 45px;
        border-radius: 50%;
        font-size: 1.25rem;
        color: white;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    }
    
    .search-close:hover {
        background: var(--primary-dark);
        transform: translateY(-50%) rotate(90deg);
    }
    
    /* Search Suggestions */
    .search-suggestions {
        background: white;
        border-radius: 15px;
        margin-top: 15px;
        overflow: hidden;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    }
    
    .search-suggestion-item {
        padding: 15px 20px;
        display: flex;
        align-items: center;
        gap: 15px;
        cursor: pointer;
        transition: background 0.2s;
    }
    
    .search-suggestion-item:hover {
        background: var(--gray-50);
    }
    
    .search-suggestion-item img {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        object-fit: cover;
    }
    
    .search-suggestion-item span {
        color: var(--gray-700);
    }
    
    /* Header - Mobile */
    .header {
        height: 65px;
    }
    
    .header-inner {
        padding: 0 15px;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .nav-actions {
        gap: 8px;
    }
    
    .nav-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    .mobile-menu-btn {
        display: flex !important;
        width: 38px;
        height: 38px;
        background: var(--gray-100);
        border: none;
        border-radius: 8px;
        cursor: pointer;
        padding: 8px;
    }
    
    .mobile-menu-btn span {
        display: block;
        width: 100%;
        height: 2px;
        background: var(--primary-dark);
        border-radius: 2px;
        margin: 3px 0;
    }
    
    /* Hero Section - Mobile */
    .hero {
        padding-top: 65px;
        min-height: auto;
    }
    
    .hero .hero-grid {
        display: flex;
        flex-direction: column-reverse;
    }
    
    .hero-image {
        display: block !important;
        margin-bottom: 30px;
    }
    
    .hero-image-main {
        max-width: 100%;
        height: auto;
        aspect-ratio: 4/3;
        margin: 0 auto;
    }
    
    .hero-content {
        padding: 40px 0;
    }
    
    .hero-text h1 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .hero-text p {
        font-size: 0.95rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
    }
    
    .hero-stat {
        flex: 1;
        min-width: 80px;
        padding: 15px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 12px;
    }
    
    .hero-stat-value {
        font-size: 1.5rem;
    }
    
    .hero-stat-label {
        font-size: 0.7rem;
    }
    
    /* Products Grid - Mobile */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .product-card {
        margin-bottom: 0;
    }
    
    .product-image {
        height: 140px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-category {
        font-size: 0.65rem;
    }
    
    .product-title {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    .price-amount {
        font-size: 1rem;
    }
    
    /* Page Header */
    [style*="padding: 150px"] {
        padding: 100px 0 50px !important;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Cart - Mobile */
    .cart-grid {
        grid-template-columns: 1fr;
    }
    
    .cart-header {
        display: none;
    }
    
    .cart-item {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 15px;
    }
    
    .cart-item-product {
        flex-direction: row;
        align-items: center;
    }
    
    .cart-item-image {
        width: 70px;
        height: 70px;
        flex-shrink: 0;
    }
    
    /* Checkout - Mobile */
    .checkout-grid {
        grid-template-columns: 1fr;
    }
    
    .payment-methods {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .payment-card {
        padding: 12px 8px;
    }
    
    .payment-card i {
        font-size: 1.5rem;
    }
    
    .payment-card span {
        font-size: 0.75rem;
    }
    
    /* Account - Mobile */
    .account-grid {
        grid-template-columns: 1fr;
    }
    
    .account-sidebar {
        position: static;
        margin-bottom: 20px;
    }
    
    /* Admin - Mobile */
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.active {
        transform: translateX(0);
    }
    
    .admin-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .admin-stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .stat-info .value {
        font-size: 1.5rem;
    }
    
    /* Data Table - Mobile */
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 5px;
    }
    
    .data-table .btn {
        padding: 5px 8px;
        font-size: 0.75rem;
    }
    
    /* Footer - Mobile */
    .footer {
        padding: 50px 0 25px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .footer-column h4 {
        font-size: 1rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    /* About Section - Mobile */
    .about-preview [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    
    .about-preview [style*="gap: 60px"] {
        gap: 30px !important;
    }
    
    /* Trust Badges */
    .trust-badges {
        gap: 20px;
    }
    
    .trust-badge {
        flex: 1;
        min-width: 120px;
    }
    
    /* CTA Section */
    .cta h2 {
        font-size: 1.5rem;
    }
    
    /* Features */
    .features {
        padding: 50px 0;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .feature-card {
        padding: 20px;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    /* Product Detail */
    .product-detail {
        padding: 80px 0 40px;
    }
    
    .product-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .main-image {
        height: 250px;
    }
    
    .thumbnails {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .thumbnail {
        height: 60px;
    }
    
    .product-detail-info h1 {
        font-size: 1.5rem;
    }
    
    .product-detail-price {
        font-size: 1.75rem;
    }
    
    .detail-actions {
        flex-direction: column;
    }
    
    /* Contact Page */
    [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Auth Pages */
    .auth-container {
        margin: 20px;
        padding: 0;
    }
    
    .auth-header {
        padding: 30px 20px 20px;
    }
    
    .auth-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .product-image {
        height: 120px;
    }
    
    .payment-methods {
        grid-template-columns: 1fr;
    }
    
    .hero-stats {
        flex-direction: column;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    /* Extra small screens */
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .header {
        height: 60px;
    }
    
    .logo {
        font-size: 1rem;
    }
    
    .nav-btn {
        width: 35px;
        height: 35px;
    }
    
    .cart-badge {
        font-size: 0.75rem !important;
        min-width: 22px !important;
        height: 22px !important;
        padding: 0 5px !important;
        line-height: 22px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 9999 !important;
        overflow: visible !important;
        box-sizing: border-box !important;
    }
    
    .nav-btn {
        position: relative;
        overflow: visible !important;
    }
    
    .hero {
        padding-top: 60px;
    }
    
    .hero-text h1 {
        font-size: 1.35rem;
    }
    
    .hero-buttons {
        gap: 10px;
    }
    
    .product-detail-price {
        font-size: 1.5rem;
    }
    
    .checkout-summary {
        padding: 15px;
    }
    
    .auth-container {
        margin: 10px;
    }
    
    .footer-grid {
        gap: 20px;
    }
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Global Mobile Fixes - Prevent Horizontal Overflow */
@media (max-width: 768px) {
    * {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    html, body {
        overflow-x: hidden;
        position: relative;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
        max-width: 100vw;
    }
    
    /* Ensure all sections fit properly */
    section, .section {
        overflow-x: hidden;
    }
    
    /* Fix for any inline styles that might cause overflow */
    [style*="max-width"] {
        max-width: 100% !important;
    }
    
    /* Ensure buttons don't overflow */
    .btn {
        white-space: normal;
        word-wrap: break-word;
    }
    
    /* Cart item details */
    .cart-item-details {
        min-width: 0;
    }
    
    /* Product info */
    .product-info {
        overflow: hidden;
    }
    
    /* Smooth scrolling on mobile */
    html {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Touch-friendly inputs */
    input, select, textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Better tap targets */
    a, button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Ensure badges don't overflow */
    .badge, .product-badge {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Table scroll container */
    .table-container, 
    .admin-table-container,
    .data-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-left: -15px;
        margin-right: -15px;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Notification positioning */
    .notification {
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    /* Page padding fixes */
    .page-header {
        padding: 100px 0 40px !important;
    }
    
    /* Mobile-friendly tables */
    table {
        display: block;
        overflow-x: auto;
    }
    
    /* Form improvements */
    .form-group {
        margin-bottom: 15px;
    }
    
    /* Card improvements */
    .card {
        overflow: hidden;
    }
    
    /* Image handling */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Modal on mobile */
    .modal {
        width: 95%;
        margin: 10px;
        padding: 15px;
    }
    
    /* Breadcrumb on mobile */
    .breadcrumb {
        flex-wrap: wrap;
        font-size: 0.85rem;
    }
    
    /* Cart quantity on mobile */
    .quantity-control {
        gap: 5px;
    }
    
    .quantity-btn {
        width: 32px;
        height: 32px;
    }
    
    /* Product Gallery - Mobile */
    .product-gallery {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .product-main-image {
        width: 100%;
        height: 250px;
    }
    
    .product-thumbnails {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 5px;
    }
    
    .product-thumbnail {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
    }
    
    /* Review Section - Mobile */
    .reviews-section {
        padding: 30px 0;
    }
    
    .review-card {
        padding: 15px;
    }
    
    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    /* Order Confirmation - Mobile */
    .order-confirmation {
        padding: 20px;
    }
    
    .order-details {
        padding: 15px;
    }
    
    .order-item {
        flex-direction: column;
        gap: 10px;
    }
    
    /* Contact Form - Mobile */
    .contact-form {
        padding: 20px;
    }
    
    .contact-info {
        padding: 20px;
    }
    
    /* Filter Sidebar - Mobile */
    .products-page-layout {
        flex-direction: column;
    }
    
    .filter-sidebar {
        position: static;
        width: 100%;
        margin-bottom: 20px;
    }
    
    /* Quick View Modal */
    .quick-view-modal {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }
}
