/* public/css/custom.css */

/* ============================================
   GLOBAL STYLES
   ============================================ */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --border-radius: 12px;
    --box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   PRELOADER
   ============================================ */

.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   3D CARDS
   ============================================ */

.product-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: var(--transition);
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-10px) rotateX(5deg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.product-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1) translateZ(20px);
}

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;
}

.badge-sale {
    background: var(--danger-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.3);
}

.product-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transform: translateX(20px);
    transition: var(--transition);
    z-index: 2;
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}

.action-btn {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: var(--transition);
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1) rotate(5deg);
}

.product-info {
    padding: 20px;
    transform: translateZ(10px);
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.product-title a {
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
}

.product-title a:hover {
    color: var(--primary-color);
}

.product-price {
    margin-bottom: 15px;
}

.current-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.old-price {
    font-size: 0.9rem;
    color: #999;
    text-decoration: line-through;
    margin-left: 8px;
}

.discount-badge {
    background: var(--success-color);
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
}

.stars {
    color: #ffc107;
    font-size: 0.9rem;
}

.rating-count {
    color: #666;
    font-size: 0.85rem;
}

.add-to-cart-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    transform: translateZ(5px);
}

.add-to-cart-btn:hover {
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

/* ============================================
   GLASSMORPHISM EFFECTS
   ============================================ */

.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 30px;
    transition: var(--transition);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
}

.glass-navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

/* ============================================
   MEGA MENU
   ============================================ */

.mega-menu {
    width: 800px;
    padding: 20px;
    border: none;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mega-menu-category h6 {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.mega-menu-category ul {
    list-style: none;
    padding: 0;
}

.mega-menu-category ul li {
    margin-bottom: 8px;
}

.mega-menu-category ul li a {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    display: inline-block;
}

.mega-menu-category ul li a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 30px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translate3d(-30px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translate3d(30px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease;
}

.fade-in-left {
    animation: fadeInLeft 0.6s ease;
}

.fade-in-right {
    animation: fadeInRight 0.6s ease;
}

.scale-in {
    animation: scaleIn 0.5s ease;
}

.rotate-in {
    animation: rotateIn 0.6s ease;
}

/* Hover Animations */
.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
}

.hover-scale {
    transition: var(--transition);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: var(--transition);
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* ============================================
   BUTTON ANIMATIONS
   ============================================ */

.btn {
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    position: relative;
    z-index: 1;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.btn-primary:hover::after {
    opacity: 1;
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ============================================
   LOADING ANIMATIONS
   ============================================ */

.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;
    }
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 3px;
}

/* Pulse Loader */
.pulse-loader {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.pulse-loader span {
    width: 15px;
    height: 15px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: pulse 1.4s ease-in-out infinite;
}

.pulse-loader span:nth-child(2) {
    animation-delay: 0.2s;
}

.pulse-loader span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.5;
    }
}

/* ============================================
   CART SIDEBAR
   ============================================ */

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 30px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1050;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1040;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
}

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f3f4f6;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 10px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f9fafb;
    border-radius: 20px;
    padding: 2px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: white;
    color: var(--dark-color);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.quantity-btn:hover {
    background: var(--primary-color);
    color: white;
}

.quantity-input {
    width: 40px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 600;
}

/* ============================================
   PRODUCT QUICK VIEW MODAL
   ============================================ */

.modal-content {
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid #f3f4f6;
    padding: 20px;
}

.modal-body {
    padding: 30px;
}

.quick-view-image {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.quick-view-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.quick-view-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.quick-view-description {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.8;
}

.quick-view-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.quick-view-actions .btn {
    flex: 1;
    padding: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 992px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .mega-menu {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .hero-slide {
        height: 500px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .product-card:hover {
        transform: translateY(-5px);
    }
    
    .feature-card {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-slide {
        height: 400px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-btn {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
    
    .category-card {
        padding: 1.5rem 0.5rem;
    }
    
    .category-icon {
        width: 60px;
        height: 60px;
    }
    
    .countdown-timer {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .timer-item {
        min-width: 60px;
        padding: 10px;
    }
    
    .timer-item span:first-child {
        font-size: 1.5rem;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.shadow-3d {
    box-shadow: 
        0 10px 30px rgba(0,0,0,0.1),
        0 1px 8px rgba(0,0,0,0.2);
    transition: var(--transition);
}

.shadow-3d:hover {
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.15),
        0 5px 15px rgba(0,0,0,0.2);
    transform: translateY(-5px);
}

.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, var(--primary-color), var(--secondary-color)) border-box;
}

.rounded-xl {
    border-radius: 20px;
}

.rounded-2xl {
    border-radius: 30px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .cart-sidebar,
    .mobile-menu {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .container {
        width: 100%;
        max-width: none;
    }
}