/* Mobile Optimization — Media Queries per hero + checkout + sticky CTA */

@media (max-width: 768px) {
  /* Hero H1 ridotto */
  .hero-section h1 {
    font-size: 24px !important;
    line-height: 1.2 !important;
    letter-spacing: -0.02em !important;
  }

  /* Hero padding ridotto */
  .hero-section {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
  }
  
  .hero-section .relative.max-w-7xl {
    padding: 20px 16px !important;
  }

  /* Hero P size */
  .hero-section p {
    font-size: 14px !important;
    line-height: 1.4 !important;
  }

  /* CTA button full width + tap target 44px */
  .hero-section .btn,
  .hero-section button {
    width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
  }

  /* Form flex column su mobile */
  .hero-section form,
  .hero-section .flex.gap-2 {
    flex-direction: column !important;
    gap: 12px !important;
  }

  .hero-section form input,
  .hero-section .flex.gap-2 input {
    width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    font-size: 16px !important; /* Previene zoom su iOS */
  }

  /* Stats layout responsive */
  .hero-section .flex.flex-wrap,
  .hero-section .stats {
    flex-direction: column !important;
    gap: 12px !important;
  }

  /* Badge spacing */
  .hero-section .inline-block.px-3 {
    font-size: 11px !important;
    padding: 6px 10px !important;
  }
}

/* Sticky CTA Mobile (fixed bottom) */
.sticky-mobile-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #e94560 0%, #d63a52 100%);
  padding: 12px 16px;
  z-index: 50;
  box-shadow: 0 -2px 12px rgba(233, 69, 96, 0.3);
  animation: slideUp 0.3s ease-out;
}

.sticky-mobile-cta.show {
  display: flex;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.sticky-mobile-cta-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.sticky-mobile-cta-text {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: white;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sticky-mobile-cta-button {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.sticky-mobile-cta-button:active {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0.98);
}

.sticky-mobile-cta-close {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 300;
  flex-shrink: 0;
}

.sticky-mobile-cta-close:active {
  opacity: 0.7;
}

/* Hide sticky CTA su desktop */
@media (min-width: 769px) {
  .sticky-mobile-cta {
    display: none !important;
  }
}

/* Checkout responsive grid */
@media (max-width: 768px) {
  .checkout-form {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .checkout-form > div {
    grid-column: 1 / -1 !important;
  }

  .max-w-2xl {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* Checkout h1 */
  .checkout-form h1,
  [data-page=checkout] h1 {
    font-size: 24px !important;
    margin-bottom: 20px !important;
  }

  /* Input fields in checkout */
  .checkout-form input,
  [data-page=checkout] input {
    height: 44px !important;
    min-height: 44px !important;
    font-size: 16px !important;
  }

  /* Button checkout */
  .checkout-form button,
  [data-page=checkout] button {
    height: 48px !important;
    min-height: 48px !important;
    font-size: 14px !important;
    width: 100% !important;
  }

  /* Tab-like layout collapse */
  .checkout-form .space-y-3 {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .checkout-form > div:nth-child(n+2) {
    margin-top: 12px !important;
  }
}

/* Touch friendly mobile overrides */
@media (hover: none) and (pointer: coarse) {
  /* Rimuovi hover effects su touch */
  button:hover {
    transform: none !important;
  }

  /* Aumenta tap feedback */
  button:active {
    opacity: 0.8 !important;
    transform: scale(0.98) !important;
    transition: all 0.1s ease !important;
  }

  /* Aumenta area click su mobile */
  a, button {
    min-height: 44px !important;
  }
}

/* Accessibility improvements */
@supports (padding: max(0px)) {
  .sticky-mobile-cta {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}

/* Dark/Light theme support */
@media (prefers-color-scheme: light) {
  .sticky-mobile-cta {
    background: linear-gradient(135deg, #e94560 0%, #d63a52 100%);
  }

  .sticky-mobile-cta-text {
    color: white;
  }

  .sticky-mobile-cta-button {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
  }
}
