/* Quaming E-commerce Website Styles */

/* ====== GLOBAL STYLES ====== */
:root {
    /* Color Palette */
    --primary-color: #0066cc;
    --primary-dark: #0052a3;
    --primary-light: #3385ff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;

    /* E-commerce Colors */
    --price-color: #e74c3c;
    --discount-color: #ff6b6b;
    --stock-in-color: #27ae60;
    --stock-out-color: #e74c3c;
    --rating-color: #f39c12;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;

    /* Border Radius */
    --border-radius-sm: 0.25rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 0.2s;
    --transition-normal: 0.3s;
    --transition-slow: 0.5s;
}

/* Base Styles */
body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica,
        Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f8f9fa;
}

/* ====== HEADER & NAVIGATION ====== */
.top-bar {
    font-size: 0.875rem;
    background-color: var(--dark-color) !important;
}

.main-header {
    background-color: white;
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.category-nav {
    background-color: var(--primary-color);
    padding: 0.5rem 0;
}

.category-nav .nav-link {
    font-weight: 500;
    transition: all var(--transition-fast);
}

.category-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.search-form .form-control {
    border-radius: var(--border-radius-lg) 0 0 var(--border-radius-lg);
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
}

.search-form .btn {
    border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0;
    padding: 0.75rem 1.5rem;
}

.cart-icon {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.75rem;
    min-width: 18px;
    padding: 2px 4px;
}

/* ====== PRODUCT STYLES ====== */
.product-card {
    transition: all var(--transition-normal);
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.product-image-container {
    position: relative;
    overflow: hidden;
    background-color: var(--light-color);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    transition: transform var(--transition-normal);
    background-color: #f8fafc;
    padding: 8px;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
}

.product-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.25rem;
    display: block;
}

.product-quick-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.product-card:hover .product-quick-actions {
    opacity: 1;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-description {
    font-size: 0.875rem;
    color: var(--secondary-color);
    line-height: 1.5;
    height: 9em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--price-color);
}

.product-price .text-decoration-line-through {
    font-size: 1rem;
    font-weight: 400;
    color: var(--secondary-color);
}

.stock-status {
    font-size: 0.875rem;
}

/* ====== BUTTONS ====== */
.btn.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.btn.btn-primary:hover {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn.btn-outline-primary {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    font-weight: 500;
}

.btn.btn-outline-primary:hover {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.btn.btn-success {
    background-color: var(--success-color) !important;
    border-color: var(--success-color) !important;
    color: white !important;
}

.btn.btn-danger {
    background-color: var(--danger-color) !important;
    border-color: var(--danger-color) !important;
    color: white !important;
}

.btn.btn-warning {
    background-color: var(--warning-color) !important;
    border-color: var(--warning-color) !important;
    color: var(--dark-color) !important;
}

/* ====== CARDS ====== */
.card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: var(--light-color);
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}

/* ====== FORMS ====== */
.form-control {
    border-radius: var(--border-radius-md);
    border: 1px solid #ced4da;
    padding: 0.75rem 1rem;
    transition: all var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

.form-select {
    border-radius: var(--border-radius-md);
    border: 1px solid #ced4da;
    padding: 0.75rem 2.25rem 0.75rem 1rem;
}

/* ====== BREADCRUMBS ====== */
.breadcrumb {
    background-color: transparent;
    padding: 0.75rem 0;
    margin-bottom: 0;
}

.breadcrumb-item {
    color: var(--dark-color);
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb-item a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--secondary-color);
    font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: var(--secondary-color);
}

/* ====== PAGINATION ====== */
.pagination {
    margin-bottom: 0;
}

.page-link {
    border-radius: var(--border-radius-md);
    margin: 0 0.125rem;
    border: 1px solid #dee2e6;
    color: var(--primary-color);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.page-link:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ====== FOOTER ====== */
footer {
    background-color: var(--dark-color);
    color: white;
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color var(--transition-fast);
}

footer a:hover {
    color: white;
}

.widget-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: white;
}

.footer-links li a {
    display: block;
    padding: 0.25rem 0;
    transition: all var(--transition-fast);
}

.footer-links li a:hover {
    color: var(--warning-color);
    transform: translateX(5px);
}

.social-links a {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all var(--transition-fast);
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

/* ====== UTILITY CLASSES ====== */
.hover-bg-light:hover {
    background-color: var(--light-color);
}

.text-decoration-none {
    text-decoration: none;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-info {
    color: var(--info-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-success {
    background-color: var(--success-color) !important;
}

.bg-danger {
    background-color: var(--danger-color) !important;
}

.bg-warning {
    background-color: var(--warning-color) !important;
}

.bg-info {
    background-color: var(--info-color) !important;
}

/* ====== MOBILE-FIRST RESPONSIVE DESIGN ====== */

/* Mobile Base Styles (All devices) */
body {
    font-size: 16px;
    line-height: 1.6;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Responsive Typography Scale */
.responsive-text-xs {
    font-size: 0.75rem;
}
.responsive-text-sm {
    font-size: 0.875rem;
}
.responsive-text-base {
    font-size: 1rem;
}
.responsive-text-lg {
    font-size: 1.125rem;
}
.responsive-text-xl {
    font-size: 1.25rem;
}
.responsive-text-2xl {
    font-size: 1.5rem;
}
.responsive-text-3xl {
    font-size: 1.875rem;
}
.responsive-text-4xl {
    font-size: 2.25rem;
}

/* Responsive Spacing */
.responsive-space-xs {
    padding: 0.25rem;
}
.responsive-space-sm {
    padding: 0.5rem;
}
.responsive-space-md {
    padding: 1rem;
}
.responsive-space-lg {
    padding: 1.5rem;
}
.responsive-space-xl {
    padding: 2rem;
}
.responsive-space-2xl {
    padding: 3rem;
}

/* Responsive Grid */
.responsive-grid {
    display: grid;
    gap: 1rem;
}
.responsive-grid-1 {
    grid-template-columns: 1fr;
}
.responsive-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}
.responsive-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}
.responsive-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Responsive Flexbox */
.responsive-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}
.responsive-flex-col {
    flex-direction: column;
}
.responsive-flex-center {
    justify-content: center;
    align-items: center;
}
.responsive-flex-between {
    justify-content: space-between;
    align-items: center;
}
.responsive-flex-around {
    justify-content: space-around;
    align-items: center;
}

/* Touch-Optimized Interactive Elements */
.touch-target {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.touch-button {
    padding: 12px 24px;
    min-height: 44px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.touch-button:active {
    transform: scale(0.95);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.touch-input {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 16px; /* Prevents zoom on iOS */
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
}

.touch-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Responsive Navigation */
.nav-mobile {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 9999;
    overflow-y: auto;
}

.nav-mobile.active {
    left: 0;
}

.nav-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9998;
}

.nav-mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.nav-mobile-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-mobile-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-color);
}

/* Mobile Search */
.mobile-search-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: white;
    z-index: 10000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

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

.mobile-search-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
}

.mobile-search-suggestions {
    padding: 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

/* Mobile Filters */
.mobile-filters-container {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 9999;
    overflow-y: auto;
}

.mobile-filters-container.active {
    right: 0;
}

.mobile-filters-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-filters-content {
    padding: 1rem;
}

/* Responsive Product Cards */
.product-card {
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-image-container {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    border-radius: 8px;
    aspect-ratio: 1;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-quick-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-quick-actions {
    opacity: 1;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    color: var(--dark-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--price-color);
    margin-top: auto;
}

.product-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

/* Responsive Pagination */
.pagination-mobile {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination-mobile .page-link {
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background: white;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination-mobile .page-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-mobile .page-item.active .page-link {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-mobile .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Gallery */
.swipe-gallery {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #f8f9fa;
}

.swipe-gallery-container {
    display: flex;
    transition: transform 0.3s ease;
}

.swipe-gallery-item {
    min-width: 100%;
    aspect-ratio: 1;
    position: relative;
}

.swipe-gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.swipe-gallery-indicators {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
}

.swipe-gallery-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: background 0.3s ease;
    cursor: pointer;
}

.swipe-gallery-indicator.active {
    background: white;
}

.swipe-gallery-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    pointer-events: none;
}

.swipe-gallery-control {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.swipe-gallery-control:hover {
    background: white;
    transform: scale(1.1);
}

/* Responsive Cart */
.mobile-cart-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 9999;
    max-height: 80vh;
    overflow-y: auto;
}

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

.mobile-cart-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.mobile-cart-handle {
    width: 40px;
    height: 4px;
    background: #dee2e6;
    border-radius: 2px;
    position: absolute;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
}

.mobile-cart-content {
    padding: 1rem;
}

.mobile-cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.mobile-cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mobile-cart-item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.mobile-cart-item-price {
    color: var(--price-color);
    font-weight: 700;
}

.mobile-cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.mobile-quantity-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.mobile-quantity-btn:hover {
    background: #e9ecef;
}

.mobile-quantity-input {
    width: 40px;
    height: 32px;
    border: none;
    text-align: center;
    font-size: 0.875rem;
}

/* Responsive Forms */
.form-group-mobile {
    margin-bottom: 1.5rem;
}

.form-label-mobile {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.form-control-mobile {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
}

.form-control-mobile:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-control-mobile.is-invalid {
    border-color: var(--danger-color);
}

.invalid-feedback-mobile {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Responsive Table */
.table-mobile {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.table-mobile th,
.table-mobile td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.table-mobile th {
    font-weight: 600;
    background: #f8f9fa;
}

.table-mobile tr:hover {
    background: #f8f9fa;
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-image {
    aspect-ratio: 1;
    border-radius: 8px;
}

/* Breakpoint-specific responsive adjustments */

/* Hide header cart on mobile devices */
@media (max-width: 767.98px) {
    .header-cart {
        display: none !important;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .responsive-grid-sm-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    .responsive-grid-sm-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .container-sm {
        max-width: 540px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .top-bar {
        display: block;
    }

    .nav-mobile {
        width: 320px;
    }

    .mobile-filters-container {
        width: 380px;
    }

    .responsive-grid-md-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    .responsive-grid-md-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    .responsive-grid-md-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .container-md {
        max-width: 720px;
    }

    .product-image {
        height: 200px;
    }

    /* Show header cart on desktop/tablet */
    .header-cart {
        display: block !important;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .category-nav .nav-pills {
        flex-wrap: nowrap;
    }

    .responsive-grid-lg-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    .responsive-grid-lg-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    .responsive-grid-lg-5 {
        grid-template-columns: repeat(5, 1fr);
    }

    .container-lg {
        max-width: 960px;
    }

    .nav-mobile,
    .mobile-search-container,
    .mobile-filters-container,
    .mobile-cart-container {
        display: none;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .responsive-grid-xl-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    .responsive-grid-xl-5 {
        grid-template-columns: repeat(5, 1fr);
    }
    .responsive-grid-xl-6 {
        grid-template-columns: repeat(6, 1fr);
    }

    .container-xl {
        max-width: 1140px;
    }

    .product-image {
        height: 220px;
    }
}

/* XXL devices (larger desktops, 1400px and up) */
@media (min-width: 1400px) {
    .container-xxl {
        max-width: 1320px;
    }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 500px) {
    .nav-mobile {
        height: 100vh;
    }

    .mobile-filters-container {
        height: 100vh;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #004499;
        --primary-dark: #003366;
        --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    }
}

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

/* Print optimization */
@media print {
    .no-print {
        display: none !important;
    }

    .print-break {
        page-break-before: always;
    }

    .print-avoid-break {
        page-break-inside: avoid;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }

    .product-card {
        break-inside: avoid;
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* ====== ANIMATIONS ====== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

/* ====== LOADER ====== */
.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* ====== SCROLLBAR ====== */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ====== CATEGORY MENU ====== */
.category-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.category-item {
    border-bottom: 1px solid #e9ecef;
}

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

.category-item > a {
    transition: background-color var(--transition-fast);
}

.category-item:hover > a {
    background-color: var(--light-color);
}

.subcategories {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    width: 250px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
}

.category-item:hover .subcategories {
    display: block;
}

/* ====== MINI CART ====== */
.mini-cart-dropdown {
    border: none;
    box-shadow: var(--shadow-xl);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.mini-cart-item {
    transition: background-color var(--transition-fast);
}

.mini-cart-item:hover {
    background-color: var(--light-color);
}

.mini-cart-item-image {
    border-radius: var(--border-radius-md);
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.quantity-controls button {
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* ====== RATINGS ====== */
.rating {
    color: var(--rating-color);
    font-size: 0.875rem;
}

.rating .bi-star-fill {
    color: var(--rating-color);
}

.rating .bi-star {
    color: #dee2e6;
}

/* ====== BADGES ====== */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius-md);
}

/* ====== ALERTS ====== */
.alert {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* ====== TOOLTIPS ====== */
.tooltip {
    font-size: 0.875rem;
}

.tooltip-inner {
    background-color: var(--dark-color);
    color: white;
    border-radius: var(--border-radius-md);
    padding: 0.5rem 0.75rem;
}

/* ====== PRINT STYLES ====== */
@media print {
    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }

    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* ====== PRODUCT STYLES ====== */

/* Product Grid Styles */
.product-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #0d6efd;
}

.hover-shadow:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.product-image-container {
    border-radius: 0.375rem 0.375rem 0 0;
    overflow: hidden;
}

.product-quick-actions {
    transition: transform 0.3s ease;
}

.product-title {
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 0.95rem;
    font-weight: 600;
}

.product-description {
    line-height: 1.5;
    height: 9em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    font-size: 0.85rem;
}

.sale-price {
    position: relative;
}

.sale-price .badge {
    position: absolute;
    top: -5px;
    right: -10px;
    font-size: 0.75rem;
}

.product-features .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

/* Product List Styles */
.product-list-item {
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.product-list-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-2px);
}

.product-list-item .product-image-container img {
    transition: all 0.3s ease;
}

.product-list-item:hover .product-image-container img {
    transform: scale(1.05);
}

.price-actions-card {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    height: 100%;
}

.action-buttons .btn {
    transition: all 0.2s ease;
}

.action-buttons .btn:hover {
    transform: translateY(-1px);
}

/* Responsive Product Styles */
@media (max-width: 768px) {
    .products-grid .row-cols-sm-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-list-item .row > div {
        margin-bottom: 1rem;
    }

    .price-actions-card {
        position: relative;
    }

    .product-card {
        margin-bottom: 1rem;
    }

    .product-title {
        font-size: 0.9rem;
    }

    .product-price {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .products-grid .row-cols-1 {
        grid-template-columns: 1fr;
    }
}

