/* ========================================
   CUSTOM.CSS - Additional styles for MyStore
   Tailwind CSS v4 Companion Stylesheet
   ======================================== */

/* ----------------------------------------
   1. CSS Variables (Custom Properties)
   ---------------------------------------- */
:root {
    /* Brand Colors - extend Tailwind's palette */
    --color-brand-primary: #3b82f6;      /* blue-500 */
    --color-brand-secondary: #8b5cf6;    /* purple-500 */
    --color-brand-accent: #f59e0b;        /* amber-500 */
    
    /* Spacing extensions */
    --section-spacing: 5rem;
    --card-spacing: 1.5rem;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

/* ----------------------------------------
   2. Custom Font Faces (if needed)
   ---------------------------------------- */
@font-face {
    font-family: 'YourBrandFont';
    src: url('/market/fonts/your-font.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ----------------------------------------
   3. Global Overrides
   ---------------------------------------- */
html {
    scroll-behavior: smooth;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #2563eb; /* blue-600 */
}

/* Selection styling */
::selection {
    background: var(--color-brand-primary);
    color: white;
}

/* ----------------------------------------
   4. Typography Enhancements
   ---------------------------------------- */
/* Headline with gradient (can't be done with Tailwind utilities alone) */
.gradient-headline {
    background: linear-gradient(135deg, var(--color-brand-primary), var(--color-brand-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* Fancy dropcap for product descriptions */
.dropcap::first-letter {
    font-size: 3.5em;
    float: left;
    line-height: 0.8;
    margin-right: 0.5rem;
    color: var(--color-brand-primary);
    font-weight: bold;
}

/* ----------------------------------------
   5. Complex Component Styles
   ---------------------------------------- */
/* Product card hover effect */
.product-card {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

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

/* Custom image overlay gradient */
.image-overlay {
    position: relative;
}

.image-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
}

/* Animated underline for navigation */
.nav-underline {
    position: relative;
}

.nav-underline::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-brand-primary);
    transition: width var(--transition-normal);
}

.nav-underline:hover::after {
    width: 100%;
}

/* ----------------------------------------
   6. Ecommerce-Specific Components
   ---------------------------------------- */
/* Product badge (sale, new, etc.) */
.product-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 10;
}

.product-badge.sale {
    background: #ef4444; /* red-500 */
    color: white;
}

.product-badge.new {
    background: #10b981; /* emerald-500 */
    color: white;
}

/* Quantity selector for cart */
.quantity-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e5e7eb; /* gray-200 */
    border-radius: 0.375rem;
    overflow: hidden;
}

.quantity-selector button {
    padding: 0.5rem 1rem;
    background: #f9fafb; /* gray-50 */
    border: none;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.quantity-selector button:hover {
    background: #f3f4f6; /* gray-100 */
}

.quantity-selector input {
    width: 3rem;
    text-align: center;
    border: none;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    padding: 0.5rem 0;
}

/* Rating stars */
.rating-stars {
    display: inline-flex;
    gap: 0.125rem;
}

.rating-stars .star {
    color: #d1d5db; /* gray-300 */
}

.rating-stars .star.filled {
    color: #fbbf24; /* amber-400 */
}

/* ----------------------------------------
   7. Animations & Keyframes
   ---------------------------------------- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn var(--transition-normal);
}

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

.pulse-slow {
    animation: pulse 2s ease-in-out infinite;
}

/* ----------------------------------------
   8. Loading States & Skeleton Screens
   ---------------------------------------- */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ----------------------------------------
   9. Responsive Overrides (for complex layouts)
   ---------------------------------------- */
@media (max-width: 640px) {
    :root {
        --section-spacing: 3rem;
    }
    
    .gradient-headline {
        font-size: 2rem !important; /* Force smaller size on mobile */
    }
}

@media (min-width: 1536px) {
    /* 2xl screens - extra large displays */
    .container-custom {
        max-width: 1440px;
        margin: 0 auto;
    }
}

/* ----------------------------------------
   10. Print Styles
   ---------------------------------------- */
@media print {
    .no-print {
        display: none !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
}