/* Mobile Responsive CSS for NUR'S FUSION */

/* Base Mobile-First Styles */
* {
    box-sizing: border-box;
}

/* Prevent horizontal scrolling */
html, body {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Touch-friendly button sizes */
button, 
.btn,
input[type="button"],
input[type="submit"],
input[type="reset"],
a.btn {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 16px;
    touch-action: manipulation;
}

/* Mobile-optimized form inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
textarea,
select {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    width: 100%;
    touch-action: manipulation;
}

/* Mobile navigation improvements */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.mobile-nav.active {
    display: block;
}

.mobile-nav-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: white;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav.active .mobile-nav-content {
    transform: translateX(0);
}

/* Product card improvements for mobile */
.product-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:active {
    transform: scale(0.98);
}

/* Mobile-optimized images */
.product-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 1;
}

/* Touch-friendly cart sidebar */
.cart-sidebar {
    width: 100%;
    max-width: 400px;
}

@media (max-width: 640px) {
    .cart-sidebar {
        width: 100%;
    }
}

/* Mobile-optimized tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 600px;
}

/* Mobile grid improvements */
.mobile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    padding: 16px;
}

/* Mobile-optimized modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile-optimized buttons */
.btn-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-mobile:active {
    transform: scale(0.98);
}

/* Mobile-optimized dropdowns */
.dropdown-mobile {
    position: relative;
}

.dropdown-mobile-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile-optimized search */
.search-mobile {
    position: relative;
    width: 100%;
}

.search-mobile input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
}

.search-mobile-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}

/* Mobile-optimized pagination */
.pagination-mobile {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 24px 0;
}

.pagination-mobile button {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    touch-action: manipulation;
}

/* Mobile-optimized filters */
.filter-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 16px;
    z-index: 100;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.filter-mobile.active {
    transform: translateY(0);
}

/* Mobile-optimized checkout */
.checkout-mobile {
    padding: 16px;
}

.checkout-mobile .form-group {
    margin-bottom: 20px;
}

.checkout-mobile label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

.checkout-mobile input,
.checkout-mobile select,
.checkout-mobile textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
}

/* Mobile-optimized product details */
.product-details-mobile {
    padding: 16px;
}

.product-details-mobile .product-images {
    margin-bottom: 24px;
}

.product-details-mobile .product-info {
    margin-bottom: 24px;
}

.product-details-mobile .product-actions {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 16px;
    margin: 0 -16px -16px -16px;
}

/* Mobile-optimized admin panel */
.admin-mobile {
    padding: 16px;
}

.admin-mobile .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.admin-mobile .stats-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

/* Mobile-optimized notifications */
.notification-mobile {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.notification-mobile.show {
    transform: translateY(0);
}

/* Mobile-optimized loading states */
.loading-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.loading-mobile .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile-optimized error states */
.error-mobile {
    text-align: center;
    padding: 32px 16px;
}

.error-mobile .error-icon {
    font-size: 48px;
    color: #ef4444;
    margin-bottom: 16px;
}

.error-mobile .error-message {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 24px;
}

/* Mobile-optimized success states */
.success-mobile {
    text-align: center;
    padding: 32px 16px;
}

.success-mobile .success-icon {
    font-size: 48px;
    color: #10b981;
    margin-bottom: 16px;
}

.success-mobile .success-message {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 24px;
}

/* Mobile-optimized empty states */
.empty-mobile {
    text-align: center;
    padding: 32px 16px;
}

.empty-mobile .empty-icon {
    font-size: 48px;
    color: #9ca3af;
    margin-bottom: 16px;
}

.empty-mobile .empty-message {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 24px;
}

/* Mobile-optimized tooltips */
.tooltip-mobile {
    position: relative;
    display: inline-block;
}

.tooltip-mobile .tooltip-text {
    visibility: hidden;
    background-color: #1f2937;
    color: white;
    text-align: center;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.tooltip-mobile:hover .tooltip-text {
    visibility: visible;
}

/* Mobile-optimized badges */
.badge-mobile {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-mobile.primary {
    background-color: #3b82f6;
    color: white;
}

.badge-mobile.success {
    background-color: #10b981;
    color: white;
}

.badge-mobile.warning {
    background-color: #f59e0b;
    color: white;
}

.badge-mobile.danger {
    background-color: #ef4444;
    color: white;
}

/* Mobile-optimized progress bars */
.progress-mobile {
    width: 100%;
    height: 8px;
    background-color: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
}

.progress-mobile .progress-bar {
    height: 100%;
    background-color: #3b82f6;
    transition: width 0.3s ease;
}

/* Mobile-optimized tabs */
.tabs-mobile {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-mobile {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    text-align: center;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    touch-action: manipulation;
    white-space: nowrap;
}

.tab-mobile.active {
    border-bottom-color: #3b82f6;
    color: #3b82f6;
}

/* Mobile-optimized accordion */
.accordion-mobile {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.accordion-item-mobile {
    border-bottom: 1px solid #e5e7eb;
}

.accordion-item-mobile:last-child {
    border-bottom: none;
}

.accordion-header-mobile {
    padding: 16px;
    background: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    touch-action: manipulation;
}

.accordion-content-mobile {
    padding: 0 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content-mobile.active {
    padding: 16px;
    max-height: 500px;
}

/* Mobile-optimized carousel */
.carousel-mobile {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.carousel-mobile .carousel-track {
    display: flex;
    transition: transform 0.3s ease;
}

.carousel-mobile .carousel-slide {
    flex: 0 0 100%;
    min-width: 100%;
}

.carousel-mobile .carousel-nav {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.carousel-mobile .carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    touch-action: manipulation;
}

.carousel-mobile .carousel-dot.active {
    background: white;
}

/* Mobile-optimized breadcrumbs */
.breadcrumbs-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    font-size: 14px;
    color: #6b7280;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.breadcrumbs-mobile .breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumbs-mobile .breadcrumb-separator {
    margin: 0 8px;
    color: #d1d5db;
}

/* Mobile-optimized footer */
.footer-mobile {
    background: #1f2937;
    color: white;
    padding: 32px 16px;
}

.footer-mobile .footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.footer-mobile .footer-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-mobile .footer-section p,
.footer-mobile .footer-section a {
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 8px;
    display: block;
}

.footer-mobile .footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 16px;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
}

/* Mobile-optimized print styles */
@media print {
    .mobile-nav,
    .cart-sidebar,
    .modal,
    .filter-mobile,
    .notification-mobile {
        display: none !important;
    }
    
    body {
        font-size: 12px;
        line-height: 1.4;
    }
    
    .product-card {
        break-inside: avoid;
        margin-bottom: 16px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-mobile,
    .product-card,
    .modal-content {
        border: 2px solid currentColor;
    }
    
    .badge-mobile {
        border: 1px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .modal-content,
    .dropdown-mobile-content,
    .filter-mobile,
    .notification-mobile {
        background: #1f2937;
        color: white;
        border-color: #374151;
    }
    
    .product-card,
    .admin-mobile .stats-card {
        background: #1f2937;
        border-color: #374151;
        color: white;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        background: #1f2937;
        border-color: #374151;
        color: white;
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .modal-content {
        max-height: 80vh;
    }
    
    .mobile-nav-content {
        width: 320px;
    }
    
    .cart-sidebar {
        max-width: 450px;
    }
}

/* Ultra-wide screen support */
@media (min-width: 1920px) {
    .container {
        max-width: 1400px;
    }
    
    .mobile-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #3b82f6;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1001;
}

.skip-link:focus {
    top: 6px;
}

/* Mobile-optimized scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Mobile-optimized selection */
::selection {
    background: #3b82f6;
    color: white;
}

::-moz-selection {
    background: #3b82f6;
    color: white;
} 