/* Global Styles */
:root {
    /* Timing variables */
    --transition-speed: 0.3s;
    --transition-speed-fast: 0.2s;
    --transition-speed-slow: 0.5s;
    --page-transition: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Modern color palette */
    --primary-color: #5a67d8;
    --primary-hover: #4c51bf;
    --primary-light: #ebf4ff;
    --primary-dark: #434190;
    --accent-color: #ed64a6;
    --accent-hover: #d53f8c;
    --accent-light: #fed7e2;
    
    /* Gray shades */
    --gray-100: #f7fafc;
    --gray-200: #edf2f7;
    --gray-300: #e2e8f0;
    --gray-400: #cbd5e0;
    --gray-500: #a0aec0;
    --gray-600: #718096;
    --gray-700: #4a5568;
    --gray-800: #2d3748;
    --gray-900: #1a202c;
    
    /* Functional colors */
    --light-bg: var(--gray-100);
    --dark-text: var(--gray-900);
    --muted-text: var(--gray-600);
    --success-color: #48bb78;
    --warning-color: #ecc94b;
    --danger-color: #f56565;
    --info-color: #4299e1;
    
    /* Border and shadow */
    --border-radius-sm: 0.25rem;
    --border-radius: 0.5rem;
    --border-radius-lg: 1rem;
    --border-radius-xl: 1.5rem;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--dark-text);
    overflow-x: hidden;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--gray-100);
    line-height: 1.6;
}

main {
    flex: 1;
    padding-bottom: var(--spacing-2xl);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

h1 {
    font-size: 2.5rem;
    letter-spacing: -0.025em;
}

h2 {
    font-size: 2rem;
    letter-spacing: -0.025em;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1rem;
}

.text-gradient {
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Button Hover Effects */
.btn {
    transition: all var(--transition-speed);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Card Hover Effect */
.hover-lift {
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    position: relative;
    z-index: 1;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md) !important;
}

.hover-lift::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background-color: rgba(var(--primary-color), 0.03);
    z-index: -1;
    transition: height 0.3s ease;
}

.hover-lift:hover::after {
    height: 100%;
}

/* Product Cards */
.product-card {
    transition: all var(--transition-speed);
    border: none;
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.product-card .card-body {
    transition: background-color 0.3s ease;
}

.product-card:hover .card-body {
    background-color: var(--primary-light);
}

.product-image {
    height: 250px;
    object-fit: cover;
    transition: all 0.5s ease;
}

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

/* Wishlist Button */
.wishlist-btn {
    z-index: 10;
    width: 35px;
    height: 35px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.3);
    border: none;
    transition: all 0.2s ease;
}

.wishlist-btn:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.wishlist-btn.active {
    background-color: rgba(255, 255, 255, 0.7);
}

.wishlist-item {
    transition: all 0.3s ease;
}

.wishlist-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Cart */
.cart-item {
    transition: background-color var(--transition-speed);
}

.cart-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Loading Animations */
.loading {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

.loading-sm {
    width: 30px;
    height: 30px;
    border-width: 2px;
}

.loading-lg {
    width: 70px;
    height: 70px;
    border-width: 4px;
}

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: calc(50% - 8px);
    left: calc(50% - 8px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* Dot Loading */
.loading-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 2px;
    opacity: 0;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes dotPulse {
    0%, 100% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Skeleton Loading */
.skeleton {
    display: inline-block;
    position: relative;
    overflow: hidden;
    background-color: #EAEAEA;
    border-radius: 4px;
}

.skeleton::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.2) 20%,
        rgba(255, 255, 255, 0.5) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 2s infinite;
    content: '';
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Grid/List View Transitions */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    transition: all var(--transition-speed);
}

.products-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.products-list .product-card {
    display: flex;
    flex-direction: row;
}

.products-list .product-image {
    width: 200px;
    height: 200px;
}

/* Form Styles */
.form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .products-list .product-card {
        flex-direction: column;
    }

    .products-list .product-image {
        width: 100%;
    }
}

/* Hero Section */
.hero {
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, var(--bs-primary) 0%, transparent 100%);
    opacity: 0.1;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-in-right {
    animation: slideInRight 0.5s var(--page-transition);
}

.slide-in-left {
    animation: slideInLeft 0.5s var(--page-transition);
}

.slide-in-up {
    animation: slideInUp 0.4s var(--page-transition);
}

.slide-in-down {
    animation: slideInDown 0.4s var(--page-transition);
}

.pulse {
    animation: pulse 2s infinite;
}

.zoom-in {
    animation: zoomIn 0.5s var(--page-transition);
}

.bounce {
    animation: bounce 0.5s var(--page-transition);
}

/* Animation Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

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

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

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Carousel Banner Styles */
.carousel-banner {
    height: 500px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.banner-1 {
    background: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)), url('https://images.unsplash.com/photo-1445205170230-053b83016050?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
}

.banner-2 {
    background: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)), url('https://images.unsplash.com/photo-1483985988355-763728e1935b?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
}

.banner-3 {
    background: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)), url('https://images.unsplash.com/photo-1441984904996-e0b6ba687e04?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
}

.banner-content {
    max-width: 600px;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 25px;
}

/* Wishlist Button */
.wishlist-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    transition: all 0.3s ease;
    z-index: 5;
}

.wishlist-btn:hover {
    background-color: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.wishlist-btn.active {
    background-color: rgba(255, 230, 230, 0.9);
}

.wishlist-btn.active i {
    color: var(--bs-danger);
}

.wishlist-item {
    transition: all 0.3s ease;
}

.wishlist-item:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background: white;
    color: var(--dark-text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary-color);
}

/* Category Cards */
.category-image {
    position: relative;
    overflow: hidden;
}

.overlay-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.3), rgba(0,0,0,0));
    z-index: 1;
}

.card.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Product Card Styles */
.product-card {
    position: relative;
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-actions {
    width: 80%;
}

/* Loyalty Styles */
.loyalty-card {
    background: linear-gradient(45deg, #f8f8f8, #f0f0f0);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 1px solid #e5e5e5;
    transition: all 0.3s ease;
}

.loyalty-card.bronze {
    background: linear-gradient(45deg, #e6c9a8, #d7b594);
    border-color: #c9a982;
}

.loyalty-card.silver {
    background: linear-gradient(45deg, #e0e0e0, #c0c0c0);
    border-color: #a9a9a9;
}

.loyalty-card.gold {
    background: linear-gradient(45deg, #ffd700, #d4af37);
    border-color: #b8860b;
}

.loyalty-card.platinum {
    background: linear-gradient(45deg, #e5e4e2, #c9c8c7);
    border-color: #a8a8a8;
}

.loyalty-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.8);
}

.loyalty-progress-container {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    overflow: hidden;
}

.loyalty-progress-bar {
    height: 100%;
    background-color: #4a6cf7;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.bronze .loyalty-progress-bar {
    background-color: #cd7f32;
}

.silver .loyalty-progress-bar {
    background-color: #c0c0c0;
}

.gold .loyalty-progress-bar {
    background-color: #ffd700;
}

.platinum .loyalty-progress-bar {
    background-color: #b9f2ff;
}

.text-bronze {
    color: #cd7f32 !important;
}

.text-silver {
    color: #c0c0c0 !important;
}

.text-gold {
    color: #ffd700 !important;
}

.text-platinum {
    color: #b9f2ff !important;
}

/* Promotional Banner */
.promo-banner-large .promo-image {
    transition: transform 0.6s ease;
}

.promo-banner-large:hover .promo-image {
    transform: scale(1.05);
}
