/* VisionAQ Prints - Main Styles */

/* CSS Custom Properties */
:root {
    /* Colors */
    --white: #ffffff;
    --black: #000000;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-premium: 0 32px 64px -12px rgba(0, 0, 0, 0.15), 0 8px 32px -8px rgba(0, 0, 0, 0.1);

    /* Glass morphism */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-blur: blur(20px);
    --glass-perspective: 1000px;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-premium: 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;

    /* Z-index layers */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;

    /* Product aspect ratio - Portrait (2 wide : 3 tall) */
    --product-aspect-ratio: 2/3;

    /* Header height */
    --header-height: 60px;
}

/* Reset and Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: none;
    /* Prevent text size adjustment on iPhone */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    /* Remove tap highlight on iOS */
    -webkit-touch-callout: none;
    /* Disable callout on iOS */
    /* MOBILE: Prevent horizontal overscroll at document level */
    overscroll-behavior-x: none;
    overscroll-behavior-y: auto;
    /* FIX: Prevent any width/positioning shifts */
    width: 100vw;
    max-width: 100vw;
    position: relative;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: 400;
    line-height: 1.6;
    color: var(--gray-900);
    background-color: var(--white);
    overflow-x: hidden;
    /* FIXED: Prevent horizontal scrolling while preserving shadows */
    min-height: 100vh;
    /* Improve mobile consistency */
    -webkit-overflow-scrolling: touch;
    text-size-adjust: none;
    /* MOBILE: Prevent page swiping and overscroll */
    touch-action: pan-y pinch-zoom;
    overscroll-behavior-x: none;
    overscroll-behavior-y: auto;
    /* FIX: Lock body dimensions and positioning */
    width: 100vw;
    max-width: 100vw;
    position: relative;
    left: 0;
    right: 0;
    /* REMOVED: transform breaks position:fixed on header */
    /* transform: translate3d(0, 0, 0); */
}

/* Remove default button styles */
button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    outline: inherit;
}

/* Remove default list styles */
ul,
ol {
    list-style: none;
}

/* Remove default link styles */
a {
    color: inherit;
    text-decoration: none;
}

/* Image defaults */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 2px solid var(--gray-900);
    outline-offset: 2px;
}

/* Selection styles */
::selection {
    background-color: var(--gray-900);
    color: var(--white);
}

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

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-md);
}

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

/* Main Layout */
.main-content {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    /* FIX: Lock main content positioning */
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
    left: 0;
    right: 0;
    transform: translate3d(0, 0, 0);
}

/* Remove any default margins on sections to eliminate gaps */
section {
    margin: 0;
    padding: 0;
}

/* Sections after hero need to be positioned below the hero */
.carousel-section,
.products-section {
    position: static !important;
    top: auto !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

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

h1 {
    font-size: var(--font-size-4xl);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

h5 {
    font-size: var(--font-size-lg);
}

h6 {
    font-size: var(--font-size-base);
}

.section-title {
    font-family: var(--font-family);
    font-size: var(--font-size-2xl);
    font-weight: 500;
    color: var(--gray-900);
    text-align: center;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mobile-only {
    display: block;
}

.desktop-only {
    display: none;
}

/* Responsive breakpoints */
@media (min-width: 768px) {
    .mobile-only {
        display: none;
    }

    .desktop-only {
        display: block;
    }

    :root {
        --header-height: 70px;
    }

    .section-title {
        font-size: var(--font-size-3xl);
    }
}

@media (min-width: 1024px) {
    :root {
        --header-height: 75px;
    }
}

/* Animation keyframes */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Glint shimmer animation for product cards */
@keyframes glint-sweep {
    0% {
        transform: translateX(-100%) translateY(-100%) skew(-15deg);
    }

    25% {
        transform: translateX(100%) translateY(100%) skew(-15deg);
    }

    100% {
        transform: translateX(100%) translateY(100%) skew(-15deg);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounce {

    0%,
    20%,
    53%,
    80%,
    100% {
        transform: translate3d(0, 0, 0);
    }

    40%,
    43% {
        transform: translate3d(0, -8px, 0);
    }

    70% {
        transform: translate3d(0, -4px, 0);
    }

    90% {
        transform: translate3d(0, -2px, 0);
    }
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* Status Classes */
.error {
    color: #dc2626;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
}

.success {
    color: #059669;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
}

/* Premium 3D Tilt + Glint Animation System - MANAGED BY product-tilt-effects.js */
/* All glint effects are now handled by the SimpleTilt3D class */

/* MOBILE: Disable ALL hover effects on touch devices */
@media (hover: none) {

    /* Completely disable hover pseudo-class effects on mobile */
    *:hover {
        /* Reset any hover styles to prevent touch scroll triggering */
        box-shadow: inherit !important;
        transform: inherit !important;
        background: inherit !important;
        color: inherit !important;
        opacity: inherit !important;
        filter: inherit !important;
    }

    /* Ensure product cards don't respond to touch hover */
    .product-card:hover,
    .premium-tilt-card:hover {
        box-shadow: none !important;
        /* Explicitly disable shadow on mobile hover */
        transform: none !important;
        /* Explicitly disable transform on mobile hover */
        z-index: 100 !important;
    }

    /* Disable button hover effects on mobile */
    button:hover,
    .nav-link:hover,
    .header-cart-btn:hover {
        background: inherit !important;
        color: inherit !important;
        transform: inherit !important;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Lazy Loading States */
.lazy-image {
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.lazy-image.loading {
    opacity: 0.7;
}

.lazy-image.loaded {
    opacity: 1;
}

/* Background image lazy loading */
.background-loaded {
    animation: fadeIn var(--transition-normal) ease-out;
}

/* EXTREME MOBILE OVERRIDE: Disable all shadows and transforms on touch devices */
@media (hover: none) {

    .product-card,
    .premium-tilt-card,
    .product-card:hover,
    .premium-tilt-card:hover,
    .product-card:active,
    .premium-tilt-card:active,
    .product-card:focus,
    .premium-tilt-card:focus {
        box-shadow: none !important;
        transform: none !important;
        transition: none !important;
        /* ALLOW glint animations on mobile - remove animation: none */
        filter: none !important;
    }

    /* CRITICAL FIX: Preserve modal product image shadow on touch */
    .modal-product-image,
    .modal-product-image:active,
    .modal-product-image:hover,
    .modal-product-image:focus {
        box-shadow: 20px 25px 50px rgba(0, 0, 0, 0.6) !important;
        transform: none !important;
        transition: opacity 0.3s ease !important;
    }

    /* ENABLE glint-overlay animations on desktop only */
    .glint-overlay {
        filter: blur(12px) !important;
        /* Standard blur matching desktop */
        /* Allow glint animation to work on desktop */
        animation: glint-sweep 6s infinite !important;
        /* Slower on mobile */
        pointer-events: none !important;
        z-index: 10 !important;
    }

    /* MOBILE: CSS pseudo-elements handle glint overlays */
    /* Glint overlay styles are defined in their respective CSS files */
    /* mobile-carousel-v2.css handles .mobile-carousel-item-v2::before */
    /* products-v2.css handles .product-card-v2-mobile::before */
}

/* ADDITIONAL MOBILE CONSISTENCY FIXES */
@media (max-width: 767px) {

    /* Force consistent mobile rendering */
    html {
        -webkit-text-size-adjust: none !important;
        text-size-adjust: none !important;
    }

    /* Disable 3D effects for PRODUCT CARDS ONLY - NOT ALL ELEMENTS */
    .product-card,
    .premium-tilt-card {
        transform-style: flat !important;
        -webkit-transform-style: flat !important;
        perspective: none !important;
        -webkit-perspective: none !important;
    }

    /* ALLOW glint-overlay to have transforms for animation */
    .glint-overlay {
        /* Allow transforms for glint animation */
        transform-style: preserve-3d !important;
        -webkit-transform-style: preserve-3d !important;
    }

    /* PRESERVE modal and other critical transforms */
    .product-modal-backdrop *,
    .test-card-container,
    .test-card,
    .optimized-modal *,
    .stack-card,
    .card-stack,
    #modalBackdrop *,
    #cardsContainer * {
        transform-style: preserve-3d !important;
        -webkit-transform-style: preserve-3d !important;
        perspective: 1000px !important;
        -webkit-perspective: 1000px !important;
    }

    /* Ensure consistent touch behavior */
    * {
        -webkit-tap-highlight-color: transparent !important;
        -webkit-touch-callout: none !important;
    }
}

/* Card transitions are now handled in modal-product.css and its imports */