/* ===== COMPREHENSIVE MOBILE RESPONSIVE STYLES ===== */
/* This file provides mobile responsive styles for the entire website */

/* Product Details Page - Mobile */
@media (max-width: 768px) {
    .breadcrumb {
        padding: 10px 15px;
        font-size: 12px;
        margin-bottom: 15px;
    }
    
    .product-detail-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
        margin-bottom: 15px;
    }
    
    .main-image {
        height: 300px;
    }
    
    .thumbnail-images {
        display: flex;
        overflow-x: auto;
        gap: 10px;
        scrollbar-width: thin;
    }
    
    .thumbnail {
        min-width: 60px;
        height: 60px;
    }
    
    .product-details h1 {
        font-size: 22px !important;
        margin-bottom: 12px;
    }
    
    .product-rating,
    .product-category,
    .product-warehouse {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .product-price-section {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
        margin: 15px 0;
    }
    
    .product-price {
        font-size: 28px !important;
    }
    
    .product-original-price {
        font-size: 18px;
    }
    
    .discount-badge {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .product-stock {
        font-size: 14px;
    }
    
    .product-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .quantity-selector {
        width: 100%;
        justify-content: space-between;
    }
    
    .quantity-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    #quantity {
        width: 60px;
        font-size: 16px;
    }
    
    .product-tabs {
        flex-direction: column;
        border-bottom: none;
    }
    
    .tab-button {
        width: 100%;
        text-align: left;
        padding: 12px 15px;
        border-bottom: 1px solid #ddd;
        border-radius: 0;
    }
    
    .tab-button.active {
        border-bottom: 2px solid var(--color-primary);
    }
    
    .tab-content {
        padding: 15px;
    }
    
    .review-item {
        padding: 15px;
        margin-bottom: 12px;
    }
    
    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .related-products {
        padding: 20px;
    }
    
    .related-products h2 {
        font-size: 20px !important;
    }
}

/* Profile Page - Mobile */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 25px 20px;
    }
    
    .profile-avatar i {
        font-size: 70px;
    }
    
    .profile-info h1 {
        font-size: 26px !important;
    }
    
    .user-email {
        font-size: 14px;
    }
    
    .user-type-badge {
        font-size: 12px;
        padding: 5px 12px;
    }
    
    .profile-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .profile-sidebar {
        order: -1;
    }
    
    .profile-menu {
        display: flex;
        overflow-x: auto;
        scrollbar-width: thin;
        flex-wrap: nowrap;
        border-radius: 8px;
    }
    
    .profile-menu-item {
        white-space: nowrap;
        padding: 12px 16px;
        font-size: 14px;
        border-radius: 6px;
        margin-bottom: 0;
    }
    
    .profile-content {
        padding: 20px;
    }
    
    .profile-section h2 {
        font-size: 20px !important;
        margin-bottom: 15px;
    }
    
    .form-grid {
        grid-template-columns: 1fr !important;
    }
    
    .order-card,
    .address-card {
        padding: 15px;
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .order-items {
        gap: 10px;
    }
    
    .order-item {
        flex-direction: column;
        text-align: center;
    }
    
    .order-item-image {
        margin: 0 auto;
    }
}

/* Warehouse Pages - Mobile */
@media (max-width: 768px) {
    .warehouse-header {
        padding: 20px;
        flex-direction: column;
        text-align: center;
    }
    
    .warehouse-header h1 {
        font-size: 24px !important;
    }
    
    .warehouse-info {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px;
    }
    
    .warehouse-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .warehouse-tabs {
        overflow-x: auto;
        scrollbar-width: thin;
        flex-wrap: nowrap;
    }
    
    .warehouse-tab {
        white-space: nowrap;
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }
}

/* Admin Pages - Mobile */
@media (max-width: 768px) {
    .admin-header {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .admin-header h1 {
        font-size: 24px !important;
        margin-bottom: 15px;
    }
    
    .admin-actions {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }
    
    .admin-actions .btn {
        width: 100%;
    }
    
    .admin-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s ease;
        background: white;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .admin-sidebar.open {
        left: 0;
    }
    
    .admin-mobile-toggle {
        display: block !important;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 999;
        background: var(--color-primary);
        color: white;
        border: none;
        padding: 10px 15px;
        border-radius: 6px;
        font-size: 18px;
        cursor: pointer;
    }
    
    .admin-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .data-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        min-width: 600px;
    }
    
    .filters-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 20px auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-footer {
        padding: 15px;
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* Forms - Mobile Enhancements */
@media (max-width: 768px) {
    .form-row,
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .form-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    input[type="date"],
    input[type="time"],
    textarea,
    select {
        font-size: 16px !important;
        padding: 12px !important;
        border-radius: 6px;
    }
    
    textarea {
        min-height: 120px !important;
    }
    
    .input-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .input-group-prepend,
    .input-group-append {
        width: 100%;
    }
}

/* Tables - Mobile Responsive */
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    table {
        min-width: 100%;
    }
    
    table.mobile-cards {
        display: block;
        overflow-x: visible;
    }
    
    table.mobile-cards thead {
        display: none;
    }
    
    table.mobile-cards tbody {
        display: block;
    }
    
    table.mobile-cards tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 15px;
        background: white;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    
    table.mobile-cards td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding: 10px 0;
        border: none;
        border-bottom: 1px solid #f0f0f0;
    }
    
    table.mobile-cards td:last-child {
        border-bottom: none;
    }
    
    table.mobile-cards td:before {
        content: attr(data-label);
        font-weight: 600;
        color: #666;
        flex-basis: 40%;
        flex-shrink: 0;
    }
    
    table.mobile-cards td:after {
        content: '';
        flex-basis: 60%;
    }
}

/* Navigation - Mobile */
@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        gap: 5px;
        justify-content: center;
    }
    
    .pagination .btn,
    .pagination a {
        min-width: 40px;
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .pagination .page-info {
        width: 100%;
        text-align: center;
        order: -1;
        margin-bottom: 10px;
    }
}

/* Search and Filters - Mobile */
@media (max-width: 768px) {
    .search-filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-bar-wrapper {
        width: 100%;
    }
    
    .filters-toggle {
        display: block !important;
        width: 100%;
        padding: 12px;
        background: var(--color-primary);
        color: white;
        border: none;
        border-radius: 6px;
        font-size: 16px;
        cursor: pointer;
    }
    
    .filters-panel {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: white;
        z-index: 9999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        padding: 20px;
    }
    
    .filters-panel.active {
        transform: translateX(0);
    }
    
    .filters-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 2px solid #ddd;
    }
    
    .filters-close {
        font-size: 24px;
        cursor: pointer;
        color: #666;
    }
}

/* Notifications & Alerts - Mobile */
@media (max-width: 768px) {
    .notification,
    .toast {
        width: calc(100% - 20px);
        left: 10px;
        right: 10px;
        margin: 0;
    }
    
    .notification-list {
        padding: 15px;
    }
    
    .notification-item {
        padding: 12px;
        font-size: 14px;
    }
}

/* Dashboard Cards - Mobile */
@media (max-width: 768px) {
    .dashboard-card {
        padding: 20px;
    }
    
    .dashboard-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .dashboard-card-title {
        font-size: 18px !important;
    }
    
    .dashboard-card-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .quick-stats {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    .chart-container {
        height: 250px !important;
    }
}

/* Loading States - Mobile */
@media (max-width: 768px) {
    .loader,
    .spinner {
        width: 40px;
        height: 40px;
    }
    
    .loading-overlay {
        backdrop-filter: blur(3px);
    }
    
    .skeleton-loader {
        border-radius: 6px;
    }
}

/* Tooltips & Popovers - Mobile */
@media (max-width: 768px) {
    .tooltip {
        font-size: 12px;
        padding: 6px 10px;
        max-width: 200px;
    }
    
    .popover {
        max-width: 90vw;
        font-size: 14px;
    }
}

/* Touch Improvements */
@media (max-width: 768px) {
    /* Increase touch target sizes */
    button,
    a.btn,
    input[type="button"],
    input[type="submit"],
    .clickable {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better tap highlights */
    * {
        -webkit-tap-highlight-color: rgba(255, 140, 0, 0.1);
    }
    
    /* Smooth scrolling */
    html {
        scroll-behavior: smooth;
    }
    
    /* Prevent text selection on interactive elements */
    button,
    .btn {
        user-select: none;
        -webkit-user-select: none;
    }
    
    /* Better active states */
    button:active,
    .btn:active,
    a:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }
}

/* Accessibility - Mobile */
@media (max-width: 768px) {
    :focus-visible {
        outline: 3px solid var(--color-primary);
        outline-offset: 2px;
    }
    
    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0,0,0,0);
        white-space: nowrap;
        border-width: 0;
    }
}

/* Print Styles */
@media print {
    .no-print,
    .mobile-sidebar,
    .mobile-bottom-nav,
    .header-actions,
    .btn,
    button {
        display: none !important;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

