/* Podarok3D — Main site styles */

[x-cloak] { display: none !important; }

/* Prevent horizontal scroll on mobile */
html, body { overflow-x: hidden; }

/* Safe area for notched phones */
body {
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Minimum touch targets — only navigation elements */
@media (pointer: coarse) {
    nav a, nav button { min-height: 44px; display: flex; align-items: center; }
    .nav-link-mobile { min-height: 48px; display: flex; align-items: center; }

    /* Prevent iOS auto-zoom on input focus (requires font-size >= 16px) */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="number"],
    input[type="search"],
    input[type="url"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Smooth momentum scroll on iOS */
.scroll-touch { -webkit-overflow-scrolling: touch; }

/* Prevent long words / URLs from causing horizontal overflow */
p, span, h1, h2, h3, h4, td, th, label, .glass {
    overflow-wrap: anywhere;
    word-wrap: break-word;
}

/* Make Tailwind container padding safer at 320px */
@media (max-width: 360px) {
    .px-4 { padding-left: 0.875rem; padding-right: 0.875rem; }
    .gap-4 { gap: 0.75rem; }
    .gap-6 { gap: 1rem; }
    .gap-8 { gap: 1.25rem; }
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #1a1a2e; }
::-webkit-scrollbar-thumb { background: #4c6ef5; border-radius: 4px; }

/* Glass effect */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.glass-light {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #5c7cfa, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animated gradient border */
.gradient-border {
    position: relative;
    background: linear-gradient(135deg, #0f0f23, #1a1a2e);
    border-radius: 1rem;
}
.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 1rem;
    background: linear-gradient(135deg, #5c7cfa, #ff6b6b, #5c7cfa);
    z-index: -1;
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Scroll animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* model-viewer styling */
model-viewer {
    width: 100%;
    height: 100%;
    --poster-color: transparent;
}

/* model-viewer loader (карточки витрины) */
.mv-loader {
    background:
        radial-gradient(circle at 50% 35%, rgba(92, 124, 250, 0.22), transparent 55%),
        radial-gradient(circle at 70% 85%, rgba(250, 82, 82, 0.14), transparent 50%),
        linear-gradient(180deg, #11112a 0%, #07071a 100%);
    overflow: hidden;
    isolation: isolate;
}
.mv-loader::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 18% 22%, rgba(255, 255, 255, 0.35), transparent 60%),
        radial-gradient(1px 1px at 82% 18%, rgba(255, 255, 255, 0.25), transparent 60%),
        radial-gradient(1.5px 1.5px at 25% 78%, rgba(92, 124, 250, 0.45), transparent 60%),
        radial-gradient(1px 1px at 75% 65%, rgba(250, 82, 82, 0.40), transparent 60%),
        radial-gradient(1px 1px at 55% 90%, rgba(255, 255, 255, 0.20), transparent 60%),
        radial-gradient(1px 1px at 12% 55%, rgba(255, 255, 255, 0.20), transparent 60%),
        radial-gradient(1.5px 1.5px at 90% 45%, rgba(92, 124, 250, 0.30), transparent 60%);
    animation: mv-stars 7s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}
.mv-loader > * {
    position: relative;
    z-index: 1;
}
/* плавающие световые сферы */
.mv-orb {
    position: absolute;
    border-radius: 9999px;
    filter: blur(28px);
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
}
.mv-orb {
    width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(92,124,250,0.85), transparent 65%);
    top: 8%; left: -10%;
    animation: mv-orb-float 9s ease-in-out infinite;
}
.mv-orb--2 {
    width: 100px; height: 100px;
    background: radial-gradient(circle, rgba(250,82,82,0.7), transparent 65%);
    bottom: 10%; right: -8%;
    top: auto; left: auto;
    animation: mv-orb-float 11s ease-in-out infinite reverse;
    animation-delay: -2s;
}
.mv-orb--3 {
    width: 80px; height: 80px;
    background: radial-gradient(circle, rgba(140,200,255,0.55), transparent 65%);
    bottom: -5%; left: 25%;
    top: auto;
    animation: mv-orb-float 13s ease-in-out infinite;
    animation-delay: -4s;
}
@keyframes mv-orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(20px, -15px) scale(1.08); }
    66%      { transform: translate(-15px, 18px) scale(0.94); }
}
@keyframes mv-stars {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .mv-orb, .mv-loader::after { animation: none; }
}

/* Particle background */
.particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(2px 2px at 20% 30%, rgba(92, 124, 250, 0.3), transparent),
        radial-gradient(2px 2px at 40% 70%, rgba(255, 107, 107, 0.2), transparent),
        radial-gradient(1px 1px at 60% 20%, rgba(92, 124, 250, 0.2), transparent),
        radial-gradient(1px 1px at 80% 50%, rgba(255, 107, 107, 0.15), transparent),
        radial-gradient(2px 2px at 10% 80%, rgba(92, 124, 250, 0.2), transparent),
        radial-gradient(1px 1px at 90% 10%, rgba(255, 107, 107, 0.2), transparent);
}

/* Dynamic stars background */
.stars-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    contain: layout paint style;
}

.star {
    position: absolute;
    border-radius: 50%;
    background: white;
    opacity: var(--min-opacity, 0.08);
    animation: starTwinkle var(--duration, 3s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
    will-change: opacity, transform;
}

.star::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200%;
    height: 200%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
}

.star--blue {
    background: #5c7cfa;
    box-shadow: 0 0 5px #5c7cfa, 0 0 10px rgba(92, 124, 250, 0.85);
}

.star--pink {
    background: #ff6b9d;
    box-shadow: 0 0 5px #ff6b9d, 0 0 10px rgba(255, 107, 157, 0.85);
}

.star--white {
    background: #ffffff;
    box-shadow: 0 0 4px #ffffff, 0 0 9px rgba(255,255,255,0.65);
}

.star--gold {
    background: #ffd43b;
    box-shadow: 0 0 5px #ffd43b, 0 0 10px rgba(255, 212, 59, 0.85);
}

@keyframes starTwinkle {
    0%, 100% {
        opacity: var(--min-opacity, 0.08);
        transform: scale(0.7);
    }
    50% {
        opacity: var(--max-opacity, 0.8);
        transform: scale(1.15);
    }
}
