body {
    font-family: 'IS', sans-serif;
    background-color: #f8fafc;
    color: #0f172a;
    overflow-x: hidden;
}

.glass-nav {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.bento-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid #e2e8f0;
    position: relative;
}
.bento-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.12);
    border-color: #3b82f6;
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    border-radius: 24px;
}

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

.feature-card {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

.animate-gradient {
    background-size: 200% 200%;
    animation: gradientMove 6s ease infinite;
}

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

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

.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 24px; height: 24px; }

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

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

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Focus styles */
input:focus,
button:focus,
a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Animation for search input */
#search-input:focus {
    transform: scale(1.01);
    transition: transform 0.2s ease;
}

/* Pulse animation for status indicator */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0);
    }
}

/* Mobile optimizations */
@media (max-width: 640px) {
    /* Ensure touch targets are at least 44x44px */
    button, a, input, select, textarea {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Prevent text size adjustment on iOS */
    input, select, textarea, button {
        font-size: 16px !important;
    }
    
    /* Better spacing for mobile */
    .bento-card {
        padding: 1.25rem;
    }
    
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* Better button spacing */
    button {
        padding: 0.625rem 1rem;
    }
}

/* Touch manipulation for better mobile performance */
.touch-manipulation {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Prevent zoom on input focus (iOS) */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Smooth transitions for mobile */
@media (prefers-reduced-motion: no-preference) {
    * {
        transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Better focus states for mobile */
@media (max-width: 768px) {
    button:focus,
    a:focus,
    input:focus {
        outline: 2px solid #3b82f6;
        outline-offset: 2px;
    }
}

/* Mobile Offcanvas Menu Styles */
#mobile-menu-overlay {
    will-change: opacity;
    pointer-events: none;
}

#mobile-menu-overlay:not(.hidden) {
    pointer-events: auto;
}

#mobile-menu {
    will-change: transform;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Ensure menu is positioned correctly in RTL */
    right: 0;
    left: auto;
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Smooth transitions for offcanvas */
#mobile-menu {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu-overlay {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure menu items are touch-friendly */
#mobile-menu a,
#mobile-menu button {
    min-height: 44px;
    display: flex;
    align-items: center;
}

/* Debug: Make sure menu is visible when open */
#mobile-menu:not(.translate-x-full) {
    transform: translateX(0) !important;
}

/* Mobile Bottom Navigation Bar */
@media (max-width: 768px) {
    /* Add padding to body to prevent content from being hidden behind bottom nav */
    body {
        padding-bottom: 70px;
    }
    
    /* Safe area for devices with notches */
    .safe-area-inset-bottom {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Bottom navigation bar styles */
nav.fixed.bottom-0 {
    box-shadow: 0 -4px 20px -2px rgba(0, 0, 0, 0.1);
}

/* Active state for bottom nav items */
nav.fixed.bottom-0 a.bottom-nav-link.active {
    color: #2563eb;
    background-color: rgba(59, 130, 246, 0.1);
}

nav.fixed.bottom-0 a.bottom-nav-link.active .w-6 {
    color: #2563eb;
}

nav.fixed.bottom-0 a.bottom-nav-link.active i {
    color: #2563eb;
}

/* Hover effect for bottom nav */
nav.fixed.bottom-0 a:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Account Modal Styles */
#account-modal-overlay {
    will-change: opacity;
    pointer-events: none;
}

#account-modal-overlay:not(.hidden) {
    pointer-events: auto;
}

#account-modal {
    pointer-events: none;
}

#account-modal:not(.hidden) {
    pointer-events: auto;
}

#account-modal .bg-white {
    will-change: transform;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Phone input styling */
#phone-number {
    direction: ltr;
    text-align: right;
}

#phone-number::placeholder {
    direction: rtl;
    text-align: right;
}

/* Checkbox styling */
input[type="checkbox"] {
    accent-color: #2563eb;
    cursor: pointer;
}

/* Form validation */
#account-form input:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

#account-form input:valid:not(:placeholder-shown) {
    border-color: #10b981;
}

/* Captcha Canvas Styles */
#captcha-canvas {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    background: #f0f9ff;
}

/* Explore Page Styles */
.explore-card {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform, opacity;
}

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

/* Hide scrollbar for category filters */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Filter button transitions */
.filter-btn {
    transition: all 0.2s ease;
}

/* Smooth card animations */
.explore-card {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.explore-card[style*="display: none"] {
    opacity: 0;
    transform: translateY(20px);
}

/* Swiper Custom Styles */
.products-swiper {
    padding: 10px 50px 40px !important;
}

.products-swiper .swiper-button-next,
.products-swiper .swiper-button-prev {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #3b82f6;
    transition: all 0.3s ease;
}

.products-swiper .swiper-button-next:hover,
.products-swiper .swiper-button-prev:hover {
    background: #3b82f6;
    color: white;
    transform: scale(1.1);
}

.products-swiper .swiper-button-next::after,
.products-swiper .swiper-button-prev::after {
    font-size: 18px;
    font-weight: bold;
}

.products-swiper .swiper-button-next {
    right: 0;
}

.products-swiper .swiper-button-prev {
    left: 0;
}

/* RTL Support for Swiper */
[dir="rtl"] .products-swiper .swiper-button-next {
    left: 0;
    right: auto;
}

[dir="rtl"] .products-swiper .swiper-button-prev {
    right: 0;
    left: auto;
}

/* News Linear Layout */
.news-item {
    transition: all 0.3s ease;
}

.news-item:hover {
    transform: translateX(-4px);
}

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

/* Mobile Swiper Adjustments */
@media (max-width: 640px) {
    .products-swiper {
        padding: 10px 0 40px !important;
    }
    
    .products-swiper .swiper-button-next,
    .products-swiper .swiper-button-prev {
        display: none;
    }
    
    .news-item {
        padding: 1rem !important;
    }
    
    .news-item .flex {
        gap: 1rem !important;
    }
}

/* Product Card Height Fix */
.product-card {
    display: flex;
    flex-direction: column;
}

.product-card > div:last-child {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
