/* =====================================================
   MASTER CAKE LAB — Animations CSS
   Keyframes, transitions, AOS overrides, micro-interactions
   ===================================================== */

/* ==============================
   KEYFRAMES
   ============================== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes scrollWheel {
    0%   { opacity: 1; transform: translateY(0); }
    50%  { opacity: .4; transform: translateY(8px); }
    100% { opacity: 0; transform: translateY(14px); }
}

@keyframes cartBounce {
    0%, 100% { transform: scale(1); }
    25%       { transform: scale(1.35); }
    50%       { transform: scale(.9); }
    75%       { transform: scale(1.15); }
}

@keyframes cartAdded {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

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

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(.93); }
    to   { opacity: 1; transform: scale(1); }
}

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

@keyframes goldPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(212,175,55,.2); }
    50%       { box-shadow: 0 0 40px rgba(212,175,55,.5), 0 0 80px rgba(212,175,55,.15); }
}

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

@keyframes revealText {
    from { clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0% 0 0); }
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}

@keyframes toastIn {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(120%); opacity: 0; }
}

/* ==============================
   UTILITIES — Animazioni
   ============================== */
.animate-fadeInUp   { animation: fadeInUp .6s ease both; }
.animate-fadeInScale{ animation: fadeInScale .5s ease both; }
.animate-float      { animation: floatY 4s ease-in-out infinite; }
.animate-gold-pulse { animation: goldPulse 3s ease-in-out infinite; }

.delay-100 { animation-delay: .1s; }
.delay-200 { animation-delay: .2s; }
.delay-300 { animation-delay: .3s; }
.delay-400 { animation-delay: .4s; }
.delay-500 { animation-delay: .5s; }
.delay-600 { animation-delay: .6s; }

/* ==============================
   SKELETON LOADER
   ============================== */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255,255,255,.04) 0%,
        rgba(255,255,255,.09) 50%,
        rgba(255,255,255,.04) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 1.8s infinite ease-in-out;
    border-radius: var(--radius-md);
}

.skeleton-card {
    height: 400px;
    border-radius: var(--radius-xl);
}

.skeleton-text {
    height: 1em;
    margin-bottom: .5em;
    border-radius: var(--radius-sm);
}

.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }

/* ==============================
   AOS OVERRIDES
   ============================== */
[data-aos] {
    pointer-events: none;
}
[data-aos].aos-animate {
    pointer-events: auto;
}

/* Custom AOS durations */
[data-aos][data-aos-duration="1200"] {
    transition-duration: 1200ms !important;
}

/* ==============================
   HERO TYPING EFFECT
   ============================== */
.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--color-gold);
    vertical-align: middle;
    margin-left: 4px;
    animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ==============================
   GRADIENT ANIMATED BG
   ============================== */
.animated-gradient {
    background: linear-gradient(-45deg, var(--surface-bg), #1a0d10, #0d1a12, #0d0d1a);
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
}

/* ==============================
   RIPPLE EFFECT (per bottoni)
   ============================== */
.ripple-container {
    position: relative;
    overflow: hidden;
}

.ripple-wave {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    transform: scale(0);
    animation: ripple .6s linear;
    pointer-events: none;
}

/* ==============================
   PAGE TRANSITION
   ============================== */
.page-enter {
    animation: fadeInScale .4s ease both;
}

/* ==============================
   ALLERGEN OVERLAY (già in components)
   — Aggiunge particelle animate
   ============================== */
.allergen-overlay-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.allergen-overlay-particles::before,
.allergen-overlay-particles::after {
    content: '✨';
    position: absolute;
    font-size: 1rem;
    opacity: 0;
    animation: particleFloat 2s ease-in-out infinite;
}

.allergen-overlay-particles::before {
    left: 20%;
    animation-delay: 0s;
}

.allergen-overlay-particles::after {
    right: 20%;
    animation-delay: 1s;
}

.product-card:hover .allergen-overlay-particles::before,
.product-card:hover .allergen-overlay-particles::after {
    opacity: .5;
}

@keyframes particleFloat {
    0%   { opacity: 0; transform: translateY(0) scale(.5); }
    50%  { opacity: .8; }
    100% { opacity: 0; transform: translateY(-40px) scale(1); }
}

/* ==============================
   GOLD LINE SEPARATOR
   ============================== */
.gold-line {
    display: block;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
    margin: var(--space-8) 0;
    border: none;
}

/* ==============================
   PROGRESS BAR (checkout)
   ============================== */
.progress-bar-track {
    height: 3px;
    background: rgba(255,255,255,.08);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-12);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-gold-dark), var(--color-gold-light));
    border-radius: var(--radius-full);
    transition: width .6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(212,175,55,.5);
}

/* ==============================
   STICKY SCROLL HIDE
   ============================== */
.header-hidden {
    transform: translateY(-100%);
    transition: transform .4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.site-header {
    transition: transform .4s cubic-bezier(0.4, 0, 0.2, 1), background var(--transition-base), box-shadow var(--transition-base);
}
