/* ========================================
   RESET & BASE
   ======================================== */
* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0a0a0f;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  color: #fff;
  line-height: 1.6;
}

/* ========================================
   ANIMATED GRADIENT MESH - OTTIMIZZATO
   ======================================== */
body::before {
  content: '';
  position: fixed; 
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(99,102,241,.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(168,85,247,.12) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(236,72,153,.10) 0%, transparent 50%),
    radial-gradient(circle at 90% 70%, rgba(59,130,246,.08) 0%, transparent 50%);
  animation: meshMove 20s ease-in-out infinite;
  z-index: 0;
  will-change: transform;
  pointer-events: none;
}

@keyframes meshMove { 
  0%, 100% { transform: scale(1) translateY(0); } 
  50% { transform: scale(1.05) translateY(-15px); } 
}

/* ========================================
   ORBS - OTTIMIZZATI
   ======================================== */
.orb { 
  position: fixed; 
  border-radius: 50%; 
  filter: blur(60px);
  opacity: .5;
  animation: float 20s ease-in-out infinite; 
  z-index: 0;
  will-change: transform;
  pointer-events: none;
}

.orb1 { 
  width: 350px; 
  height: 350px; 
  background: linear-gradient(135deg, #667eea, #764ba2); 
  top: -200px; 
  right: -200px; 
}

.orb2 { 
  width: 300px; 
  height: 300px; 
  background: linear-gradient(135deg, #f093fb, #f5576c); 
  bottom: -150px; 
  left: -150px; 
  animation-delay: 7s;
}

.orb3 { 
  width: 250px; 
  height: 250px; 
  background: linear-gradient(135deg, #4facfe, #00f2fe); 
  top: 50%; 
  left: 50%; 
  animation-delay: 14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -40px) scale(1.05); }
  66% { transform: translate(-40px, 40px) scale(0.95); }
}

/* ========================================
   HEADER
   ======================================== */
.header {
  background: rgba(15, 15, 25, .8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff; 
  padding: 1.5rem 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .2);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content { 
  max-width: 1200px; 
  margin: 0 auto; 
  display: flex !important; 
  flex-direction: column !important;
  justify-content: center; 
  align-items: center; 
  gap: 0.5rem;
}

.main-title,
.logo {
  font-size: 1.5rem; 
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #f093fb);
  -webkit-background-clip: text; 
  -webkit-text-fill-color: transparent; 
  background-clip: text;
  text-align: center;
  margin: 0;
}

.subtitle {
  font-size: 1rem;
  font-weight: 500;
  background: linear-gradient(135deg, #667eea, #f093fb);
  -webkit-background-clip: text; 
  -webkit-text-fill-color: transparent; 
  background-clip: text;
  opacity: 0.9;
  text-align: center;
}

.store-link {
  font-size: 0.9rem;
  font-weight: 500;
  background: linear-gradient(135deg, #667eea, #f093fb);
  -webkit-background-clip: text; 
  -webkit-text-fill-color: transparent; 
  background-clip: text;
  opacity: 0.85;
  text-align: center;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  margin-top: 0.2rem;
  display: inline-block;
}

.store-link:hover {
  opacity: 1;
  transform: translateY(-2px);
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero { 
  color: #fff; 
  text-align: center; 
  padding: 4rem 2rem 3rem; 
  position: relative; 
  z-index: 1; 
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800; 
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, .85) 100%);
  -webkit-background-clip: text; 
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.hero p { 
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  opacity: .85; 
  font-weight: 300; 
}

/* ========================================
   CONTAINER & FORM CARD
   ======================================== */
.container { 
  max-width: 1400px; 
  margin: 0 auto 4rem; 
  padding: 1rem 2rem;
  position: relative; 
  z-index: 10; 
}

.form-card {
  background: rgba(20, 20, 30, .85);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-radius: 32px;
  padding: 3rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
  border: 1px solid rgba(255, 255, 255, .1);
  max-width: 900px;
  margin: 0 auto;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */
.form-group { 
  margin-bottom: 2rem; 
}

.form-group label { 
  color: rgba(255, 255, 255, .95); 
  margin-bottom: .8rem; 
  display: block; 
  font-weight: 600; 
  font-size: 1rem;
}

.note { 
  font-size: .9rem; 
  color: rgba(255, 255, 255, .6); 
  margin: .2rem 0 1.2rem; 
}

input:not([type="checkbox"]):not([type="file"]), 
textarea {
  width: 100%; 
  padding: 1rem 1.2rem;
  border: 1.5px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  background: rgba(255, 255, 255, .05);
  color: #fff; 
  transition: all .3s ease;
  font-size: 1rem;
  font-family: inherit;
}

input::placeholder, 
textarea::placeholder { 
  color: rgba(255, 255, 255, .4); 
}

input:focus, 
textarea:focus {
  outline: none; 
  border-color: #667eea;
  background: rgba(255, 255, 255, .08);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, .12);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* ========================================
   PRODUCT GRID (Form Custom Design)
   ======================================== */
.product-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.product-item {
  display: flex; 
  flex-direction: column; 
  align-items: center;
  padding: 1.2rem 1rem;
  border: 2px solid rgba(255, 255, 255, .12);
  border-radius: 20px; 
  background: rgba(255, 255, 255, .04);
  transition: all .3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.product-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.product-item::before {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 2.5px solid rgba(255, 255, 255, .3);
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
  transition: all .3s ease;
  z-index: 10;
}

.product-item::after {
  content: '✓';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  opacity: 0;
  transform: scale(0);
  transition: all .3s ease;
  z-index: 11;
  pointer-events: none;
}

.product-item:hover { 
  border-color: rgba(102, 126, 234, .5);
  transform: translateY(-4px);
  box-shadow: 0 12px 35px rgba(102, 126, 234, .25);
  background: rgba(255, 255, 255, .07);
}

.product-item:hover::before {
  border-color: rgba(102, 126, 234, .6);
  background: rgba(102, 126, 234, .1);
}

.product-item.selected { 
  border-color: #667eea;
  background: linear-gradient(135deg, rgba(102, 126, 234, .2), rgba(240, 147, 251, .15));
  box-shadow: 0 8px 30px rgba(102, 126, 234, .3);
}

.product-item.selected::before {
  background: linear-gradient(135deg, #667eea, #f093fb);
  border-color: #667eea;
}

.product-item.selected::after {
  opacity: 1;
  transform: scale(1);
}

.product-visual {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: .8rem;
  pointer-events: none;
}

.product-item img { 
  width: 90px; 
  height: 90px; 
  object-fit: cover; 
  border-radius: 14px;
  transition: transform .3s ease;
  pointer-events: none;
}

.product-item:hover img {
  transform: scale(1.05);
}

.product-label {
  font-size: .95rem;
  font-weight: 500;
  color: rgba(255, 255, 255, .9);
  text-align: center;
  line-height: 1.3;
  pointer-events: none;
}

/* ========================================
   FILE UPLOAD AREA
   ======================================== */
.file-upload-area {
  border: 2px dashed rgba(102, 126, 234, .4);
  border-radius: 20px; 
  padding: 3rem 2rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(102, 126, 234, .06), rgba(240, 147, 251, .06));
  cursor: pointer; 
  position: relative;
  transition: all .3s ease;
}

.file-upload-area:hover {
  border-color: rgba(102, 126, 234, .6);
  background: linear-gradient(135deg, rgba(102, 126, 234, .1), rgba(240, 147, 251, .1));
  transform: translateY(-2px);
}

.file-upload-area.dragover {
  border-color: #667eea;
  background: linear-gradient(135deg, rgba(102, 126, 234, .15), rgba(240, 147, 251, .15));
  transform: scale(1.02);
}

#fileInput { 
  opacity: 0; 
  position: absolute; 
  inset: 0; 
  width: 100%; 
  height: 100%; 
  cursor: pointer; 
}

.upload-content {
  pointer-events: none;
}

.upload-content svg {
  color: rgba(255, 255, 255, .7);
  margin-bottom: 1rem;
}

.upload-content p {
  color: rgba(255, 255, 255, .85); 
  font-weight: 500;
  font-size: 1.1rem;
  margin-bottom: .5rem;
}

.upload-hint {
  display: block;
  font-size: .85rem;
  color: rgba(255, 255, 255, .5);
  margin-top: .5rem;
}

/* ========================================
   FILES LIST
   ======================================== */
.files-list {
  display: flex; 
  flex-direction: column; 
  gap: 12px;
  margin-top: 1.2rem; 
  padding: 1.2rem;
  background: rgba(255, 255, 255, .04);
  border-radius: 16px; 
  border: 1px solid rgba(255, 255, 255, .08);
}

.file-item {
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  background: rgba(255, 255, 255, .06);
  padding: 0.9rem 1rem; 
  border-radius: 12px;
  color: rgba(255, 255, 255, .95); 
  border: 1px solid rgba(255, 255, 255, .1);
  transition: all .2s ease;
}

.file-item:hover {
  background: rgba(255, 255, 255, .08);
  transform: translateX(4px);
}

.file-item .file-left { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  min-width: 0; 
}

.file-item img { 
  width: 60px; 
  height: 60px; 
  object-fit: cover; 
  border-radius: 8px; 
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, .1);
  cursor: pointer;
  transition: all .3s ease;
}

.file-item img:hover {
  transform: scale(1.1);
  border-color: #667eea;
  box-shadow: 0 4px 20px rgba(102, 126, 234, .4);
}

.file-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.file-name { 
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis; 
  max-width: 400px;
  font-size: .95rem;
  font-weight: 500;
  color: rgba(255, 255, 255, .95);
}

.file-size {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, .6);
}

.remove-file {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.remove-file:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  transform: scale(1.1);
}

.remove-file svg {
  display: block;
}

/* ========================================
   ERROR MESSAGE
   ======================================== */
.error-message {
  color: #fca5a5; 
  display: none; 
  padding: .9rem 1.2rem;
  background: rgba(239, 68, 68, .12);
  border-left: 4px solid #ef4444;
  border-radius: 12px;
  margin-top: 1rem;
  font-size: .95rem;
  animation: slideIn .3s ease;
}

@keyframes slideIn {
  from { 
    opacity: 0; 
    transform: translateY(-10px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

/* ========================================
   SUBMIT BUTTON
   ======================================== */
.submit-btn {
  width: 100%; 
  padding: 1.3rem;
  background: linear-gradient(135deg, #667eea 0%, #f093fb 100%);
  color: #fff; 
  font-size: 1.2rem; 
  font-weight: 700; 
  border: none; 
  border-radius: 16px; 
  cursor: pointer; 
  transition: all .3s ease;
  position: relative;
  overflow: hidden;
}

.submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .2), transparent);
  transition: left .5s ease;
}

.submit-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 45px rgba(102, 126, 234, .4);
}

.submit-btn:hover::before {
  left: 100%;
}

.submit-btn:active {
  transform: translateY(-1px);
}

.submit-btn:disabled { 
  opacity: .6; 
  cursor: not-allowed; 
  transform: none; 
  box-shadow: none; 
}

.submit-btn:disabled::before {
  display: none;
}

/* ========================================
   LOADER OVERLAY + PROGRESS BAR
   ======================================== */
.loader-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeIn .25s ease;
}

.loader-box {
  text-align: center;
  color: #fff;
  font-size: 1.05rem;
  background: rgba(20, 20, 30, .95);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 24px;
  padding: 2rem 2.5rem;
  width: clamp(300px, 50vw, 450px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.spinner {
  width: 60px;
  height: 60px;
  border: 5px solid rgba(255, 255, 255, .2);
  border-top: 5px solid #f093fb;
  border-radius: 50%;
  margin: 0 auto 1.2rem auto;
  animation: spin 1s linear infinite;
}

@keyframes spin { 
  0% { transform: rotate(0deg); } 
  100% { transform: rotate(360deg); } 
}

#loaderMessage {
  margin-bottom: 1.2rem;
  font-size: 1.05rem;
  font-weight: 500;
}

.progress {
  margin: 1.2rem 0 0.8rem;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, .12);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .1);
  position: relative;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #667eea, #f093fb);
  box-shadow: 0 0 20px rgba(102, 126, 234, .6);
  border-radius: 999px;
  transition: width .3s ease;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .3), transparent);
  animation: shine 2s infinite;
}

@keyframes shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.loader-status {
  margin-top: 0.8rem;
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #f093fb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   SUCCESS POPUP
   ======================================== */
.popup-overlay {
  display: none; 
  position: fixed; 
  inset: 0;
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  justify-content: center; 
  align-items: center; 
  z-index: 1999;
  animation: fadeIn .3s ease;
}

.popup-box {
  background: rgba(20, 20, 30, .95); 
  padding: 2.5rem 3rem; 
  border-radius: 24px;
  text-align: center; 
  color: #fff; 
  max-width: 500px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, .15);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .6);
  animation: popIn .35s ease;
}

@keyframes popIn {
  from { 
    opacity: 0; 
    transform: scale(.9) translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: scale(1) translateY(0); 
  }
}

.popup-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: bounce .6s ease;
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.popup-box h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #667eea, #f093fb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.popup-box p {
  font-size: 1rem;
  color: rgba(255, 255, 255, .8);
  line-height: 1.6;
  margin-bottom: 0.8rem;
}

.popup-note {
  font-size: 0.95rem !important;
  color: rgba(255, 255, 255, .7) !important;
  font-style: italic;
  margin-top: 1rem !important;
}

.popup-close { 
  position: absolute; 
  top: 16px; 
  right: 20px; 
  background: rgba(255, 255, 255, .1);
  border: none; 
  color: #fff; 
  font-size: 1.8rem; 
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s ease;
}

.popup-close:hover {
  background: rgba(255, 255, 255, .2);
  transform: rotate(90deg);
}

/* ========================================
   LIGHTBOX
   ======================================== */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 3000;
  animation: fadeIn .3s ease;
  justify-content: center;
  align-items: center;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

#lightboxImage {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, .8);
  animation: zoomIn .4s ease;
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 600px;
  padding: 1rem 1.5rem;
  background: rgba(20, 20, 30, .9);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .1);
}

#lightboxFileName {
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, .9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

#lightboxCounter {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, .7);
  background: linear-gradient(135deg, #667eea, #f093fb);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-weight: 600;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .2);
  color: #fff;
  font-size: 2rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .3s ease;
  z-index: 10;
}

.lightbox-close:hover {
  background: rgba(239, 68, 68, .8);
  border-color: rgba(239, 68, 68, 1);
  transform: rotate(90deg) scale(1.1);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .2);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .3s ease;
  z-index: 10;
}

.lightbox-nav:hover {
  background: rgba(102, 126, 234, .8);
  border-color: #667eea;
  transform: translateY(-50%) scale(1.15);
}

.lightbox-prev {
  left: 30px;
}

.lightbox-next {
  right: 30px;
}

.lightbox-nav:disabled {
  opacity: .3;
  cursor: not-allowed;
  transform: translateY(-50%) scale(1);
}

.lightbox-nav:disabled:hover {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .2);
}

/* ========================================
   CATEGORIES GRID
   ======================================== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.category-card {
  background: rgba(20, 20, 30, .85);
  backdrop-filter: blur(30px);
  border-radius: 24px;
  overflow: hidden;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .1);
  transition: all .3s ease;
  cursor: pointer;
  display: block;
}

.category-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(102, 126, 234, .3);
  border-color: rgba(102, 126, 234, .5);
}

.category-image {
  width: 100%;
  height: 280px;
  overflow: hidden;
  position: relative;
}

.category-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.category-card:hover .category-image img {
  transform: scale(1.1);
}

.category-content {
  padding: 2rem;
}

.category-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.8rem;
  background: linear-gradient(135deg, #667eea, #f093fb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.category-content p {
  color: rgba(255, 255, 255, .7);
  font-size: 1rem;
  margin-bottom: 1.2rem;
  line-height: 1.6;
}

.category-cta {
  display: inline-block;
  color: #667eea;
  font-weight: 600;
  font-size: 1rem;
  transition: all .3s ease;
}

.category-card:hover .category-cta {
  transform: translateX(8px);
  color: #f093fb;
}

/* ========================================
   PRODUCTS GRID
   ======================================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-top: 2rem;
  padding: 0 1rem;
}

.product-card {
  background: rgba(20, 20, 30, .85);
  backdrop-filter: blur(30px);
  border-radius: 24px;
  overflow: hidden;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .1);
  transition: all .3s ease;
  cursor: pointer;
  display: block;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(102, 126, 234, .3);
  border-color: rgba(102, 126, 234, .5);
}

.product-image {
  width: 100%;
  height: 280px;
  overflow: hidden;
  position: relative;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.1);
}

.product-info {
  padding: 2rem;
}

.product-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  background: linear-gradient(135deg, #667eea, #f093fb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
}

/* ========================================
   FOOTER CTA
   ======================================== */
.footer-cta {
  text-align: center;
  padding: 4rem 2rem;
  margin: 4rem auto 4rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, .1), rgba(240, 147, 251, .1));
  border-radius: 32px;
  max-width: 1200px;
}

.footer-cta h2 {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
}

.footer-cta p {
  color: rgba(255, 255, 255, .8);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.cta-button {
  display: inline-block;
  padding: 1.2rem 2.5rem;
  background: linear-gradient(135deg, #667eea, #f093fb);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 16px;
  text-decoration: none;
  transition: all .3s ease;
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 45px rgba(102, 126, 234, .4);
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn { 
  from { opacity: 0; } 
  to { opacity: 1; } 
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 900px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero h1 { 
    font-size: 2.2rem; 
  }
  
  .form-card { 
    padding: 2rem 1.5rem; 
    border-radius: 24px; 
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .8rem;
  }
  
  .product-item {
    padding: 1rem .8rem;
  }
  
  .product-item img {
    width: 75px;
    height: 75px;
  }
  
  .product-item::before {
    width: 24px;
    height: 24px;
    top: 10px;
    right: 10px;
  }
  
  .product-item::after {
    width: 24px;
    height: 24px;
    top: 10px;
    right: 10px;
    font-size: 14px;
  }
  
  .file-upload-area {
    padding: 2rem 1.5rem;
  }
  
  .popup-box {
    margin: 1rem;
    padding: 2rem;
  }
  
  .loader-box {
    width: 90%;
    padding: 1.5rem 2rem;
  }
  
  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
  
  .lightbox-nav {
    width: 40px;
    height: 40px;
  }
  
  .lightbox-prev {
    left: 10px;
  }
  
  .lightbox-next {
    right: 10px;
  }
  
  .lightbox-info {
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem;
  }
  
  #lightboxFileName {
    max-width: 250px;
    text-align: center;
  }
  
  .file-name {
    max-width: 200px;
  }
}

@media (max-width: 640px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
  
  .categories-grid {
    grid-template-columns: 1fr;
  }
  
  .product-image {
    height: 320px;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .header {
    padding: 1rem 1.5rem;
  }
  
  .logo {
    font-size: 1.2rem;
  }
  
  .hero {
    padding: 3rem 1.5rem 2rem;
  }
  
  .form-card {
    padding: 1.5rem 1rem;
  }
  
  #lightboxImage {
    max-height: 70vh;
  }
  
  .lightbox-content {
    gap: 1rem;
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.sr-only {
  position: absolute !important;
  width: 1px; 
  height: 1px;
  padding: 0; 
  margin: -1px;
  overflow: hidden; 
  clip: rect(0, 0, 0, 0);
  white-space: nowrap; 
  border: 0;
}

.product-item,
.product-label,
.product-visual,
.lightbox-nav,
.lightbox-close,
.popup-close,
.remove-file {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

.product-item,
.submit-btn,
.orb,
body::before,
.lightbox-overlay,
#lightboxImage,
.progress-bar {
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ========================================
   ACCESSIBILITY - FOCUS VISIBLE
   ======================================== */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.product-item:focus-visible {
  outline: 3px solid #667eea;
  outline-offset: 3px;
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
  .header,
  .hero,
  .orb,
  body::before,
  .loader-overlay,
  .popup-overlay,
  .lightbox-overlay {
    display: none !important;
  }
  
  .form-card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .orb {
    animation: none !important;
  }
  
  body::before {
    animation: none !important;
  }
}

/* ========================================
   HIGH CONTRAST MODE
   ======================================== */
@media (prefers-contrast: high) {
  .product-item {
    border-width: 3px;
  }
  
  .submit-btn {
    border: 2px solid #fff;
  }
  
  input,
  textarea {
    border-width: 2px;
  }
}

/* FIX per Hero e Products visibili */
.hero,
.container {
  position: relative;
  z-index: 10 !important;
}