/* Pro Coding Tools — Apple-Grade Precision UI & High-Performance Compositing Engine */

:root {
    --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --spring-gentle: cubic-bezier(0.16, 1, 0.3, 1);
    --apple-ease: cubic-bezier(0.25, 1, 0.5, 1);
}

/* 1. HIGH DENSITY TYPOGRAPHIC RENDERING */
*, *::before, *::after {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

html {
    scroll-behavior: smooth;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    touch-action: pan-y;
}

/* 2. JITTER-FREE SMOOTH THEME COMPOSITING */
.theme-transition,
body,
header,
footer,
.template-card,
.feature-card,
.review-card,
.cat-pill,
.page-btn,
#previewModalCard,
#cartDrawer {
    transition: background-color 0.25s var(--apple-ease), 
                border-color 0.25s var(--apple-ease), 
                color 0.2s var(--apple-ease), 
                box-shadow 0.25s var(--apple-ease);
}

/* 3. APPLE-STYLE ULTRA-GLASS HEADER */
header {
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
}

/* 4. LENIS HARDWARE-ACCELERATED SMOOTH SCROLL */
html.lenis, html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

/* 5. MINIMAL NATIVE SCROLLBAR */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d4d4d8;
    border-radius: 9999px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #232328;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1aa;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #3f3f46;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 6. CATEGORY TAB PILLS (Apple segmented control style) */
.cat-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.875rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #52525b; /* zinc-600 */
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s var(--spring-gentle);
    user-select: none;
    transform: translate3d(0,0,0);
}

.dark .cat-pill {
    color: #a1a1aa; /* zinc-400 */
}

.cat-pill:hover {
    color: #09090b;
    background: #f4f4f5; /* zinc-100 */
}

.dark .cat-pill:hover {
    color: #ffffff;
    background: #18181b; /* zinc-900 */
}

.cat-pill.active {
    background: #18181b !important;
    color: #ffffff !important;
    border-color: #27272a !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dark .cat-pill.active {
    background: #ffffff !important;
    color: #09090b !important;
    border-color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.12);
}

/* 7. PAGINATION CONTROLS */
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    height: 2.1rem;
    padding: 0 0.5rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-mono, monospace);
    color: #52525b;
    background: #f4f4f5;
    border: 1px solid #e4e4e7;
    cursor: pointer;
    transition: all 0.2s var(--spring-gentle);
    user-select: none;
}

.dark .page-btn {
    color: #a1a1aa;
    background: #111114;
    border-color: #232328;
}

.page-btn:hover:not(:disabled) {
    color: #09090b;
    border-color: #a1a1aa;
    background: #e4e4e7;
}

.dark .page-btn:hover:not(:disabled) {
    color: #ffffff;
    border-color: #3f3f46;
    background: #1c1c22;
}

.page-btn.active {
    background: #18181b !important;
    color: #ffffff !important;
    border-color: #18181b !important;
    font-weight: 700;
}

.dark .page-btn.active {
    background: #ffffff !important;
    color: #09090b !important;
    border-color: #ffffff !important;
    font-weight: 700;
}

.page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* 8. FRAMER MOTION GESTURES & GPU-ACCELERATED TRANSFORMS */
.motion-tap {
    transition: transform 0.12s var(--spring-bounce);
    user-select: none;
    backface-visibility: hidden;
}

.motion-tap:active {
    transform: scale(0.96) translate3d(0, 0, 0) !important;
}

.motion-card {
    transition: transform 0.25s var(--spring-gentle), border-color 0.25s ease, box-shadow 0.25s ease;
    will-change: transform;
    backface-visibility: hidden;
}

.motion-card:hover {
    transform: translateY(-4px) translate3d(0, 0, 0);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.08);
}

.dark .motion-card:hover {
    border-color: #3f3f46;
    box-shadow: 0 20px 45px -12px rgba(0, 0, 0, 0.6);
}

/* 9. 3D CARD PERSPECTIVE TILT */
.template-card-wrap {
    perspective: 1000px;
}

.template-card {
    transform-style: preserve-3d;
    transform: translateZ(0);
    will-change: transform;
    transition: transform 0.25s var(--spring-gentle), border-color 0.25s ease, box-shadow 0.25s ease;
}

.template-card:hover {
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.08);
}

.dark .template-card:hover {
    border-color: #3f3f46;
    box-shadow: 0 20px 45px -12px rgba(0, 0, 0, 0.6);
}

/* 10. MOCKUP VISUAL CANVASES */
.mockup-canvas {
    background: radial-gradient(circle at top left, rgba(161, 161, 170, 0.08), transparent 70%);
}

.dark .mockup-canvas {
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.04), transparent 70%);
}

/* 11. ACCORDION DYNAMICS */
.faq-btn i {
    transition: transform 0.3s var(--spring-gentle);
}

.faq-btn.active i {
    transform: rotate(180deg);
}

/* 12. MAGNETIC BUTTON BASE */
.magnetic-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    will-change: transform;
    backface-visibility: hidden;
}
