/* Custom Styles & Animations */
body {
    font-family: 'Inter', sans-serif;
    background-color: #fffbeb; /* Light warm background */
    overflow-x: hidden;
}

h1, h2, h3, .brand-font {
    font-family: 'Playfair Display', serif;
}
.tamil-font { font-family: 'Mukta Malar', sans-serif; }

/* Global Loader */
#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fffbeb;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #3f2305;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    will-change: transform;
}
.spinner-sm {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3f2305;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Drawer Transition */
#drawer {
    transition: transform 0.3s ease-in-out;
    will-change: transform;
}

/* Toast Notification */
#toast-container {
    position: fixed;
    top: 20px;            /* Moved to top */
    left: 50%;            /* Center horizontally */
    transform: translateX(-50%); /* Center align */
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.toast {
    background: white;
    border-left: 4px solid #3f2305;
    padding: 16px;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    min-width: 250px;
    animation: slideDown 0.3s ease; /* Updated animation */
    display: flex;
    align-items: center;
    gap: 12px;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Glassmorphism for Modal */
.glass {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Modal Overlay Loader */
.modal-loader {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 60;
    border-radius: 1rem;
}

/* Horizontal Scroll Snap */
.scroll-snap-x {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.scroll-snap-center { scroll-snap-align: center; }

/* Quantity Controls */
.qty-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.qty-btn:active {
    transform: scale(0.95);
}

/* Sticky Cart Footer */
#sticky-cart-footer {
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease-in-out;
}

/* Performance Optimizations */
.product-card-opt {
    content-visibility: auto; /* Key performance property */
    contain-intrinsic-size: 350px; /* Approximate height of card */
}

.content-visibility-auto {
    content-visibility: auto;
}
