/* ══════════════════════════════════════════════════════════════
   GadgetHaven Design System v5 — UI/UX Pro Max Enhanced
   Style: Vibrant & Block-based with Bento Grid accents
   Checklist: cursor-pointer, hover 200-300ms, focus states,
              text contrast 4.5:1, prefers-reduced-motion, responsive
   ══════════════════════════════════════════════════════════════ */

/* ===== 1. CSS DESIGN SYSTEM (Variables & Roots) ===== */
:root {
    --brand-main: #7c3aed;
    --brand-dark: #4c1d95;
    --brand-light: #ede9fe;
    --accent-main: #f97316;
    --accent-glow: rgba(249, 115, 22, 0.5);
    --surface-light: #fafafa;
    --surface-white: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-light: rgba(0, 0, 0, 0.06);
    --border-brand: rgba(124, 58, 237, 0.3);

    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;

    --shadow-base: 0 4px 20px -2px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 20px 40px -4px rgba(0, 0, 0, 0.1), 0 8px 16px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    --spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

    --section-gap: 5rem;
    --block-gap: 3rem;
}

/* ===== 2. BASE & TYPOGRAPHY ===== */
html {
    scroll-behavior: smooth;
    background-color: var(--surface-white);
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

::selection {
    background: var(--brand-main);
    color: #ffffff;
}

/* ===== 3. CURSOR POINTER (Checklist) ===== */
a, button, [role="button"], summary, label,
input[type="submit"], input[type="button"],
select, .snipcart-checkout, .snipcart-add-item {
    cursor: pointer;
}

/* ===== 4. FOCUS STATES (Checklist — keyboard nav visible) ===== */
*:focus-visible {
    outline: 2px solid var(--brand-main);
    outline-offset: 3px;
    border-radius: 2px;
}

a:focus-visible, button:focus-visible {
    outline: 3px solid var(--accent-main);
    outline-offset: 4px;
    border-radius: 4px;
}

/* ===== 5. NAVIGATION (Glassmorphism) ===== */
nav {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
    transition: all 0.25s var(--ease-smooth);
}

nav.nav-scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.06);
}

/* ===== 6. PRODUCT CARDS (Bold hover + smooth transition) ===== */
.product-card {
    background: var(--surface-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-base);
    transition: transform 0.25s var(--ease-smooth),
                box-shadow 0.25s var(--ease-smooth),
                border-color 0.25s var(--ease-smooth);
    will-change: transform;
    animation: fadeInUp 0.5s ease-out both;
    animation-play-state: paused;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-brand);
}

.product-card img {
    transition: transform 0.35s var(--ease-out);
}

.product-card:hover img {
    transform: scale(1.06);
}

/* ===== 7. BUTTONS & CTAs (Bold hover — color shift) ===== */
a.bg-accent-500,
button.snipcart-add-item,
button[type="submit"],
.snipcart-checkout {
    position: relative;
    overflow: hidden;
    transition: all 0.2s var(--ease-smooth);
}

.snipcart-add-item:hover,
button[type="submit"]:hover,
.snipcart-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.35);
}

.snipcart-add-item:active,
button[type="submit"]:active {
    transform: scale(0.96);
}

/* Ripple effect on click */
.snipcart-add-item::after,
.snipcart-checkout::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.snipcart-add-item:active::after,
.snipcart-checkout:active::after {
    opacity: 1;
    transition: opacity 0s;
}

/* ===== 8. FAQ ACCORDION ===== */
details {
    transition: all 0.25s var(--ease-smooth);
}

details:hover {
    border-color: var(--border-brand);
}

details[open] {
    border-color: var(--border-brand);
    background: white;
}

details summary::-webkit-details-marker {
    display: none;
}

details[open] summary {
    margin-bottom: 0.5rem;
    color: var(--brand-main);
}

details summary svg {
    transition: transform 0.25s var(--ease-smooth);
}

/* ===== 9. SNIPCART CUSTOMIZATION ===== */
.snipcart-cart-header {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand-main)) !important;
}

.snipcart-cart-button--highlight {
    background: var(--accent-main) !important;
    background-image: linear-gradient(135deg, #f97316, #ea580c) !important;
    border-radius: var(--radius-md) !important;
    transition: all 0.2s var(--ease-smooth) !important;
}

.snipcart-cart-button--highlight:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(234, 88, 12, 0.4) !important;
}

/* ===== 10. FOOTER ===== */
footer a {
    transition: color 0.2s var(--ease-smooth);
}
footer a:hover {
    color: var(--brand-main) !important;
}

/* ===== 11. STAGGERED LOAD ANIMATIONS ===== */
#product-grid .product-card:nth-child(1) { animation-delay: 0.05s; }
#product-grid .product-card:nth-child(2) { animation-delay: 0.1s; }
#product-grid .product-card:nth-child(3) { animation-delay: 0.15s; }
#product-grid .product-card:nth-child(4) { animation-delay: 0.2s; }
#product-grid .product-card:nth-child(5) { animation-delay: 0.25s; }
#product-grid .product-card:nth-child(6) { animation-delay: 0.3s; }
#product-grid .product-card:nth-child(7) { animation-delay: 0.35s; }
#product-grid .product-card:nth-child(8) { animation-delay: 0.4s; }

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

/* ===== 12. TOAST NOTIFICATION ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--brand-dark);
    color: white;
    padding: 0.875rem 1.75rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 10px 40px rgba(76, 29, 149, 0.3);
    z-index: 9999;
    opacity: 0;
    transition: all 0.35s var(--spring);
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== 13. RESPONSIVE (Checklist — 375/768/1024/1440) ===== */
@media (max-width: 640px) {
    .product-card {
        animation-delay: 0.05s !important;
    }

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

@media (min-width: 1024px) {
    .product-card:hover {
        transform: translateY(-8px);
    }
}

/* ===== 14. ACCESSIBILITY (Checklist — reduced motion) ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== 15. HERO IMAGE FLOAT ===== */
.float-anim {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* ===== 16. STICKY MOBILE CTA ===== */
.sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    transform: translateY(100%);
    transition: transform 0.25s var(--ease-smooth);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
}

.sticky-cta.visible {
    transform: translateY(0);
}

@media (min-width: 641px) {
    .sticky-cta {
        display: none !important;
    }
}

/* ===== 17. VALUE CARDS (About page) ===== */
.value-card:hover .value-icon {
    transform: scale(1.15) rotate(-3deg);
}

.value-icon {
    transition: transform 0.25s var(--spring);
}

/* ===== 18. BENEFIT CARDS (Landing pages) ===== */
.benefit-card:hover .benefit-icon {
    transform: scale(1.15);
}

.benefit-icon {
    transition: transform 0.25s var(--spring);
}

/* ===== 19. GRADIENT TEXT ===== */
.gradient-text {
    background: linear-gradient(135deg, #a78bfa, #f97316, #f472b6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===== 20. LINE CLAMP UTILITY ===== */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════
   UI/UX PRO MAX ADDITIONS — Vibrant & Block-based
   ══════════════════════════════════════════════════════════════ */

/* ===== 21. SECTION GAPS (48px+ for Vibrant style) ===== */
section + section {
    padding-top: var(--section-gap);
    padding-bottom: var(--section-gap);
}

@media (max-width: 768px) {
    :root {
        --section-gap: 3rem;
        --block-gap: 2rem;
    }
}

/* ===== 22. ANIMATED BACKGROUND PATTERN ===== */
.bg-pattern-dots {
    background-image: radial-gradient(circle, rgba(124, 58, 237, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
}

.bg-pattern-grid {
    background-image:
        linear-gradient(rgba(124, 58, 237, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* ===== 23. SCROLL-SNAP (Mobile product sections) ===== */
@media (max-width: 768px) {
    .scroll-snap-x {
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .scroll-snap-x > * {
        scroll-snap-align: start;
    }
}

/* ===== 24. BENTO GRID STYLE (Feature cards) ===== */
.bento-card {
    border-radius: var(--radius-lg);
    background: var(--surface-white);
    border: 1px solid var(--border-light);
    transition: all 0.25s var(--ease-smooth);
    box-shadow: var(--shadow-base);
    opacity: 1; /* fallback — JS sets to 0 when IntersectionObserver available */
    transform: none; /* fallback */
}

.bento-card:hover {
    border-color: var(--border-brand);
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

/* ===== 25. PILL BADGE ===== */
.pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== 26. GLOW RING ON HOVER ===== */
.glow-hover {
    transition: box-shadow 0.25s var(--ease-smooth);
}

.glow-hover:hover {
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
}

/* ===== 27. TEXT CONTRAST (Checklist — 4.5:1 minimum) ===== */
.text-on-brand {
    color: #ffffff; /* white on #7c3aed = 6.3:1 ✓ */
}

.text-muted-safe {
    color: #6b7280; /* on white = 5.2:1 ✓ */
}

/* ===== 28. LARGE TYPOGRAPHY (32px+ headlines for Vibrant style) ===== */
@media (min-width: 768px) {
    .hero-headline {
        font-size: clamp(2.5rem, 5vw, 4rem);
        line-height: 1.1;
    }
}

/* ===== 29. BOLD BLOCK DIVIDERS ===== */
.block-divider {
    height: 4px;
    width: 60px;
    background: linear-gradient(135deg, var(--brand-main), var(--accent-main));
    border-radius: 2px;
    margin: 0 auto 1.5rem;
}

/* ===== 30. ENHANCED SKELETON LOADING STATES ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

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