/* Stili Personalizzati - Cashmatic Abruzzo */

* {
    box-sizing: border-box;
}

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

body {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* ===== PROGRESS BARS - ANIMAZIONE SPECTACULAR ===== */

.progress-track {
    position: relative;
    height: 14px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.progress-bar-fill {
    position: relative;
    height: 100%;
    border-radius: 999px;
    width: 0%;
    transition: width 1.8s cubic-bezier(0.22, 1, 0.36, 1);
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 40%, #60a5fa 70%, #3b82f6 100%);
    background-size: 200% 100%;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.4), 0 0 60px rgba(37, 99, 235, 0.15);
}

.progress-bar-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.0) 20%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0.0) 80%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
    animation-delay: 1.8s;
    border-radius: 999px;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    right: 4px;
    height: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.1) 100%);
    border-radius: 999px;
}

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

@keyframes barPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(37, 99, 235, 0.4), 0 0 60px rgba(37, 99, 235, 0.15); }
    50% { box-shadow: 0 0 30px rgba(37, 99, 235, 0.6), 0 0 80px rgba(37, 99, 235, 0.25); }
}

.progress-bar-fill.animate {
    animation: barPulse 3s ease-in-out infinite;
    animation-delay: 2s;
}

/* Glow effect on the track */
.progress-track::after {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    width: 0%;
    height: 18px;
    background: radial-gradient(ellipse at right, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
    border-radius: 999px;
    transition: width 1.8s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    z-index: -1;
}

.progress-track.glow {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08), 0 0 0 3px rgba(37, 99, 235, 0.06);
}

/* Counter animation */
.progress-value {
    font-variant-numeric: tabular-nums;
    transition: all 0.3s ease;
}

.progress-value.bump {
    animation: counterBump 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes counterBump {
    0% { transform: scale(1); }
    40% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Icon bounce on animate */
.progress-icon {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-icon.bounce {
    animation: iconBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes iconBounce {
    0% { transform: scale(1) rotate(0deg); }
    30% { transform: scale(1.4) rotate(-10deg); }
    60% { transform: scale(0.9) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Card entrance */
.product-card.animate-in {
    animation: cardSlideIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

/* Particle burst effect */
.progress-particles {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    pointer-events: none;
}

.progress-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #3b82f6;
    opacity: 0;
}

@keyframes particleFly {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

/* ===== FINE PROGRESS BARS ===== */

.container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

.hero-gradient {
    background: radial-gradient(circle at top right, #f0f9ff 0%, #ffffff 100%);
}

.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.cta-button {
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

[data-editor-enabled] {
    min-height: 1.2em;
    min-width: 10px;
}

[data-editor-enabled].outline-dashed {
    outline: 2px dashed #3b82f6 !important;
    outline-offset: 2px !important;
    cursor: pointer !important;
}

[data-editor-enabled].outline-dashed:hover {
    outline-color: #2563eb !important;
    background-color: rgba(59, 130, 246, 0.05) !important;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

iframe {
    max-width: 100%;
}

h1, h2, h3, h4 {
    text-wrap: balance;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

html {
    scroll-padding-top: 100px;
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 80px;
    }
}

@media (max-width: 640px) {
    input, 
    textarea, 
    select {
        font-size: 16px !important;
    }
}

@media (max-width: 768px) {
    a, button {
        -webkit-tap-highlight-color: transparent;
    }
    
    a:active,
    button:active {
        opacity: 0.8;
    }
}

@supports (-webkit-touch-callout: none) {
    .min-h-screen {
        min-height: -webkit-fill-available;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    #hero {
        padding-top: 5.5rem !important;
        padding-bottom: 2rem !important;
    }
}

/* ===== MOBILE MENU (fallback: le regole critiche sono inline in <head>) ===== */
#mobile-menu-button {
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
}
#close-mobile-menu {
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
}
#mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: #fff;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
#mobile-menu.open {
    display: block;
}
body.menu-open,
html.menu-open {
    overflow: hidden;
}

/* ===== FLOATING BUTTONS - MOBILE (fallback: i widget hanno gli stessi valori inline) ===== */
@media (max-width: 640px) {
    #a11y-toggle {
        width: 48px;
        height: 48px;
        bottom: 0.75rem;
        left: 0.75rem;
    }
    #config-toggle {
        bottom: 4.5rem;
        right: 0.75rem;
        height: 48px;
        padding: 0 0.9rem;
    }
    #config-toggle span {
        display: none;
    }
}

/* ===== MOBILE FIXES ===== */
@media (max-width: 640px) {
    .modal-body .form-grid-2 {
        grid-template-columns: 1fr !important;
    }
    #modal-close {
        width: 44px !important;
        height: 44px !important;
    }
    .cookie-btn {
        padding: 0.7rem 1rem !important;
        font-size: 0.82rem !important;
        min-height: 44px;
    }
    #cookie-settings-panel .panel-header button {
        width: 44px !important;
        height: 44px !important;
    }
    .footer-links a, .footer-links button {
        padding: 0.5rem 0.75rem !important;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    #a11y-close {
        width: 44px !important;
        height: 44px !important;
    }
    #config-captcha-input {
        width: 60px !important;
        padding: 0.55rem !important;
        min-height: 44px;
        font-size: 1rem !important;
    }
    .modal-privacy label {
        font-size: 0.78rem !important;
    }
    #privacy-policy .prose, #cookie-policy .prose {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }
}