/**
 * Enhanced Homepage Styles
 * Professional Mobile-First Design for Souq Marketplace
 */

/* Enhanced Hero Section */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    min-height: 90vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    color: white;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.2) 0%, transparent 50%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 2rem 0;
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-title .text-gradient {
    background: linear-gradient(45deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.6;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    min-width: 120px;
}

.stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Hero Actions */
.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-actions .btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 160px;
    justify-content: center;
}

.hero-actions .btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.hero-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.hero-actions .btn-outline-primary {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    backdrop-filter: blur(10px);
}

.hero-actions .btn-outline-primary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Hero Image */
.hero-image {
    position: relative;
    z-index: 2;
}

.hero-image-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.hero-main-image {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.2));
}

/* Floating Cards */
.floating-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #333;
    font-weight: 600;
    font-size: 0.9rem;
    animation: float 3s ease-in-out infinite;
}

.floating-card i {
    font-size: 1.2rem;
    color: #667eea;
}

.floating-card.card-1 {
    top: 20%;
    right: -10%;
    animation-delay: 0s;
}

.floating-card.card-2 {
    top: 60%;
    left: -15%;
    animation-delay: 1s;
}

.floating-card.card-3 {
    bottom: 20%;
    right: 10%;
    animation-delay: 2s;
}

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

/* Enhanced Categories Section */
.categories-section {
    padding: 4rem 0;
    background: #f8fafc;
}

.section-header {
    margin-bottom: 2.5rem;
}

/* Featured and Trending Products Sections */
.featured-products {
    padding: 4rem 0;
    background: white;
}

.trending-products {
    padding: 4rem 0;
    background: #f9fafb;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(45deg, #4f46e5, #7c3aed);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Enhanced Category Cards */
.category-card {
    display: block;
    background: white;
    border-radius: 20px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
}

.category-image {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.category-image img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
}

.category-icon {
    font-size: 2rem;
    color: white;
}

.category-info {
    position: relative;
    z-index: 2;
}

.category-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.category-count {
    font-size: 0.9rem;
    color: #64748b;
}

.category-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.category-card:hover .category-overlay {
    opacity: 1;
    transform: scale(1);
}

.category-overlay i {
    color: white;
    font-size: 1rem;
}

/* Enhanced Product Cards */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.product-card .card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.product-card .card-text {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 1rem;
}

.product-card .btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

/* Enhanced Features Section */
.features-section {
    padding: 4rem 0;
    background: white;
}

.feature-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.feature-icon i {
    font-size: 2rem;
    color: white;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.feature-description {
    color: #64748b;
    line-height: 1.6;
    position: relative;
    z-index: 2;
}

/* Enhanced Buttons */
.btn-enhanced {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border: none;
    color: white;
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
    color: white;
    text-decoration: none;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        min-height: 70vh;
        padding: 2rem 0;
    }

    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .hero-stats {
        gap: 1rem;
        justify-content: center;
    }

    .stat-item {
        min-width: 100px;
        padding: 1rem 0.75rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-actions .btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        min-width: 140px;
    }

    .floating-card {
        display: none;
    }

    .section-title {
        font-size: 2rem;
    }

    .category-card {
        padding: 1.5rem 1rem;
    }

    .feature-card {
        padding: 2rem 1.5rem;
    }
}

/* Tablet Responsive Design */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-title {
        font-size: 3rem;
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .stat-item {
        min-width: 110px;
    }

    .floating-card {
        font-size: 0.85rem;
        padding: 0.875rem 1.25rem;
    }

    .category-card {
        padding: 1.75rem 1.25rem;
    }

    .feature-card {
        padding: 2.25rem 1.75rem;
    }
}

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

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

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

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

/* Animation Classes */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out;
}

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

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Enhanced Scroll Behavior */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* 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;
    }
}

/* Enhanced Focus States for Accessibility */
.category-card:focus,
.product-card:focus,
.feature-card:focus,
.btn:focus {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .hero-section {
        background: linear-gradient(135deg, #000080 0%, #4B0082 100%);
    }

    .category-card,
    .product-card,
    .feature-card {
        border: 2px solid #333;
    }

    .btn-enhanced {
        border: 2px solid white;
    }
}

/* 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;
    }

    .floating-card {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .hero-section {
        background: white !important;
        color: black !important;
        min-height: auto !important;
    }

    .floating-card {
        display: none !important;
    }

    .btn {
        border: 1px solid black !important;
        background: white !important;
        color: black !important;
    }
}

/* Testimonials Section */
.testimonials-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.testimonial-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.testimonial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.testimonial-content {
    position: relative;
    z-index: 2;
}

.testimonial-stars {
    margin-bottom: 1rem;
}

.testimonial-stars i {
    color: #ffd700;
    font-size: 1rem;
    margin-right: 0.25rem;
}

.testimonial-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #64748b;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.author-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.author-location {
    font-size: 0.875rem;
    color: #64748b;
}

/* Statistics Section */
.statistics-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-card {
    text-align: center;
    padding: 2rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* Empty State Styles */
.empty-state {
    padding: 4rem 2rem;
}

.empty-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #9ca3af;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 1rem;
}

.empty-description {
    font-size: 1rem;
    color: #9ca3af;
    max-width: 400px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
        line-height: 1.3;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .hero-stats {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .stat-item {
        min-width: 120px;
        padding: 1rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .hero-actions .btn {
        width: 100%;
        max-width: 280px;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .category-card {
        padding: 1.25rem 1rem;
    }

    .category-image {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }

    .category-icon {
        font-size: 1.5rem;
    }

    .feature-card {
        padding: 1.75rem 1.25rem;
    }

    .feature-icon {
        width: 60px;
        height: 60px;
    }

    .testimonial-card {
        padding: 1.5rem;
    }

    .stat-card {
        padding: 1.5rem 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }
}

/* Enhanced Tablet Responsive Design */
@media (min-width: 481px) and (max-width: 768px) {
    .hero-title {
        font-size: 2.75rem;
    }

    .hero-stats {
        gap: 1.25rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .stat-item {
        flex: 0 0 calc(50% - 0.625rem);
        min-width: auto;
    }

    .hero-actions .btn {
        min-width: 150px;
    }

    .section-title {
        font-size: 2.25rem;
    }
}

/* Large Tablet and Small Desktop */
@media (min-width: 769px) and (max-width: 1199px) {
    .container {
        max-width: 960px;
    }

    .hero-title {
        font-size: 3.25rem;
    }

    .section-title {
        font-size: 2.25rem;
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    .hero-title {
        font-size: 3.75rem;
    }

    .section-title {
        font-size: 2.75rem;
    }

    .category-card {
        padding: 2.5rem 2rem;
    }

    .feature-card {
        padding: 3rem 2.5rem;
    }
}

/* Ultra-wide Screens */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    .hero-section {
        padding: 4rem 0;
    }

    .hero-title {
        font-size: 3.5rem;
    }
}

/* Additional Professional Styling */
.section-title {
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(45deg, #4f46e5, #7c3aed);
    border-radius: 2px;
}

/* Improved spacing and typography */
.hero-content {
    max-width: 600px;
}

.section-subtitle {
    max-width: 700px;
    margin: 0 auto;
    color: #64748b;
    line-height: 1.7;
}

/* Enhanced card hover effects */
.category-card:hover,
.feature-card:hover {
    transform: translateY(-6px);
}

/* Better button styling */
.btn-enhanced {
    font-size: 0.95rem;
    letter-spacing: 0.025em;
}

/* Improved empty state */
.empty-state {
    max-width: 500px;
    margin: 0 auto;
}

.empty-icon {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

/* Better responsive spacing */
@media (max-width: 768px) {
    .categories-section,
    .featured-products,
    .trending-products,
    .features-section {
        padding: 3rem 0;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    .hero-actions .btn {
        font-size: 0.9rem;
        padding: 0.75rem 1.5rem;
    }

    .product-card .card-img-top {
        height: 180px;
    }
}

/* Additional improvements for better UX */
.product-card .card-body {
    padding: 1.25rem;
}

.product-card .card-title {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.product-card .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

/* Improved category cards */
.category-card {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Better empty state styling */
.empty-state {
    padding: 3rem 1.5rem;
}

.empty-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.empty-description {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* Header improvements for mobile and tablet */
@media (max-width: 1199px) {
    .main-header .container .row {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    .logo-icon {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.9rem !important;
    }

    .logo-text h6 {
        font-size: 0.8rem !important;
    }

    .user-actions .btn {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.8rem !important;
    }

    .user-actions .btn i {
        font-size: 0.75rem !important;
    }
}

@media (max-width: 768px) {
    .main-header {
        min-height: auto !important;
    }

    .main-header .container .row {
        padding-top: 0.4rem !important;
        padding-bottom: 0.4rem !important;
        min-height: auto !important;
    }

    .logo-icon {
        width: 26px !important;
        height: 26px !important;
        font-size: 0.75rem !important;
        margin-right: 0.4rem !important;
    }

    .logo-text h6 {
        font-size: 0.7rem !important;
        line-height: 1.2 !important;
    }

    .user-actions {
        gap: 0.2rem !important;
    }

    .user-actions .btn {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.7rem !important;
        min-height: auto !important;
    }

    .user-actions .btn i {
        font-size: 0.65rem !important;
    }

    /* Hide search form completely on mobile and tablet */
    .search-form {
        display: none !important;
    }

    /* Make header even more compact */
    .navbar-brand {
        padding: 0 !important;
    }

    .main-header .shadow-sm {
        box-shadow: 0 0.05rem 0.1rem rgba(0, 0, 0, 0.075) !important;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .main-header .container .row {
        padding-top: 0.3rem !important;
        padding-bottom: 0.3rem !important;
    }

    .logo-icon {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.7rem !important;
        margin-right: 0.3rem !important;
    }

    .logo-text h6 {
        font-size: 0.65rem !important;
    }

    .user-actions .btn {
        padding: 0.25rem 0.4rem !important;
        font-size: 0.65rem !important;
    }

    .user-actions .btn i {
        font-size: 0.6rem !important;
    }
}

/* Mobile header improvements */
@media (max-width: 1199px) {
    /* Mobile menu button styling */
    .user-actions .btn[data-bs-toggle="collapse"] {
        border-color: #4f46e5 !important;
        color: #4f46e5 !important;
    }

    .user-actions .btn[data-bs-toggle="collapse"]:hover {
        background-color: #4f46e5 !important;
        color: white !important;
    }

    /* Mobile auth buttons */
    .user-actions .btn.btn-outline-primary.d-lg-none {
        border-color: #4f46e5 !important;
        color: #4f46e5 !important;
        margin-right: 0.2rem !important;
    }

    .user-actions .btn.btn-primary.d-lg-none {
        background-color: #4f46e5 !important;
        border-color: #4f46e5 !important;
    }

    /* Mobile user dropdown */
    .dropdown-toggle.d-lg-none {
        border-color: #4f46e5 !important;
        color: #4f46e5 !important;
    }

    .dropdown-toggle.d-lg-none:hover {
        background-color: #4f46e5 !important;
        color: white !important;
    }
}

/* Ensure proper spacing between header elements */
@media (max-width: 768px) {
    .user-actions {
        flex-wrap: nowrap !important;
        overflow: hidden;
    }

    .user-actions .btn {
        white-space: nowrap;
        min-width: auto;
    }

    /* Hide text on very small screens for auth buttons */
    @media (max-width: 480px) {
        .user-actions .btn span {
            display: none !important;
        }

        .user-actions .btn {
            padding: 0.25rem 0.4rem !important;
        }
    }
}

/* Landscape Mobile Orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: 70vh;
        padding: 1.5rem 0;
    }

    .hero-title {
        font-size: 2.25rem;
        margin-bottom: 0.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .hero-stats {
        margin-bottom: 1.5rem;
    }

    .stat-item {
        padding: 0.75rem;
    }

    .stat-number {
        font-size: 1.25rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-muted: #94a3b8;
        --white-color: #1e293b;
        --light-color: #334155;
    }

    .category-card,
    .product-card,
    .feature-card,
    .testimonial-card {
        background: #334155;
        border-color: #475569;
    }

    .hero-section {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    }
}

/* Print Optimizations */
@media print {
    .hero-section {
        background: white !important;
        color: black !important;
        min-height: auto !important;
        page-break-inside: avoid;
    }

    .floating-card,
    .btn,
    .hero-actions {
        display: none !important;
    }

    .section-title {
        color: black !important;
        page-break-after: avoid;
    }

    .category-card,
    .product-card,
    .feature-card {
        break-inside: avoid;
        background: white !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}
