﻿/* Custom scrollbar for horizontal product lists */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Responsive Typography */
body {
    font-family: 'Inter', sans-serif;
    font-size: clamp(14px, 2vw, 16px);
}

/* Responsive Heading Sizes */
h1 {
    font-size: clamp(1.75rem, 5vw, 3rem);
}

h3 {
    font-size: clamp(0.875rem, 2vw, 1.125rem);
}

/* Fixed Filter/Sort Container */
.fixed-controls {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(249, 250, 251, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .fixed-controls {
        padding: 1rem 0;
        margin-bottom: 1.5rem;
    }
}

/* Desktop Dropdown animations */
.dropdown-hidden {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
    pointer-events: none;
}

.dropdown-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* Desktop Dropdown Styling */
@media (min-width: 768px) {
    .desktop-dropdown {
        min-width: 320px;
        max-height: 80vh;
        overflow-y: auto;
        padding: 1.5rem;
    }

        .desktop-dropdown::-webkit-scrollbar {
            width: 6px;
        }

        .desktop-dropdown::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 10px;
        }

        .desktop-dropdown::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 10px;
        }

            .desktop-dropdown::-webkit-scrollbar-thumb:hover {
                background: #94a3b8;
            }
}

/* Mobile Overlay/Popup */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 50;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .mobile-overlay.active {
        display: flex;
        opacity: 1;
    }

.mobile-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 1.5rem 1.5rem 0 0;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 51;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

    .mobile-popup.active {
        transform: translateY(0);
    }

.mobile-popup-header {
    position: sticky;
    top: 0;
    background: white;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.mobile-popup-content {
    padding: 1.25rem;
    padding-bottom: 2rem;
}

@media (max-width: 767px) {
    .desktop-dropdown {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .mobile-overlay,
    .mobile-popup {
        display: none !important;
    }
}

.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 gradient for hero section */
.hero-gradient {
    background: linear-gradient(to right, #6366F1, #8B5CF6);
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Container Padding */
.responsive-container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Responsive Button Sizing */
.btn-responsive {
    padding: clamp(0.5rem, 1vw, 0.5rem) clamp(1rem, 3vw, 1.5rem);
    font-size: clamp(0.875rem, 1.5vw, 1rem);
}

/* Responsive Input Fields */
.input-responsive {
    padding: clamp(0rem, 1vw, 0.5rem) clamp(0.75rem, 2vw, 1rem);
    font-size: clamp(0.875rem, 1.5vw, 1rem);
}

/* Responsive Product Card */
.product-card {
    border-radius: clamp(0.5rem, 1vw, 0.75rem);
}

/* Responsive Icon Sizing */
.icon-responsive {
    font-size: clamp(0.875rem, 1.5vw, 1rem);
}

/* Responsive Price Text */
.price-text {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
}

.star-rating {
    font-size: clamp(0.5rem, 1.5vw, 0.875rem);
}

/* Responsive Filter Tags */
.filter-tag {
    font-size: clamp(0.75rem, 1.5vw, 0.875rem);
    padding: clamp(0.25rem, 1vw, 0.375rem) clamp(0.5rem, 1.5vw, 0.75rem);
}

/* Responsive Product Grid Gap */
.product-grid {
    gap: clamp(0.3rem, 1.5vw, 1rem);
}

/* Smooth Transitions for Responsive Elements */
* {
    transition: font-size 0.2s ease, padding 0.2s ease, margin 0.2s ease;
}

/* Prevent body scroll when popup is open */
body.popup-open {
    overflow: hidden;
}

/* Close button styling */
.close-popup-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #4b5563;
    transition: all 0.2s;
}

    .close-popup-btn:hover {
        background: #e5e7eb;
        color: #1f2937;
    }

/* ===== ENHANCED WISHLIST AND CART BUTTON STYLES ===== */

/* Wishlist Button States */
button[data-product-wishlist] {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    /* Wishlist Button - Default/Inactive State */
    button[data-product-wishlist][data-in-wishlist="false"] {
        background-color: #e5e7eb;
        color: #374151;
    }

    /* Wishlist Button - Active State */
    button[data-product-wishlist][data-in-wishlist="true"] {
        background-color: #db2777;
        color: white;
    }

    /* Wishlist Button - Hover Effect when Inactive */
    button[data-product-wishlist][data-in-wishlist="false"]:hover:not(:disabled) {
        background-color: #fce7f3;
        color: #db2777;
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(219, 39, 119, 0.2);
    }

    /* Wishlist Button - Hover Effect when Active */
    button[data-product-wishlist][data-in-wishlist="true"]:hover:not(:disabled) {
        background-color: #be185d;
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(219, 39, 119, 0.4);
    }

/* Cart Button States */
button[data-product-cart] {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    /* Cart Button - Default/Inactive State */
    button[data-product-cart][data-in-cart="false"] {
        background-color: #e5e7eb;
        color: #374151;
    }

    /* Cart Button - Active State */
    button[data-product-cart][data-in-cart="true"] {
        background-color: #16a34a;
        color: white;
    }

    /* Cart Button - Hover Effect when Inactive */
    button[data-product-cart][data-in-cart="false"]:hover:not(:disabled) {
        background-color: #dcfce7;
        color: #16a34a;
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2);
    }

    /* Cart Button - Hover Effect when Active */
    button[data-product-cart][data-in-cart="true"]:hover:not(:disabled) {
        background-color: #15803d;
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4);
    }

    /* Disabled State for Both Buttons */
    button[data-product-wishlist]:disabled,
    button[data-product-cart]:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

/* Ripple Effect Animation */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Add ripple effect on click */
button[data-product-wishlist]::after,
button[data-product-cart]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 50%;
    transform: scale(1);
    transition: opacity 0.5s, transform 0.5s;
}

button[data-product-wishlist]:active::after,
button[data-product-cart]:active::after {
    animation: ripple 0.6s ease-out;
}

/* Toast notification animations */
@keyframes slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-out-right {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.animate-slide-in-right {
    animation: slide-in-right 0.3s ease-out;
}

.animate-slide-out-right {
    animation: slide-out-right 0.3s ease-in;
}

/* Icon pulse animation for active states */
@keyframes pulse-icon {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

button[data-product-wishlist][data-in-wishlist="true"] i,
button[data-product-cart][data-in-cart="true"] i {
    animation: pulse-icon 0.3s ease-in-out;
}
