/* Digital Assets Marketplace - Professional UI */

/* CSS Variables for Professional Color Palette */
:root {
    /* Primary Colors */
    --primary-blue: #2563eb;
    --primary-blue-dark: #1d4ed8;
    --primary-blue-light: #3b82f6;
    --primary-blue-lighter: #dbeafe;
    
    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --black: #000000;
    
    /* Accent Colors */
    --success-green: #10b981;
    --warning-yellow: #f59e0b;
    --error-red: #ef4444;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--white);
    font-weight: 400;
    /* Prevent layout shifts and improve stability */
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Prevent content jumping during page load */
html {
    scroll-behavior: smooth;
}

/* Ensure consistent rendering */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-weight: 800;
    color: var(--gray-900);
}

.lead {
    font-weight: 400;
    color: var(--gray-600);
}

/* Navigation */
.navbar {
    background: var(--white) !important;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1050;
    /* Prevent layout shifts */
    min-height: 70px;
    display: flex;
    align-items: center;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-blue) !important;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
    color: var(--primary-blue-dark) !important;
}

/* Navigation Container for Sliding Background */
.navbar-nav {
    position: relative;
}

.navbar-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--primary-blue-lighter);
    border-radius: var(--radius-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    opacity: 0;
}

.navbar-nav .nav-item {
    position: relative;
    z-index: 1;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--gray-700) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    position: relative;
    z-index: 2;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-blue) !important;
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
    color: var(--primary-blue) !important;
    background-color: var(--primary-blue-lighter);
    transform: translateY(-1px);
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 80%;
}

/* Sliding Background Animation */
.navbar-nav .nav-item:hover ~ .navbar-nav::before,
.navbar-nav .nav-item.active ~ .navbar-nav::before {
    opacity: 1;
}

/* Individual nav item background animation */
.navbar-nav .nav-item {
    position: relative;
    overflow: hidden;
    margin: 0 0.25rem;
}

/* Exclude dropdown items from sliding animation */
.navbar-nav .nav-item:not(.dropdown)::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-blue-lighter) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-radius: var(--radius-md);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.navbar-nav .nav-item:not(.dropdown):hover::before {
    left: 0;
    transform: scale(1.05);
}

.navbar-nav .nav-item:not(.dropdown).active::before {
    left: 0;
    background: linear-gradient(135deg, var(--primary-blue-lighter) 0%, rgba(37, 99, 235, 0.2) 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.navbar-nav .nav-item .nav-link {
    position: relative;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--radius-md);
}

.navbar-nav .nav-item:not(.dropdown):hover .nav-link {
    color: var(--primary-blue) !important;
    transform: translateY(-1px);
}

.navbar-nav .nav-item:not(.dropdown).active .nav-link {
    color: var(--primary-blue) !important;
    transform: translateY(-1px);
    font-weight: 600;
}

/* Enhanced hover effect with ripple - exclude dropdowns */
.navbar-nav .nav-item:not(.dropdown)::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.navbar-nav .nav-item:not(.dropdown):hover::after {
    width: 120%;
    height: 120%;
}

/* Dropdown specific styles - No background animation */
.navbar-nav .nav-item.dropdown {
    overflow: visible;
    position: relative;
}

.navbar-nav .nav-item.dropdown .nav-link {
    position: relative;
    z-index: 1000;
    background: transparent;
}

.navbar-nav .nav-item.dropdown:hover .nav-link {
    color: var(--primary-blue) !important;
    background-color: var(--primary-blue-lighter);
    border-radius: var(--radius-md);
}

/* Ensure dropdown items have no background animation */
.navbar-nav .nav-item.dropdown::before,
.navbar-nav .nav-item.dropdown::after {
    display: none;
}

/* Ensure dropdown menu is properly positioned and clickable */
.navbar-nav .nav-item.dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    z-index: 1060;
    pointer-events: auto;
}

.navbar-nav .nav-item.dropdown .dropdown-item {
    cursor: pointer;
    pointer-events: auto;
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* Hero Section - Improved Background */
.hero-section {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #1d4ed8 100%);
    color: var(--white);
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.hero-section::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"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    z-index: 0;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    color: var(--white);
    font-weight: 800;
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s ease-out;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-section .lead {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.25rem;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.2s both;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.hero-image {
    text-align: center;
    animation: fadeInRight 1s ease-out 0.4s both;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    transition: transform 0.3s ease;
}

.hero-image img:hover {
    transform: scale(1.05);
}

/* Buttons - Fixed Visibility */
.btn {
    font-weight: 600;
    border-radius: var(--radius-lg);
    padding: 0.75rem 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    /* Prevent button jumping */
    min-height: 44px;
    min-width: 44px;
    /* Ensure consistent rendering */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

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

.btn-primary:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
    color: var(--white) !important;
}

.btn-outline-primary {
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue) !important;
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-outline-light {
    border: 2px solid var(--white);
    color: var(--white) !important;
    background: transparent;
}

.btn-outline-light:hover {
    background: var(--white);
    color: var(--primary-blue) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-light {
    background: var(--white);
    color: var(--primary-blue) !important;
    border: 2px solid var(--white);
}

.btn-light:hover {
    background: var(--gray-100);
    color: var(--primary-blue-dark) !important;
    border-color: var(--gray-200);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Cards */
.card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    background: var(--white);
    /* Prevent layout shifts */
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--gray-300);
}

.card-img-top {
    transition: transform 0.3s ease;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

/* Category Cards - Improved Visibility */
.category-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-blue-lighter) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover::before {
    opacity: 1;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-blue);
    background: var(--white);
}

.category-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-blue-lighter);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.category-card:hover .category-icon {
    background: var(--primary-blue);
    transform: scale(1.1) rotate(5deg);
}

.category-icon i {
    font-size: 2rem;
    color: var(--primary-blue);
    transition: all 0.3s ease;
}

.category-card:hover .category-icon i {
    color: var(--white);
    transform: scale(1.1);
}

.category-card h5 {
    color: var(--gray-900);
    margin-bottom: 1rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.category-card p {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.category-card .btn {
    position: relative;
    z-index: 1;
}

/* Product Cards */
.product-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--gray-300);
}

.product-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
}

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

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

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(37, 99, 235, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-info {
    padding: 1.5rem;
}

.product-info h5 {
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.product-info p {
    color: var(--gray-600);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.price {
    color: var(--primary-blue);
    font-weight: 800;
    font-size: 1.25rem;
}

.rating {
    color: var(--warning-yellow);
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.product-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.product-stats small {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

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

.stars {
    display: flex;
    gap: 0.125rem;
}

.stars i {
    font-size: 0.875rem;
}

/* Feature Cards - Improved Visibility */
.feature-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-blue-lighter) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-blue);
    background: var(--white);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-blue-lighter);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.feature-card:hover .feature-icon {
    background: var(--primary-blue);
    transform: scale(1.1) rotate(5deg);
}

.feature-icon i {
    font-size: 2rem;
    color: var(--primary-blue);
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon i {
    color: var(--white);
    transform: scale(1.1);
}

.feature-card h4 {
    color: var(--gray-900);
    margin-bottom: 1rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.feature-card p {
    color: var(--gray-600);
    position: relative;
    z-index: 1;
}

/* Forms */
.form-control {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--white);
}

.form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-select {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    background: var(--white);
}

.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Badges */
.badge {
    border-radius: var(--radius-lg);
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.8rem;
}

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

.badge.bg-danger {
    background: var(--error-red) !important;
}

/* Alerts */
.alert {
    border-radius: var(--radius-lg);
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 500;
}

.alert-primary {
    background: var(--primary-blue-lighter);
    color: var(--primary-blue-dark);
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Pagination */
.pagination .page-link {
    border-radius: var(--radius-md);
    margin: 0 2px;
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
    padding: 0.5rem 1rem;
}

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

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

/* Footer - Improved Background and Visibility */
footer {
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
    color: var(--gray-300);
    padding: 3rem 0 1rem;
    border-top: 1px solid var(--gray-700);
}

footer h5 {
    color: var(--white);
    font-weight: 700;
    margin-bottom: 1rem;
}

footer h6 {
    color: var(--white);
    font-weight: 600;
    margin-bottom: 1rem;
}

footer a {
    color: var(--gray-300);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 400;
}

footer a:hover {
    color: var(--primary-blue);
    text-decoration: none;
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: var(--gray-800);
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    margin-right: 0.5rem;
    transition: all 0.2s ease;
    color: var(--gray-300);
}

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

/* Background Colors */
.bg-light {
    background-color: var(--gray-50) !important;
}

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

/* Hero Section Text Colors - Ensure all text is white */
.bg-primary.text-white h1,
.bg-primary.text-white h2,
.bg-primary.text-white h3,
.bg-primary.text-white h4,
.bg-primary.text-white h5,
.bg-primary.text-white h6,
.bg-primary.text-white p,
.bg-primary.text-white .lead,
.bg-primary.text-white .display-1,
.bg-primary.text-white .display-2,
.bg-primary.text-white .display-3,
.bg-primary.text-white .display-4,
.bg-primary.text-white .display-5,
.bg-primary.text-white .display-6 {
    color: var(--white) !important;
}

/* Additional specific rules for hero sections */
section.bg-primary.text-white h1,
section.bg-primary.text-white h2,
section.bg-primary.text-white h3,
section.bg-primary.text-white h4,
section.bg-primary.text-white h5,
section.bg-primary.text-white h6,
section.bg-primary.text-white p,
section.bg-primary.text-white .lead,
section.bg-primary.text-white .display-1,
section.bg-primary.text-white .display-2,
section.bg-primary.text-white .display-3,
section.bg-primary.text-white .display-4,
section.bg-primary.text-white .display-5,
section.bg-primary.text-white .display-6 {
    color: #ffffff !important;
}

/* Override any Bootstrap or other conflicting styles */
.bg-primary.text-white * {
    color: #ffffff !important;
}

/* Text Colors */
.text-primary {
    color: var(--primary-blue) !important;
}

.text-muted {
    color: var(--gray-600) !important;
}

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

/* Dropdown */
.dropdown-menu {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    background: var(--white);
    z-index: 1060;
    position: absolute;
    display: none;
    min-width: 200px;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    color: var(--gray-700);
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: var(--primary-blue-lighter);
    color: var(--primary-blue);
}

/* Search Box */
.search-box {
    position: relative;
}

.search-box .form-control {
    padding-right: 50px;
}

.search-box .btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--primary-blue);
    border: none;
    color: var(--white);
}

.search-box .btn:hover {
    background: var(--primary-blue-dark);
    color: var(--white);
}

/* CTA Section Enhancements */
.cta-section {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: var(--white);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.cta-section::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"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.cta-section .container {
    position: relative;
    z-index: 2;
}

.cta-section h2 {
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cta-section .lead {
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 4rem 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1.1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 0;
    }
    
    /* Mobile navigation adjustments */
    .navbar-nav .nav-item {
        margin: 0.25rem 0;
    }
    
    .navbar-nav .nav-item::before {
        border-radius: var(--radius-sm);
    }
    
    .navbar-nav .nav-item .nav-link {
        border-radius: var(--radius-sm);
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .category-card,
    .feature-card {
        padding: 1.5rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

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

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

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

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius-lg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: var(--radius-lg);
}

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

/* Loading Spinner */
.spinner-border {
    color: var(--primary-blue);
}

/* Toast Notifications */
.toast {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
}

/* Table Styling */
.table {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.table thead th {
    background: var(--gray-50);
    border: none;
    font-weight: 700;
    color: var(--gray-900);
    padding: 1rem;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table tbody td {
    padding: 1rem;
    border-color: var(--gray-200);
}

/* Modal Styling */
.modal-content {
    border-radius: var(--radius-xl);
    border: none;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--gray-200);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--gray-200);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    padding: 1.5rem;
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .card {
        border: 1px solid var(--black) !important;
        box-shadow: none !important;
    }
}

/* Additional Enhancements */
.section-title {
    position: relative;
    margin-bottom: 3rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-blue);
    border-radius: 2px;
}

/* Hover Effects for Interactive Elements */
.interactive-element {
    transition: all 0.3s ease;
}

.interactive-element:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Gradient Text Effect */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* Pulse Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* List View Styles for Products */
.list-view .col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
}

.list-view .product-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    padding: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.list-view .product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-blue);
}

.list-view .product-image {
    flex: 0 0 280px;
    margin-right: 2rem;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.list-view .product-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    transition: transform 0.3s ease;
}

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

.list-view .product-info {
    flex: 1;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.list-view .product-info h5 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.list-view .product-info .category-name {
    color: var(--gray-600);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.list-view .product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.list-view .price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.list-view .rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.list-view .rating .stars {
    display: flex;
    gap: 0.1rem;
}

.list-view .rating .stars i {
    font-size: 0.9rem;
}

.list-view .product-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.list-view .product-stats small {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.list-view .product-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.list-view .product-overlay {
    display: none;
}

/* Responsive adjustments for list view */
@media (max-width: 768px) {
    .list-view .product-card {
        flex-direction: column;
        text-align: center;
    }
    
    .list-view .product-image {
        flex: 0 0 auto;
        margin-right: 0;
        margin-bottom: 1rem;
        width: 100%;
    }
    
    .list-view .product-image img {
        height: 180px;
    }
    
    .list-view .product-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    .list-view .product-stats {
        justify-content: center;
    }
}

/* Top Filters Section Styles */
.top-filters-section {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.price-notice {
    color: var(--gray-600);
}

.sort-options .btn-group {
    flex-wrap: wrap;
    gap: 0.25rem;
}

.sort-options .sort-btn {
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-700);
}

.sort-options .sort-btn:hover {
    background: var(--primary-blue-lighter);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    transform: translateY(-1px);
}

.sort-options .sort-btn.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.sort-options .sort-btn.active:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-1px);
}

.item-count {
    font-size: 1.1rem;
    color: var(--gray-800);
}

.active-filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
}

.filter-tag:hover {
    background: var(--gray-200);
    border-color: var(--gray-300);
}

.filter-tag .remove-filter {
    color: var(--gray-500);
    text-decoration: none;
    padding: 0.125rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.filter-tag .remove-filter:hover {
    background: var(--gray-300);
    color: var(--gray-700);
    transform: scale(1.1);
}

.clear-all-filters {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
}

.clear-all-filters:hover {
    background: var(--primary-blue-lighter);
    color: var(--primary-blue-dark);
    text-decoration: none;
}

/* Responsive adjustments for filters */
@media (max-width: 768px) {
    .top-filters-section {
        padding: 1rem;
    }
    
    .sort-options .btn-group {
        justify-content: center;
    }
    
    .sort-options .sort-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .active-filters {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .item-count {
        text-align: center;
        margin-bottom: 1rem;
    }
}

/* Loading Spinner Styles */
#loading-spinner {
    position: relative;
    z-index: 1000;
}

#loading-spinner .spinner-border {
    width: 3rem;
    height: 3rem;
}

#products-wrapper {
    transition: opacity 0.3s ease;
}

/* AJAX Loading Animation */
.ajax-loading {
    opacity: 0.5;
    pointer-events: none;
}

.ajax-loading * {
    transition: none !important;
}

/* Smooth transitions for filter updates */
.filter-update {
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* View Toggle Animation */
.view-toggle-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.view-toggle-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.view-toggle-btn:hover::before {
    left: 100%;
}

.view-toggle-btn.active {
    background: var(--primary-blue) !important;
    color: var(--white) !important;
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* Smooth transition for view changes */
#products-container {
    transition: all 0.3s ease;
}

#products-container.list-view {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0.7;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure all text is visible */
.text-white-50 {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* Enhanced button visibility */
.btn:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
    outline: none;
}

/* Improved card shadows */
.category-card,
.feature-card,
.product-card {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.category-card:hover,
.feature-card:hover,
.product-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Enhanced Filtering System */
.top-filters-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    margin-bottom: 2rem;
}

.sort-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sort-btn {
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.sort-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.sort-btn.active {
    background: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}

.sort-btn.active:hover {
    background: var(--primary-blue-dark);
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.filter-tag {
    background: var(--primary-blue-lighter);
    color: var(--primary-blue-dark);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--primary-blue-light);
    transition: all 0.2s ease;
}

.filter-tag:hover {
    background: var(--primary-blue-light);
    transform: translateY(-1px);
}

.remove-filter {
    color: var(--primary-blue-dark);
    text-decoration: none;
    font-size: 0.75rem;
    padding: 0.125rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.remove-filter:hover {
    background: var(--primary-blue-dark);
    color: var(--white);
}

.clear-all-filters {
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.clear-all-filters:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

/* Enhanced Sidebar Filters */
.card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

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

.card-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: 1.5rem;
}

.form-label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag-item {
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--gray-200);
    user-select: none;
}

.tag-item:hover {
    background: var(--primary-blue-lighter);
    color: var(--primary-blue-dark);
    border-color: var(--primary-blue-light);
    transform: translateY(-1px);
}

.tag-item.selected {
    background: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}

/* Enhanced Form Controls */
.form-check-input:checked {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.form-check-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: var(--radius-lg);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

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

/* Responsive Design for Enhanced Filters */
@media (max-width: 768px) {
    .sort-options {
        justify-content: center;
    }
    
    .sort-btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    .active-filters {
        justify-content: center;
    }
    
    .filter-tag {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    .top-filters-section {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .tag-cloud {
        justify-content: center;
    }
    
    .tag-item {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }
}

/* Review System Styles */
.review-stats {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    padding: 1rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: var(--white);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
}

.review-item {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
}

.review-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-blue-lighter);
}

.review-content {
    background: var(--gray-50);
    padding: 1rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-blue);
}

.rating-stars {
    display: inline-flex;
    gap: 0.25rem;
}

.rating-stars .star {
    transition: all 0.2s ease;
    cursor: pointer;
}

.rating-stars .star:hover {
    transform: scale(1.1);
}

.rating-stars .star.text-warning {
    color: #fbbf24 !important;
}

.review-form {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 2px dashed var(--gray-300);
}

.review-form:hover {
    border-color: var(--primary-blue);
    background: var(--white);
}

.form-text {
    font-size: 0.875rem;
    color: var(--gray-500);
}

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

/* Review validation styles */
.form-control.is-invalid {
    border-color: var(--error-red);
    box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.25);
}

.invalid-feedback {
    display: block;
    color: var(--error-red);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Review submission button states */
#submit-review-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#submit-review-btn .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Review statistics responsive */
@media (max-width: 768px) {
    .review-stats {
        padding: 1rem;
    }
    
    .stat-item {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .review-item {
        padding: 1rem;
    }
    
    .review-content {
        margin-left: 0 !important;
        margin-top: 1rem;
    }
    
    .review-form {
        padding: 1.5rem;
    }
    
    .avatar-circle {
        width: 35px;
        height: 35px;
        font-size: 0.75rem;
    }
}

/* Review animations */
.review-item {
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Review form focus states */
.review-form .form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

/* Review rating hover effects */
.rating-stars .star:hover ~ .star {
    color: var(--gray-400) !important;
}

/* Review statistics hover effects */
.stat-item h4 {
    transition: all 0.3s ease;
}

.stat-item:hover h4 {
    transform: scale(1.1);
}

/* Wishlist Styles */
.wishlist-btn {
    transition: all 0.3s ease;
}

/* Circular wishlist button (for product cards) */
.wishlist-btn.btn-sm {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.wishlist-btn.btn-sm:hover {
    transform: scale(1.1);
}

.wishlist-btn.btn-sm.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border-color: #dc3545;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.wishlist-btn.btn-sm.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: scale(1.1);
}

/* Full-width wishlist button (for product detail page) */
.wishlist-btn:not(.btn-sm) {
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-700);
    position: relative;
    overflow: hidden;
}

.wishlist-btn:not(.btn-sm):hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--gray-400);
    background: var(--gray-50);
}

.wishlist-btn:not(.btn-sm).btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border-color: #dc3545;
    color: var(--white);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.wishlist-btn:not(.btn-sm).btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
    border-color: #c82333;
}

/* Wishlist button active state */
.wishlist-btn:not(.btn-sm).btn-danger .fas.fa-heart {
    color: var(--white);
    animation: heartBeat 0.6s ease-in-out;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.wishlist-btn .fas.fa-heart {
    transition: all 0.3s ease;
}

.wishlist-btn:hover .fas.fa-heart {
    transform: scale(1.1);
}

/* Wishlist page specific styles */
.wishlist-item {
    transition: all 0.3s ease;
}

.wishlist-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.remove-from-wishlist {
    transition: all 0.3s ease;
    opacity: 0.8;
}

.remove-from-wishlist:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Wishlist count badge animation */
#wishlist-count {
    transition: all 0.3s ease;
}

#wishlist-count.updated {
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Product card wishlist button positioning */
.product-card .wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
}

.product-card:hover .wishlist-btn {
    background: rgba(255, 255, 255, 1);
}

/* Wishlist empty state */
.wishlist-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.wishlist-empty i {
    font-size: 4rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
}

/* Responsive wishlist */
@media (max-width: 768px) {
    .wishlist-btn.btn-sm {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }
    
    .wishlist-btn:not(.btn-sm) {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        border-width: 1px;
    }
    
    .product-card .wishlist-btn {
        top: 8px;
        right: 8px;
    }
}

@media (max-width: 576px) {
    .wishlist-btn:not(.btn-sm) {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .wishlist-btn:not(.btn-sm) .wishlist-text {
        display: none;
    }
    
    .wishlist-btn:not(.btn-sm) .fas.fa-heart {
        margin-right: 0 !important;
    }
}

/* ===== STABILITY AND PERFORMANCE IMPROVEMENTS ===== */

/* Prevent layout shifts during page load */
.page-content {
    min-height: 100vh;
    opacity: 0;
    animation: fadeInContent 0.5s ease-out forwards;
}

@keyframes fadeInContent {
    to {
        opacity: 1;
    }
}

/* Smooth loading states */
.loading-state {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-state * {
    transition: none !important;
}

/* Prevent form flickering */
form {
    opacity: 1;
    transition: opacity 0.3s ease;
}

form.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Modal stability improvements */
.modal {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-dialog {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
}

/* Prevent button state flickering */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Smooth transitions for dynamic content */
.dynamic-content {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Prevent image layout shifts */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Aspect ratio containers */
.aspect-ratio-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.aspect-ratio-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Improved focus states */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

/* Prevent text selection during interactions */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Prevent horizontal scroll */
.container-fluid {
    overflow-x: hidden;
}

/* Improved hover states */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

/* Loading spinner improvements */
.spinner-border {
    animation: spin 1s linear infinite;
    border-width: 0.2em;
}

/* Prevent content jumping during AJAX requests */
.ajax-content {
    min-height: 200px;
    transition: opacity 0.3s ease;
}

.ajax-content.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Form field stability */
.form-group {
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.form-control,
.form-select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
}

/* Prevent table layout shifts */
.table {
    table-layout: fixed;
    width: 100%;
}

.table th,
.table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Improved toast notifications */
.toast {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
}

/* Prevent dropdown flickering */
.dropdown-menu {
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform-origin: top center;
}

.dropdown-menu.show {
    opacity: 1;
    transform: scaleY(1);
}

.dropdown-menu:not(.show) {
    opacity: 0;
    transform: scaleY(0);
}

/* Enhanced accessibility */
.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 visible for better accessibility */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Prevent animation conflicts */
* {
    animation-fill-mode: both;
}

/* Improved performance for animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Prevent layout shifts for dynamic content */
.content-placeholder {
    min-height: 100px;
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-md);
}

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

/* Improved button states */
.btn-primary:active {
    transform: translateY(1px);
}

.btn-primary:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

/* Prevent form submission flickering */
form.submitting {
    pointer-events: none;
}

form.submitting .btn[type="submit"] {
    opacity: 0.7;
}

/* Enhanced modal backdrop */
.modal-backdrop {
    transition: opacity 0.3s ease;
}

/* Prevent text wrapping issues */
.text-nowrap {
    white-space: nowrap;
}

/* Improved responsive behavior */
@media (max-width: 768px) {
    .btn {
        min-height: 48px; /* Larger touch targets on mobile */
    }
    
    .modal-dialog {
        margin: 1rem;
    }
    
    .toast-container {
        left: 1rem;
        right: 1rem;
    }
}

/* Performance optimizations */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Prevent double-tap zoom on mobile */
* {
    touch-action: manipulation;
}

/* Improved print styles */
@media print {
    .no-print,
    .btn,
    .modal,
    .toast-container {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
}
