/* Ceylon Silva Gems - Custom CSS Styles */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* Line Clamp Utility for Text Truncation */
.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* Advanced Animations for Enhanced UI */
@keyframes twinkle {
    0%, 100% { 
        opacity: 0.3;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
    }
    33% { 
        transform: translateY(-10px) rotate(2deg);
    }
    66% { 
        transform: translateY(5px) rotate(-1deg);
    }
}

@keyframes gentleGlow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    }
    50% { 
        box-shadow: 0 0 30px rgba(212, 175, 55, 0.6);
    }
}

@keyframes sparkle {
    0% { 
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
    25% { 
        transform: rotate(90deg) scale(1.1);
        opacity: 0.8;
    }
    50% { 
        transform: rotate(180deg) scale(1);
        opacity: 1;
    }
    75% { 
        transform: rotate(270deg) scale(1.1);
        opacity: 0.8;
    }
    100% { 
        transform: rotate(360deg) scale(1);
        opacity: 1;
    }
}

/* Animation Classes */
.animate-twinkle {
    animation: twinkle 3s ease-in-out infinite;
}

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

.animate-sparkle {
    animation: sparkle 4s linear infinite;
}

.animate-glow {
    animation: gentleGlow 2s ease-in-out infinite;
}

/* Delay classes for staggered animations */
.delay-500 { animation-delay: 0.5s; }
.delay-1000 { animation-delay: 1s; }
.delay-1500 { animation-delay: 1.5s; }
.delay-2000 { animation-delay: 2s; }

/* Hero Background Slideshow Styles */
.hero-bg-slide {
    transition: opacity 1s ease-in-out;
    opacity: 0;
}

.hero-bg-slide.active {
    opacity: 0.6;
}

.hero-bg-slide img {
    transition: transform 10s ease-out;
}

.hero-bg-slide.active img {
    transform: scale(1.05);
}

/* CSS Variables for consistent theming */
:root {
    --gem-blue: #1e3a8a;
    --gem-sapphire: #1e40af;
    --gem-gold: #d4af37;
    --gem-silver: #c0c0c0;
    --gem-ruby: #e11d48;
    --gem-emerald: #059669;
    --transition-duration: 0.3s;
    --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);
}

/* Base styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #374151;
    background-color: #ffffff;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    line-height: 1.2;
    color: #1f2937;
}

.font-serif {
    font-family: 'Playfair Display', serif;
}

.font-sans {
    font-family: 'Inter', sans-serif;
}

/* Custom 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 gemSparkle {
    0%, 100% {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
    50% {
        transform: rotate(180deg) scale(1.1);
        opacity: 0.8;
    }
}

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

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

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

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

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

.animate-gem-sparkle {
    animation: gemSparkle 2s ease-in-out infinite;
}

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

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

/* Custom button styles */
.btn-primary {
    @apply bg-gem-sapphire text-white px-6 py-3 rounded-lg font-semibold hover:bg-gem-blue transition-all duration-300 transform hover:scale-105 active:scale-95;
}

.btn-secondary {
    @apply border-2 border-gem-sapphire text-gem-sapphire px-6 py-3 rounded-lg font-semibold hover:bg-gem-sapphire hover:text-white transition-all duration-300;
}

.btn-gold {
    @apply bg-gem-gold text-gray-900 px-6 py-3 rounded-lg font-semibold hover:bg-yellow-400 transition-all duration-300 transform hover:scale-105 active:scale-95;
}

/* Custom card styles */
.card {
    @apply bg-white rounded-2xl shadow-lg hover:shadow-xl transition-all duration-300 transform hover:-translate-y-2;
}

.card-product {
    @apply card overflow-hidden group;
}

.card-product img {
    @apply w-full h-64 object-cover group-hover:scale-110 transition-transform duration-300;
}

/* Custom gradient backgrounds */
.gradient-sapphire {
    background: linear-gradient(135deg, var(--gem-sapphire) 0%, var(--gem-blue) 100%);
}

.gradient-gold {
    background: linear-gradient(135deg, var(--gem-gold) 0%, #f59e0b 100%);
}

.gradient-gem {
    background: linear-gradient(135deg, var(--gem-sapphire) 0%, var(--gem-ruby) 50%, var(--gem-emerald) 100%);
}

/* Loading spinner */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--gem-sapphire);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--gem-sapphire);
    border-radius: 10px;
    opacity: 0.7;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gem-blue);
    opacity: 1;
}

/* Focus styles for accessibility */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.3);
}

/* Input styles */
.input-field {
    @apply w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-gem-sapphire focus:border-transparent transition-all duration-200;
}

.input-field:focus {
    border-color: var(--gem-sapphire);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* Text selection */
::selection {
    background-color: rgba(30, 64, 175, 0.2);
    color: var(--gem-blue);
}

::-moz-selection {
    background-color: rgba(30, 64, 175, 0.2);
    color: var(--gem-blue);
}

/* Image hover effects */
.image-zoom {
    overflow: hidden;
}

.image-zoom img {
    transition: transform 0.3s ease;
}

.image-zoom:hover img {
    transform: scale(1.1);
}

/* Badge styles */
.badge {
    @apply inline-flex items-center px-3 py-1 rounded-full text-sm font-semibold;
}

.badge-featured {
    @apply badge bg-gem-gold text-gray-900;
}

.badge-bestseller {
    @apply badge bg-gem-ruby text-white;
}

.badge-new {
    @apply badge bg-green-500 text-white;
}

.badge-sale {
    @apply badge bg-red-500 text-white;
}

/* Status badges */
.status-pending {
    @apply badge bg-yellow-100 text-yellow-800;
}

.status-confirmed {
    @apply badge bg-blue-100 text-blue-800;
}

.status-shipped {
    @apply badge bg-purple-100 text-purple-800;
}

.status-delivered {
    @apply badge bg-green-100 text-green-800;
}

.status-cancelled {
    @apply badge bg-red-100 text-red-800;
}

/* Price formatting */
.price {
    @apply text-gem-sapphire font-bold;
}

.price-large {
    @apply price text-2xl;
}

.price-small {
    @apply price text-sm;
}

/* Hero section enhancements */
.hero-pattern {
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 2px, transparent 2px);
    background-size: 60px 60px;
}

/* Gem-like borders */
.border-gem {
    border: 2px solid;
    border-image: linear-gradient(45deg, var(--gem-sapphire), var(--gem-gold), var(--gem-ruby), var(--gem-emerald)) 1;
}

/* Glass morphism effect */
.glass {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.875rem;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Star rating styles */
.star-rating {
    display: flex;
    align-items: center;
    gap: 2px;
}

.star-rating i {
    color: var(--gem-gold);
    font-size: 1rem;
}

.star-rating .empty {
    color: #d1d5db;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 1rem;
    }
    
    .card-product {
        margin-bottom: 1.5rem;
    }
    
    .mobile-hidden {
        display: none;
    }
}

/* Mobile Filter Enhancements */
.mobile-filter-modal {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Touch-friendly filter inputs */
@media (max-width: 1024px) {
    .mobile-filter-modal input[type="radio"],
    .mobile-filter-modal input[type="checkbox"] {
        width: 1.25rem;
        height: 1.25rem;
        min-width: 1.25rem;
        min-height: 1.25rem;
    }
    
    .mobile-filter-modal label {
        min-height: 3.5rem;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: all 0.2s ease;
    }
    
    .mobile-filter-modal label:active {
        transform: scale(0.98);
        background-color: #f3f4f6 !important;
    }
    
    .mobile-filter-modal input[type="number"],
    .mobile-filter-modal select {
        min-height: 3rem;
        font-size: 1rem;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .mobile-filter-modal select {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
        background-position: right 0.75rem center;
        background-repeat: no-repeat;
        background-size: 1.5em 1.5em;
        padding-right: 2.5rem;
    }
    
    /* Filter button enhancements */
    #mobile-filter-btn {
        box-shadow: 0 8px 25px rgba(30, 64, 175, 0.3);
        touch-action: manipulation;
    }
    
    #mobile-filter-btn:active {
        transform: scale(0.95);
    }
    
    /* Modal animations */
    .mobile-filter-modal .absolute {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Smooth scroll for modal content */
    .mobile-filter-modal .overflow-y-auto {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* Enhanced focus states for accessibility */
    .mobile-filter-modal input:focus,
    .mobile-filter-modal select:focus {
        outline: none;
        ring-width: 2px;
        ring-color: #1e40af;
        ring-opacity: 0.5;
        border-color: #1e40af;
    }
    
    /* Button hover/active states */
    .mobile-filter-modal button {
        touch-action: manipulation;
        transition: all 0.2s ease;
    }
    
    .mobile-filter-modal button:active {
        transform: scale(0.98);
    }
    
    /* Filter count badge */
    #filter-count {
        animation: filter-badge-pop 0.3s ease-out;
    }
    
    @keyframes filter-badge-pop {
        0% {
            transform: scale(0);
            opacity: 0;
        }
        50% {
            transform: scale(1.2);
        }
        100% {
            transform: scale(1);
            opacity: 1;
        }
    }
    
    /* Safe area adjustments for newer devices */
    .mobile-filter-modal .absolute {
        bottom: env(safe-area-inset-bottom, 0);
    }
    
    /* Improved checkbox and radio styling */
    .mobile-filter-modal input[type="checkbox"]:checked,
    .mobile-filter-modal input[type="radio"]:checked {
        background-color: #1e40af;
        border-color: #1e40af;
    }
    
    .mobile-filter-modal input[type="checkbox"] {
        border-radius: 0.25rem;
    }
    
    .mobile-filter-modal input[type="radio"] {
        border-radius: 50%;
    }
    
    /* Haptic feedback simulation */
    .mobile-filter-modal label:active {
        animation: haptic-tap 0.1s ease;
    }
    
    @keyframes haptic-tap {
        0% { transform: scale(1); }
        50% { transform: scale(0.98); }
        100% { transform: scale(1); }
    }
}

/* Dark mode support for mobile filters */
@media (prefers-color-scheme: dark) and (max-width: 1024px) {
    .mobile-filter-modal .bg-white {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .mobile-filter-modal .border-gray-200 {
        border-color: #374151;
    }
    
    .mobile-filter-modal .text-gray-700 {
        color: #d1d5db;
    }
    
    .mobile-filter-modal .text-gray-800 {
        color: #f3f4f6;
    }
}

/* Improved scrollbar for mobile filter modal */
.mobile-filter-modal .overflow-y-auto::-webkit-scrollbar {
    width: 4px;
}

.mobile-filter-modal .overflow-y-auto::-webkit-scrollbar-track {
    background: transparent;
}

.mobile-filter-modal .overflow-y-auto::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 2px;
}

/* Pull-to-refresh indicator */
.mobile-filter-modal .pull-indicator {
    width: 3rem;
    height: 0.25rem;
    background-color: #d1d5db;
    border-radius: 0.125rem;
    margin: 0.5rem auto 1rem;
    transition: all 0.2s ease;
}

.mobile-filter-modal .pull-indicator.active {
    background-color: #1e40af;
    width: 4rem;
}

/* Product Page Improvements */
.aspect-w-4 {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 75%; /* 4:3 aspect ratio */
}

.aspect-h-3 {
    /* This class works in combination with aspect-w-4 */
}

.auto-rows-fr {
    grid-auto-rows: 1fr;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.min-h-14 {
    min-height: 3.5rem;
}

/* Product Card Enhancements */
.product-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

/* Badge Styles */
.badge-featured {
    background: linear-gradient(135deg, #d4af37, #f59e0b);
    box-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
}

.badge-bestseller {
    background: linear-gradient(135deg, #e11d48, #dc2626);
    box-shadow: 0 2px 4px rgba(225, 29, 72, 0.3);
}

/* Button Improvements */
.btn-view-details {
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    transition: all 0.2s ease;
}

.btn-view-details:hover {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    transform: translateY(-1px);
}

.btn-add-cart {
    background: linear-gradient(135deg, #d4af37, #f59e0b);
    transition: all 0.2s ease;
}

.btn-add-cart:hover {
    background: linear-gradient(135deg, #f59e0b, #d4af37);
    transform: translateY(-1px);
}

.btn-add-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Fast Mobile Menu Styles - No Delays */
#mobile-menu {
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: opacity 0.1s ease, visibility 0.1s ease;
    transform: translateZ(0);
    will-change: opacity;
}

#mobile-menu.hidden {
    opacity: 0;
    visibility: hidden;
}

#mobile-menu:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

/* Mobile Menu Content - Instant Display */
#mobile-menu-content {
    transition: transform 0.15s ease;
    transform: translateZ(0);
    will-change: transform;
}

#mobile-menu-content.translate-x-full {
    transform: translateX(100%);
}

#mobile-menu-content.translate-x-0 {
    transform: translateX(0);
}

/* Mobile Menu Items with Enhanced Interactions */
.mobile-menu-item {
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.mobile-menu-item:active {
    background-color: rgba(255, 255, 255, 0.15) !important;
    transform: scale(0.98);
}

/* Hover effect for menu items */
.mobile-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

/* Mobile Menu Icons with Smooth Transitions */
.mobile-menu-item i {
    transition: all 0.2s ease;
}

.mobile-menu-item:hover i {
    transform: scale(1.1);
}

/* Enhanced Icon Backgrounds */
.mobile-menu-item .w-10.h-10 {
    transition: all 0.2s ease;
}

.mobile-menu-item:hover .w-10.h-10 {
    background-color: rgba(212, 175, 55, 0.4) !important;
    transform: scale(1.05);
}

/* Section Headers */
.mobile-menu-item h3 {
    position: relative;
    display: inline-block;
}

.mobile-menu-item h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #d4af37, #f59e0b);
    transition: width 0.3s ease;
}

.mobile-menu-item:hover h3::after {
    width: 100%;
}

/* Enhanced Search Input */
#mobile-menu input[type="text"] {
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

#mobile-menu input[type="text"]:focus {
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.4);
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: #d4af37 !important;
    transform: scale(1.02);
}

/* Search Button Enhancement */
#mobile-menu button[type="submit"] {
    transition: all 0.2s ease;
}

#mobile-menu button[type="submit"]:hover {
    background-color: #f59e0b !important;
    transform: scale(1.05);
}

#mobile-menu button[type="submit"]:active {
    transform: scale(0.95);
}

/* Quick Action Cards */
.mobile-menu-item.bg-white\/10 {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-item.bg-white\/10:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Social Links Enhancement */
#mobile-menu .flex.justify-center.space-x-4 a {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

#mobile-menu .flex.justify-center.space-x-4 a:hover {
    background-color: #d4af37 !important;
    color: #1e40af !important;
    transform: translateY(-2px) rotate(5deg);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

#mobile-menu .flex.justify-center.space-x-4 a::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;
}

#mobile-menu .flex.justify-center.space-x-4 a:hover::before {
    left: 100%;
}

/* Contact Info Icons Enhancement */
.mobile-menu-item .w-8.h-8 {
    transition: all 0.2s ease;
}

.mobile-menu-item:hover .w-8.h-8 {
    background-color: rgba(212, 175, 55, 0.3) !important;
    transform: rotate(10deg) scale(1.1);
}

/* Mobile Menu Close Button */
#mobile-menu-close {
    transition: all 0.2s ease;
}

#mobile-menu-close:hover {
    background-color: rgba(255, 255, 255, 0.25) !important;
    transform: rotate(90deg) scale(1.1);
}

#mobile-menu-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* Mobile Menu Scrollbar */
#mobile-menu .overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

#mobile-menu .overflow-y-auto::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

#mobile-menu .overflow-y-auto::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.7);
    border-radius: 3px;
}

#mobile-menu .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.9);
}

/* Fast Hamburger Icon Animation */
#mobile-menu-toggle {
    transition: transform 0.1s ease;
}

#mobile-menu-toggle:active {
    transform: scale(0.95);
}

#mobile-menu-toggle i {
    transition: none;
    transform: translateZ(0);
}

/* Decorative Elements Animation */
#mobile-menu .absolute.inset-0.overflow-hidden div {
    animation: float 6s ease-in-out infinite;
}

#mobile-menu .absolute.inset-0.overflow-hidden div:nth-child(1) {
    animation-delay: 0s;
}

#mobile-menu .absolute.inset-0.overflow-hidden div:nth-child(2) {
    animation-delay: 2s;
}

#mobile-menu .absolute.inset-0.overflow-hidden div:nth-child(3) {
    animation-delay: 4s;
}

#mobile-menu .absolute.inset-0.overflow-hidden div:nth-child(4) {
    animation-delay: 1s;
}

/* Mobile Menu Animation Performance */
#mobile-menu * {
    will-change: transform;
    backface-visibility: hidden;
}

/* Stagger Animation for Menu Items */
@keyframes menuItemFadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mobile-menu-item {
    animation: menuItemFadeIn 0.3s ease forwards;
    opacity: 0;
}

/* Badge Styles in Menu */
#mobile-menu .bg-gem-ruby {
    animation: pulse 2s infinite;
}

#mobile-menu .bg-gem-gold\/20 {
    animation: gentleGlow 3s ease-in-out infinite;
}

/* Subcategory List Styles */
.mobile-menu-item .ml-12 {
    position: relative;
    overflow: hidden;
}

.mobile-menu-item .ml-12::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.3), rgba(212, 175, 55, 0.1));
}

.mobile-menu-item .ml-12 .mobile-menu-item {
    padding-left: 1rem;
    border-left: 1px solid rgba(212, 175, 55, 0.2);
    margin-left: 0.5rem;
}

.mobile-menu-item .ml-12 .mobile-menu-item:hover {
    border-left-color: rgba(212, 175, 55, 0.6);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Touch feedback improvements */
@media (hover: none) and (pointer: coarse) {
    .mobile-menu-item:hover {
        background-color: transparent;
        transform: none;
    }
    
    .mobile-menu-item:active {
        background-color: rgba(255, 255, 255, 0.2) !important;
        transform: scale(0.98);
    }
}

/* Ensure mobile menu button is always visible on mobile */
@media (max-width: 767px) {
    #mobile-menu-toggle {
        display: block !important;
        z-index: 9999;
        position: relative;
    }
    
    /* Hide desktop navigation on mobile */
    .hidden.md\\:flex {
        display: none !important;
    }
}

/* Mobile menu positioning fixes */
#mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
}

#mobile-menu-content {
    width: 100%;
    height: 100%;
}

/* Responsive text and spacing */
@media (max-width: 480px) {
    .mobile-menu-item {
        padding: 0.75rem 1rem;
    }
    
    .mobile-menu-item .w-10.h-10 {
        width: 2.25rem;
        height: 2.25rem;
        margin-right: 0.75rem;
    }
    
    #mobile-menu .text-xl {
        font-size: 1rem;
    }
    
    #mobile-menu .text-lg {
        font-size: 0.95rem;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }
    
    body {
        color: black;
        background: white;
    }
    
    a {
        text-decoration: underline;
        color: black;
    }
}

/* Dark mode support (for future implementation) */
@media (prefers-color-scheme: dark) {
    .dark-mode-support {
        background-color: #1f2937;
        color: #f9fafb;
    }
}

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

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--gem-sapphire);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 0;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn-primary {
        border: 2px solid #000;
    }
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Custom shadows for depth */
.shadow-gem {
    box-shadow: 0 4px 14px 0 rgba(30, 64, 175, 0.15);
}

.shadow-gem-lg {
    box-shadow: 0 10px 30px 0 rgba(30, 64, 175, 0.2);
}

/* Aspect ratio utilities for images */
.aspect-w-16 {
    position: relative;
    padding-bottom: calc(9 / 16 * 100%);
}

.aspect-w-16 > * {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

/* Custom transitions */
.transition-gem {
    transition: all var(--transition-duration) cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth scroll indicator */
html {
    scroll-padding-top: 100px;
}

/* Form validation styles */
.input-error {
    @apply border-red-500 focus:ring-red-500 focus:border-red-500;
}

.input-success {
    @apply border-green-500 focus:ring-green-500 focus:border-green-500;
}

/* Loading states */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid var(--gem-sapphire);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gem-sapphire);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--gem-gold);
    transform: translateY(-3px);
}

/* Image placeholder for missing images */
.image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #9ca3af;
    font-size: 1.5rem;
}

/* Custom utilities */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-shadow-lg {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Modern UI Enhancements */

/* Glassmorphism cards */
.glass-card {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, var(--gem-sapphire), var(--gem-ruby), var(--gem-emerald));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Advanced button styles */
.btn-modern {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-modern::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-modern:hover::before {
    left: 100%;
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-modern:active {
    transform: translateY(0);
}

/* Animated gradients */
.animated-gradient {
    background: linear-gradient(
        -45deg,
        var(--gem-sapphire),
        var(--gem-ruby),
        var(--gem-emerald),
        var(--gem-gold)
    );
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Morphing shapes */
.morph-shape {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: morph 8s ease-in-out infinite;
}

@keyframes morph {
    0% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
}

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

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

/* Micro-interactions */
.micro-bounce:hover {
    animation: micro-bounce 0.6s ease;
}

@keyframes micro-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.micro-wiggle:hover {
    animation: micro-wiggle 0.5s ease;
}

@keyframes micro-wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-3deg);
    }
    75% {
        transform: rotate(3deg);
    }
}

/* Advanced shadows and elevations */
.elevation-1 {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.elevation-2 {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
}

.elevation-3 {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
}

.elevation-4 {
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
}

.elevation-5 {
    box-shadow: 0 19px 38px rgba(0, 0, 0, 0.30), 0 15px 12px rgba(0, 0, 0, 0.22);
}

/* Geometric patterns */
.pattern-dots {
    background-image: radial-gradient(circle, rgba(30, 64, 175, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

.pattern-grid {
    background-image: 
        linear-gradient(rgba(30, 64, 175, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 64, 175, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Advanced hover effects */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-8px) rotate(1deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(30, 64, 175, 0.6);
    border-color: var(--gem-sapphire);
}

/* Staggered animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* Modern form elements */
.form-floating {
    position: relative;
}

.form-floating input {
    border: none;
    border-bottom: 2px solid #e5e7eb;
    border-radius: 0;
    background: transparent;
    padding: 12px 0 8px 0;
    transition: all 0.3s ease;
}

.form-floating input:focus {
    outline: none;
    border-bottom-color: var(--gem-sapphire);
}

.form-floating label {
    position: absolute;
    top: 12px;
    left: 0;
    font-size: 16px;
    color: #9ca3af;
    pointer-events: none;
    transition: all 0.3s ease;
}

.form-floating input:focus + label,
.form-floating input:not(:placeholder-shown) + label {
    top: -8px;
    font-size: 12px;
    color: var(--gem-sapphire);
    font-weight: 600;
}

/* Custom scrollbars enhanced */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #f1f5f9, #e2e8f0);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gem-sapphire), var(--gem-blue));
    border-radius: 10px;
    border: 2px solid #f1f5f9;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--gem-blue), var(--gem-ruby));
}

/* Responsive text sizing */
.text-responsive-xs {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
}

.text-responsive-sm {
    font-size: clamp(0.875rem, 2.5vw, 1rem);
}

.text-responsive-base {
    font-size: clamp(1rem, 3vw, 1.125rem);
}

.text-responsive-lg {
    font-size: clamp(1.125rem, 3.5vw, 1.25rem);
}

.text-responsive-xl {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
}

.text-responsive-2xl {
    font-size: clamp(1.5rem, 5vw, 2rem);
}

.text-responsive-3xl {
    font-size: clamp(1.875rem, 6vw, 2.5rem);
}

/* Enhanced accessibility */
.focus-visible:focus-visible {
    outline: 3px solid rgba(30, 64, 175, 0.5);
    outline-offset: 2px;
}

/* Dark mode support enhancement */
@media (prefers-color-scheme: dark) {
    .dark-support {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --border-color: #334155;
    }
    
    .dark-support body {
        background-color: var(--bg-primary);
        color: var(--text-primary);
    }
    
    .dark-support .card {
        background-color: var(--bg-secondary);
        border-color: var(--border-color);
    }
}

/* Performance optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-scroll {
    will-change: scroll-position;
}

.backface-hidden {
    backface-visibility: hidden;
}

.transform-gpu {
    transform: translateZ(0);
}

/* Container queries support */
@container (min-width: 768px) {
    .container-md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container (min-width: 1024px) {
    .container-lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Hierarchical Navigation Dropdown Styles */
.group\/sub:hover .group-hover\/sub\:opacity-100 {
    opacity: 1 !important;
}

.group\/sub:hover .group-hover\/sub\:visible {
    visibility: visible !important;
}

/* Fix for subcategories dropdown hover */
.relative.group\/sub:hover .gemstone-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure proper hover state for subcategory parent */
.group\/sub:hover > a {
    background-color: var(--gem-sapphire) !important;
    color: white !important;
}

/* Multi-level Navigation Support */
.nav-dropdown {
    min-width: 320px;
    max-height: 80vh;
    overflow-y: auto;
}

.nav-dropdown::-webkit-scrollbar {
    width: 6px;
}

.nav-dropdown::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.nav-dropdown::-webkit-scrollbar-thumb {
    background: var(--gem-sapphire);
    border-radius: 3px;
}

.nav-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--gem-blue);
}

/* Enhanced dropdown positioning */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 4px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 9999;
}

.dropdown-submenu:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

/* Gemstone Dropdown Scrolling Fixes */
.gemstone-dropdown {
    max-height: 300px;
    overflow-y: auto;
    z-index: 9999;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--gem-sapphire) #f1f5f9;
}

/* Navigation Dropdown Scrolling Enhancement */
.nav-dropdown {
    min-width: 320px;
    max-height: 400px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--gem-sapphire) #f1f5f9;
}

/* Subcategories Dropdown Scrolling */
.group-hover\/sub\:opacity-100 {
    max-height: 384px; /* max-h-96 equivalent */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--gem-sapphire) #f1f5f9;
}

/* Enhanced scrollbar for dropdowns */
.nav-dropdown::-webkit-scrollbar,
.gemstone-dropdown::-webkit-scrollbar,
.group-hover\/sub\:opacity-100::-webkit-scrollbar {
    width: 6px;
}

.nav-dropdown::-webkit-scrollbar-track,
.gemstone-dropdown::-webkit-scrollbar-track,
.group-hover\/sub\:opacity-100::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.nav-dropdown::-webkit-scrollbar-thumb,
.gemstone-dropdown::-webkit-scrollbar-thumb,
.group-hover\/sub\:opacity-100::-webkit-scrollbar-thumb {
    background: var(--gem-sapphire);
    border-radius: 3px;
    border: 1px solid #f1f5f9;
}

.nav-dropdown::-webkit-scrollbar-thumb:hover,
.gemstone-dropdown::-webkit-scrollbar-thumb:hover,
.group-hover\/sub\:opacity-100::-webkit-scrollbar-thumb:hover {
    background: var(--gem-blue);
}

/* Mobile dropdown scrolling improvements */
@media (max-width: 768px) {
    .gemstone-dropdown,
    .nav-dropdown {
        max-height: 250px;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* Touch-friendly scrollbar for mobile */
    .gemstone-dropdown::-webkit-scrollbar,
    .nav-dropdown::-webkit-scrollbar {
        width: 8px;
    }
    
    .gemstone-dropdown::-webkit-scrollbar-thumb,
    .nav-dropdown::-webkit-scrollbar-thumb {
        background: var(--gem-sapphire);
        border-radius: 4px;
        border: 2px solid #f1f5f9;
    }
}

/* Perfect Dropdown System - Complete Rewrite */

/* Main dropdown container */
.dropdown-main {
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--gem-sapphire) #f1f5f9;
}

/* Category item wrapper */
.category-item-wrapper {
    position: relative;
    display: block;
}

/* Main category link */
.category-main-link {
    display: flex;
    cursor: pointer;
    position: relative;
}

.category-main-link:hover {
    background-color: var(--gem-sapphire) !important;
    color: white !important;
}

.category-main-link:hover .subcategory-arrow {
    color: white !important;
}

/* Subcategory dropdown positioning and behavior */
.subcategory-dropdown {
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 8px;
    min-width: 220px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--gem-sapphire) #f1f5f9;
}

/* Show subcategory dropdown on parent hover */
.category-item-wrapper:hover .subcategory-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Keep dropdown visible when hovering over it */
.subcategory-dropdown:hover {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Subcategory links */
.subcategory-link {
    display: flex;
    width: 100%;
    cursor: pointer;
    text-decoration: none;
}

.subcategory-link:hover {
    background-color: var(--gem-sapphire) !important;
    color: white !important;
}

.subcategory-link:hover i {
    color: white !important;
}

/* Prevent dropdown from going off-screen on smaller screens */
@media (max-width: 1200px) {
    .subcategory-dropdown {
        left: -220px;
        margin-left: -8px;
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .dropdown-main {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        z-index: 999999;
        background: white;
        border-radius: 0;
        box-shadow: none;
    }
    
    .subcategory-dropdown {
        position: static;
        margin: 0;
        box-shadow: none;
        border: none;
        border-top: 1px solid #e5e7eb;
        background: #f9fafb;
    }
    
    .category-item-wrapper:hover .subcategory-dropdown {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

/* Scrollbar styling for dropdowns */
.dropdown-main::-webkit-scrollbar,
.subcategory-dropdown::-webkit-scrollbar {
    width: 6px;
}

.dropdown-main::-webkit-scrollbar-track,
.subcategory-dropdown::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.dropdown-main::-webkit-scrollbar-thumb,
.subcategory-dropdown::-webkit-scrollbar-thumb {
    background: var(--gem-sapphire);
    border-radius: 3px;
    border: 1px solid #f1f5f9;
}

.dropdown-main::-webkit-scrollbar-thumb:hover,
.subcategory-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--gem-blue);
}

/* Enhanced interaction states */
.category-main-link:active {
    transform: scale(0.98);
}

.subcategory-link:active {
    transform: scale(0.98);
}

/* Focus states for accessibility */
.category-main-link:focus,
.subcategory-link:focus {
    outline: 2px solid var(--gem-sapphire);
    outline-offset: 2px;
}

/* Loading state */
.dropdown-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #6b7280;
}

/* Empty state */
.dropdown-empty {
    padding: 20px;
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

/* Prevent dropdown from going off-screen */
@media (max-width: 1200px) {
    .dropdown-submenu .dropdown-menu {
        left: -100%;
        margin-left: -4px;
    }
}

/* Smooth animations for category dropdowns */
.category-dropdown {
    transform: translateY(-8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-dropdown.visible {
    transform: translateY(0);
}

/* Category item hover effects */
.category-item {
    position: relative;
    transition: all 0.2s ease;
}

.category-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--gem-sapphire);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.category-item:hover::before {
    transform: scaleY(1);
}

/* Enhanced Mobile Category Filters */
@media (max-width: 768px) {
    .mobile-category-item {
        transition: all 0.2s ease;
        border-radius: 8px;
    }
    
    .mobile-category-item:active {
        transform: scale(0.98);
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .mobile-subcategory-list {
        animation: slideDown 0.3s ease-out;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            max-height: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            max-height: 300px;
            transform: translateY(0);
        }
    }
    
    /* Enhanced category selection */
    .subcategory-list-mobile {
        transition: all 0.3s ease;
        overflow: hidden;
    }
    
    .subcategory-list-mobile.hidden {
        max-height: 0;
        opacity: 0;
    }
    
    .subcategory-list-mobile:not(.hidden) {
        max-height: 400px;
        opacity: 1;
    }
}

/* Desktop Category Filter Enhancements */
.subcategory-list {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.subcategory-list.hidden {
    max-height: 0;
    opacity: 0;
    transform: translateY(-10px);
}

.subcategory-list:not(.hidden) {
    max-height: 400px;
    opacity: 1;
    transform: translateY(0);
}

/* Category hover effects */
.category-main-radio:checked + i + span {
    color: var(--gem-sapphire);
    font-weight: 600;
}

.category-main-radio-mobile:checked + i + div span {
    color: white;
    font-weight: 700;
}

/* Smooth chevron rotations */
.fa-chevron-down {
    transition: transform 0.2s ease;
}

.rotate-180 {
    transform: rotate(180deg);
}

/* Enhanced filter section styling */
.filter-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
}

.filter-section:hover {
    border-color: var(--gem-sapphire);
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.1);
}

/* Product count badges */
.product-count-badge {
    background: var(--gem-sapphire);
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* Selected state animations */
@keyframes selectPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(30, 64, 175, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(30, 64, 175, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(30, 64, 175, 0);
    }
}

.category-selected {
    animation: selectPulse 0.6s ease-out;
}