/**
 * MODERN CHECKOUT DESIGN - Custom Styles
 * PrestaShop Checkout Enhancement
 * Colori originali mantenuti con design moderno
 */

/* ==================== VARIABILI CSS ==================== */
:root {
  /* Colori principali */
  --checkout-primary-bg: #0a1929;
  --checkout-secondary-bg: #132f4c;
  --checkout-card-bg: #1a2332;
  --checkout-accent: #3b82f6;
  --checkout-accent-hover: #2563eb;
  --checkout-accent-light: #60a5fa;
  
  /* Testi */
  --checkout-text-primary: #ffffff;
  --checkout-text-secondary: #94a3b8;
  --checkout-text-muted: #64748b;
  
  /* Stati */
  --checkout-success: #10b981;
  --checkout-warning: #f59e0b;
  --checkout-error: #ef4444;
  
  /* Elementi */
  --checkout-border: rgba(148, 163, 184, 0.2);
  --checkout-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --checkout-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --checkout-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --checkout-shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
  
  /* Transizioni */
  --checkout-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --checkout-transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== CHECKOUT IDENTITY (LOGGED IN) ==================== */
.modern-checkout-identity {
  background: var(--checkout-card-bg);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--checkout-shadow-lg);
  border: 1px solid var(--checkout-border);
  animation: slideInUp 0.4s ease-out;
}

.identity-card {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px;
  background: linear-gradient(135deg, var(--checkout-secondary-bg) 0%, var(--checkout-primary-bg) 100%);
  border-radius: 12px;
  border: 1px solid var(--checkout-border);
  margin-bottom: 24px;
  transition: var(--checkout-transition);
}

.identity-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--checkout-shadow-md);
}

.identity-icon {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--checkout-accent) 0%, var(--checkout-accent-hover) 100%);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
  color: white;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
  }
}

.identity-info {
  flex: 1;
}

.identity-greeting {
  font-size: 14px;
  color: var(--checkout-text-secondary);
  margin: 0 0 4px 0;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.identity-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--checkout-text-primary);
  margin: 0 0 12px 0;
  letter-spacing: -0.5px;
}

.identity-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--checkout-accent-light);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--checkout-transition-fast);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}

.identity-link:hover {
  color: var(--checkout-accent);
  border-bottom-color: var(--checkout-accent);
  gap: 8px;
}

.identity-link svg {
  width: 16px;
  height: 16px;
  transition: var(--checkout-transition-fast);
}

.identity-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.modern-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--checkout-transition);
  cursor: pointer;
}

.modern-logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.modern-logout-btn svg {
  width: 18px;
  height: 18px;
}

.logout-warning {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(245, 158, 11, 0.1);
  color: var(--checkout-text-secondary);
  border-radius: 6px;
  font-size: 13px;
  margin: 0;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.logout-warning svg {
  color: var(--checkout-warning);
  flex-shrink: 0;
}

/* ==================== AUTH TABS ==================== */
.modern-checkout-auth {
  animation: slideInUp 0.4s ease-out;
}

.auth-tabs-wrapper {
  background: var(--checkout-card-bg);
  border-radius: 16px 16px 0 0;
  padding: 8px;
  border: 1px solid var(--checkout-border);
  border-bottom: none;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  background: var(--checkout-primary-bg);
  padding: 6px;
  border-radius: 12px;
}

.auth-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--checkout-text-secondary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--checkout-transition);
  position: relative;
  overflow: hidden;
}

.auth-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--checkout-accent) 0%, var(--checkout-accent-hover) 100%);
  opacity: 0;
  transition: var(--checkout-transition);
  z-index: 0;
}

.auth-tab svg,
.auth-tab span {
  position: relative;
  z-index: 1;
  transition: var(--checkout-transition-fast);
}

.auth-tab:hover {
  color: var(--checkout-text-primary);
}

.auth-tab:hover::before {
  opacity: 0.1;
}

.auth-tab.active {
  color: white;
  box-shadow: var(--checkout-shadow-md);
}

.auth-tab.active::before {
  opacity: 1;
}

.auth-tab svg {
  width: 20px;
  height: 20px;
}

/* ==================== AUTH CONTENT ==================== */
.auth-content {
  background: var(--checkout-card-bg);
  border-radius: 0 0 16px 16px;
  border: 1px solid var(--checkout-border);
  border-top: none;
  padding: 32px;
  box-shadow: var(--checkout-shadow-lg);
}

.auth-panel {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.auth-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-card {
  background: var(--checkout-secondary-bg);
  padding: 32px;
  border-radius: 12px;
  border: 1px solid var(--checkout-border);
}

/* ==================== FORM STYLING ==================== */
.form-card .form-group {
  margin-bottom: 24px;
  animation: slideInUp 0.4s ease-out;
  animation-fill-mode: both;
}

.form-card .form-group:nth-child(1) { animation-delay: 0.05s; }
.form-card .form-group:nth-child(2) { animation-delay: 0.1s; }
.form-card .form-group:nth-child(3) { animation-delay: 0.15s; }
.form-card .form-group:nth-child(4) { animation-delay: 0.2s; }
.form-card .form-group:nth-child(5) { animation-delay: 0.25s; }

.form-card label {
  display: block;
  margin-bottom: 8px;
  color: var(--checkout-text-primary);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.form-card label .required {
  color: var(--checkout-accent-light);
  margin-left: 4px;
}

.form-card input[type="text"],
.form-card input[type="email"],
.form-card input[type="password"],
.form-card input[type="date"],
.form-card select {
  width: 100%;
  padding: 14px 16px;
  background: var(--checkout-card-bg);
  border: 2px solid var(--checkout-border);
  border-radius: 8px;
  color: var(--checkout-text-primary);
  font-size: 15px;
  transition: var(--checkout-transition);
  outline: none;
}

.form-card input[type="text"]::placeholder,
.form-card input[type="email"]::placeholder,
.form-card input[type="password"]::placeholder {
  color: var(--checkout-text-muted);
}

.form-card input:focus,
.form-card select:focus {
  border-color: var(--checkout-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: var(--checkout-primary-bg);
}

.form-card input:hover,
.form-card select:hover {
  border-color: var(--checkout-accent-light);
}

/* Radio buttons e checkbox styling */
.form-card .form-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  cursor: pointer;
  padding: 12px;
  border-radius: 8px;
  transition: var(--checkout-transition-fast);
}

.form-card .form-check:hover {
  background: rgba(59, 130, 246, 0.05);
}

.form-card input[type="radio"],
.form-card input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--checkout-accent);
}

.form-card .form-check-label {
  flex: 1;
  color: var(--checkout-text-secondary);
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
  margin: 0;
}

.form-card .form-check-label a {
  color: var(--checkout-accent-light);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: var(--checkout-transition-fast);
}

.form-card .form-check-label a:hover {
  color: var(--checkout-accent);
  border-bottom-color: var(--checkout-accent);
}

/* Form text / hints */
.form-card .form-text {
  display: block;
  margin-top: 6px;
  color: var(--checkout-text-muted);
  font-size: 13px;
  line-height: 1.4;
}

/* Password toggle */
.form-card .input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.form-card .input-group input {
  flex: 1;
  padding-right: 50px; /* Space for the button */
}

.form-card .input-group-append {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  z-index: 10;
}

.form-card .input-group-append button,
.form-card .password-toggle-btn {
  background: transparent;
  border: none;
  color: var(--checkout-text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: var(--checkout-transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
}

.form-card .input-group-append button:hover,
.form-card .password-toggle-btn:hover {
  color: var(--checkout-accent-light);
  background: rgba(59, 130, 246, 0.1);
}

.form-card .input-group-append button:active,
.form-card .password-toggle-btn:active {
  transform: scale(0.95);
}

.form-card .password-toggle-btn svg {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.form-card .password-toggle-btn .eye-icon {
  transition: var(--checkout-transition-fast);
}

/* Submit buttons */
.form-card button[type="submit"],
.form-card .btn-primary {
  width: 100%;
  padding: 16px;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--checkout-transition);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}

.form-card button[type="submit"]::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.form-card button[type="submit"]:hover::before {
  width: 300px;
  height: 300px;
}

.form-card button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.form-card button[type="submit"]:active {
  transform: translateY(0);
}

/* ==================== ANIMATIONS ==================== */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .modern-checkout-identity,
  .auth-content {
    padding: 20px;
  }
  
  .identity-card {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }
  
  .identity-icon {
    width: 56px;
    height: 56px;
  }
  
  .identity-name {
    font-size: 20px;
  }
  
  .auth-tabs {
    flex-direction: column;
  }
  
  .auth-tab {
    width: 100%;
  }
  
  .form-card {
    padding: 20px;
  }
  
  .identity-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .modern-logout-btn {
    width: 100%;
    justify-content: center;
  }
  
  .logout-warning {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .auth-tab span {
    font-size: 13px;
  }
  
  .auth-tab svg {
    width: 18px;
    height: 18px;
  }
  
  .form-card button[type="submit"] {
    font-size: 14px;
    padding: 14px;
  }
}

/* ==================== UTILITIES ==================== */
.text-center {
  text-align: center;
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

/* ==================== ACCESSIBILITY ==================== */
.form-card input:focus-visible,
.form-card select:focus-visible,
.auth-tab:focus-visible,
.modern-logout-btn:focus-visible {
  outline: 2px solid var(--checkout-accent);
  outline-offset: 2px;
}

/* ==================== DARK MODE ENHANCEMENTS ==================== */
@media (prefers-color-scheme: dark) {
  :root {
    --checkout-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
    --checkout-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.6);
    --checkout-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.7);
    --checkout-shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.8);
  }
}

/* ==================== PAYMENT STEP STYLES ==================== */
.modern-payment-section {
  animation: slideInUp 0.4s ease-out;
}

/* Free order notice */
.free-order-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  color: #10b981;
  font-weight: 600;
  margin-bottom: 24px;
  animation: slideInUp 0.4s ease-out;
}

.free-order-notice svg {
  flex-shrink: 0;
}

/* Payment options container */
.payment-options-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.payment-option-wrapper {
  animation: slideInUp 0.4s ease-out;
  animation-fill-mode: both;
}

.payment-option-wrapper:nth-child(1) { animation-delay: 0.05s; }
.payment-option-wrapper:nth-child(2) { animation-delay: 0.1s; }
.payment-option-wrapper:nth-child(3) { animation-delay: 0.15s; }
.payment-option-wrapper:nth-child(4) { animation-delay: 0.2s; }

.payment-option-card {
  background: var(--checkout-card-bg);
  border: 2px solid var(--checkout-border);
  border-radius: 12px;
  padding: 20px;
  transition: var(--checkout-transition);
  cursor: pointer;
}

.payment-option-card:hover {
  border-color: var(--checkout-accent-light);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}

.payment-option-card:has(input:checked) {
  background: linear-gradient(135deg, var(--checkout-secondary-bg) 0%, var(--checkout-card-bg) 100%);
  border-color: var(--checkout-accent);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.25);
}

.payment-option-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Modern radio button */
.modern-radio {
  position: relative;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.modern-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 24px;
  height: 24px;
  cursor: pointer;
  z-index: 2;
  margin: 0;
}

/* Nascondi il vecchio span radio di PrestaShop */
.modern-radio > span:not(.radio-mark) {
  display: none !important;
}

.modern-radio .radio-mark {
  display: block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--checkout-border);
  border-radius: 50%;
  background: var(--checkout-primary-bg);
  position: relative;
  transition: var(--checkout-transition);
  pointer-events: none;
}

.modern-radio .radio-mark::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--checkout-accent);
  transition: var(--checkout-transition);
}

.modern-radio input[type="radio"]:checked + .radio-mark {
  border-color: var(--checkout-accent);
  background: var(--checkout-card-bg);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.modern-radio input[type="radio"]:checked + .radio-mark::after {
  transform: translate(-50%, -50%) scale(1);
}

.modern-radio input[type="radio"]:hover + .radio-mark {
  border-color: var(--checkout-accent-light);
  background: var(--checkout-secondary-bg);
}

/* Override per custom-radio di PrestaShop */


.payment-option-label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 16px;
  margin: 0;
}

.payment-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--checkout-text-primary);
  flex: 1;
}

.payment-logo {
  max-height: 40px;
  max-width: 120px;
  object-fit: contain;
  flex-shrink: 0;
}

/* No JS form */
.no-js-form {
  display: inline-flex;
}

.selected-badge {
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--checkout-success);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

/* Additional information */
.payment-additional-info {
  margin-top: 12px;
  padding: 16px;
  background: var(--checkout-secondary-bg);
  border-radius: 8px;
  border-left: 3px solid var(--checkout-accent);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    max-height: 500px;
    transform: translateY(0);
  }
}

.payment-form-container {
  margin-top: 12px;
  padding: 20px;
  background: var(--checkout-secondary-bg);
  border-radius: 8px;
  animation: slideDown 0.3s ease-out;
}

/* Stripe and payment forms visibility */
.payment-form-container form {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.payment-form-container iframe {
  display: block !important;
  visibility: visible !important;
  min-height: 300px;
}

/* Stripe specific styles */
.payment-form-container .stripe-form,
.payment-form-container #stripe-card-element,
.payment-form-container .StripeElement {
  background: var(--checkout-card-bg) !important;
  border: 2px solid var(--checkout-border) !important;
  border-radius: 8px !important;
  padding: 14px 16px !important;
  margin: 12px 0 !important;
  min-height: 45px !important;
}

.payment-form-container .StripeElement--focus {
  border-color: var(--checkout-accent) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.payment-form-container .StripeElement--invalid {
  border-color: var(--checkout-error) !important;
}

/* Payment form labels */
.payment-form-container label {
  display: block;
  color: var(--checkout-text-primary);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  margin-top: 16px;
}

.payment-form-container label:first-child {
  margin-top: 0;
}

/* Payment form inputs */
.payment-form-container input[type="text"],
.payment-form-container input[type="email"],
.payment-form-container input[type="tel"],
.payment-form-container select {
  width: 100%;
  padding: 14px 16px;
  background: var(--checkout-card-bg);
  border: 2px solid var(--checkout-border);
  border-radius: 8px;
  color: var(--checkout-text-primary);
  font-size: 15px;
  transition: var(--checkout-transition);
}

.payment-form-container input:focus,
.payment-form-container select:focus {
  border-color: var(--checkout-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

/* Payment form buttons */
.payment-form-container button[type="submit"],
.payment-form-container .btn-primary {
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--checkout-accent) 0%, var(--checkout-accent-hover) 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--checkout-transition);
  margin-top: 16px;
}

.payment-form-container button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Error messages in payment forms */
.payment-form-container .error,
.payment-form-container .alert-danger {
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  color: var(--checkout-error);
  margin-top: 12px;
  font-size: 14px;
}

/* Override ps-hidden for visible payment forms */
.payment-option-card:has(input:checked) ~ .payment-form-container {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  max-height: none !important;
}

/* Ensure payment form shows when radio is checked */
input[type="radio"]:checked ~ .payment-form-container,
.payment-option-wrapper:has(input[type="radio"]:checked) .payment-form-container:not(.ps-hidden) {
  display: block !important;
}

/* No payment alert */
.no-payment-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  color: var(--checkout-error);
  font-weight: 600;
}

.no-payment-alert svg {
  flex-shrink: 0;
}

/* Conditions section */
.conditions-section {
  background: var(--checkout-card-bg);
  border: 1px solid var(--checkout-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.conditions-notice {
  color: var(--checkout-text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

.conditions-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.condition-item {
  animation: slideInUp 0.4s ease-out;
  animation-fill-mode: both;
}

.condition-item:nth-child(1) { animation-delay: 0.05s; }
.condition-item:nth-child(2) { animation-delay: 0.1s; }
.condition-item:nth-child(3) { animation-delay: 0.15s; }

.modern-checkbox-wrapper {
  position: relative;
}

.modern-checkbox-input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}

.modern-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 12px;
  border-radius: 8px;
  transition: var(--checkout-transition-fast);
  margin: 0;
}

.modern-checkbox-label:hover {
  background: rgba(59, 130, 246, 0.05);
}

.checkbox-box {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid var(--checkout-border);
  border-radius: 6px;
  background: var(--checkout-primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--checkout-transition);
  margin-top: 2px;
}

.checkbox-box svg {
  opacity: 0;
  transform: scale(0);
  transition: var(--checkout-transition);
}

.modern-checkbox-input:checked ~ .modern-checkbox-label .checkbox-box {
  background: linear-gradient(135deg, var(--checkout-accent) 0%, var(--checkout-accent-hover) 100%);
  border-color: var(--checkout-accent);
}

.modern-checkbox-input:checked ~ .modern-checkbox-label .checkbox-box svg {
  opacity: 1;
  transform: scale(1);
}

.modern-checkbox-input:hover ~ .modern-checkbox-label .checkbox-box {
  border-color: var(--checkout-accent-light);
}

.checkbox-text {
  flex: 1;
  color: var(--checkout-text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.checkbox-text a {
  color: var(--checkout-accent-light);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: var(--checkout-transition-fast);
}

.checkbox-text a:hover {
  color: var(--checkout-accent);
  border-bottom-color: var(--checkout-accent);
}

/* Final summary wrapper */
.final-summary-wrapper {
  background: var(--checkout-secondary-bg);
  border: 1px solid var(--checkout-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

/* Payment confirmation section */
.payment-confirmation-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modern-confirm-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 32px;
  background: linear-gradient(135deg, var(--checkout-accent) 0%, var(--checkout-accent-hover) 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--checkout-transition);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.modern-confirm-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.modern-confirm-button:hover::before {
  width: 300px;
  height: 300px;
}

.modern-confirm-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.modern-confirm-button:active {
  transform: translateY(0);
}

.modern-confirm-button:disabled {
  background: var(--checkout-border);
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.6;
}

.modern-confirm-button:disabled:hover {
  transform: none;
}

.modern-confirm-button svg {
  position: relative;
  z-index: 1;
  transition: var(--checkout-transition-fast);
}

.modern-confirm-button span {
  position: relative;
  z-index: 1;
}

.modern-confirm-button:hover svg {
  transform: translateX(4px);
}

/* Alert payment conditions */
.alert-payment-conditions {
  display: none;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  color: var(--checkout-text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.alert-payment-conditions.show {
  display: flex;
  animation: slideInUp 0.3s ease-out;
}

.alert-payment-conditions svg {
  color: var(--checkout-warning);
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-payment-conditions a {
  color: var(--checkout-accent-light);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: var(--checkout-transition-fast);
}

.alert-payment-conditions a:hover {
  color: var(--checkout-accent);
  border-bottom-color: var(--checkout-accent);
}

.no-js-label {
  display: block;
  padding: 16px;
  background: var(--checkout-card-bg);
  border: 1px solid var(--checkout-border);
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
}

/* ==================== PAYMENT STEP RESPONSIVE ==================== */
@media (max-width: 768px) {
  .payment-option-card {
    padding: 16px;
  }
  
  .payment-option-header {
    gap: 12px;
  }
  
  .payment-text {
    font-size: 15px;
  }
  
  .payment-logo {
    max-height: 32px;
    max-width: 100px;
  }
  
  .conditions-section,
  .final-summary-wrapper {
    padding: 16px;
  }
  
  .modern-confirm-button {
    padding: 16px 24px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .payment-option-label {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .payment-logo {
    align-self: flex-start;
  }
  
  .modern-confirm-button {
    font-size: 14px;
    padding: 14px 20px;
  }
}

/* ==================== ORDER SUMMARY STYLES ==================== */
.modern-order-summary {
  animation: slideInUp 0.4s ease-out;
}

/* Summary header */
.summary-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--checkout-card-bg);
  border: 2px solid var(--checkout-accent);
  border-radius: 12px;
  margin-bottom: 24px;
  animation: slideInUp 0.4s ease-out;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.summary-header svg {
  flex-shrink: 0;
  color: var(--checkout-accent);
  width: 24px;
  height: 24px;
}

.summary-header h4 {
  margin: 0;
  color: var(--checkout-text-primary);
  font-size: 17px;
  font-weight: 700;
  flex: 1;
}

/* Summary section */
.summary-section {
  background: var(--checkout-card-bg);
  border: 1px solid var(--checkout-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  animation: slideInUp 0.4s ease-out;
  animation-fill-mode: both;
}

.summary-section:nth-child(2) { animation-delay: 0.1s; }
.summary-section:nth-child(3) { animation-delay: 0.15s; }
.summary-section:nth-child(4) { animation-delay: 0.2s; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--checkout-border);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title svg {
  color: var(--checkout-accent);
  flex-shrink: 0;
}

.section-title h4 {
  margin: 0;
  color: var(--checkout-text-primary);
  font-size: 16px;
  font-weight: 700;
}

.step-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid rgba(59, 130, 246, 0.5);
  border-radius: 8px;
  color: var(--checkout-accent-light);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--checkout-transition);
  text-decoration: none;
}

.step-edit:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--checkout-accent);
  color: var(--checkout-accent);
  transform: translateY(-1px);
}

.step-edit svg {
  width: 14px;
  height: 14px;
}

.step-edit i.material-icons {
  display: none;
}



/* FORZA IL GRID LAYOUT */
#delivery-addresses.modern-address-selector-block,
#invoice-addresses.modern-address-selector-block {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 20px !important;
  background: #0f1419;
  padding: 32px;
  border-radius: 16px;
  margin: 24px 0;
}

/* H5 occupa tutta la riga */
#delivery-addresses .modern-address-subtitle,
#invoice-addresses .modern-address-subtitle {
  grid-column: 1 / -1 !important;
  color: #e1e8ed;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

/* OGNI ARTICLE occupa 1 colonna */
#delivery-addresses .address-item,
#invoice-addresses .address-item {
  grid-column: span 1 !important;
  background: linear-gradient(135deg, #1a2332 0%, #0d1520 100%);
  border: 2px solid #2a3f5f;
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Tutti i P occupano tutta la riga */
#delivery-addresses > p,
#invoice-addresses > p {
  grid-column: 1 / -1 !important;
}

/* Selected state */
.address-item.selected {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f2540 100%);
  border-color: #4a9eff;
  box-shadow: 0 8px 24px rgba(74, 158, 255, 0.25);
}

.address-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #4a9eff 0%, #6eb6ff 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.address-item.selected::before {
  opacity: 1;
}

.address-item:hover {
  border-color: #4a9eff;
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(74, 158, 255, 0.2);
}



.address-alias {
  color: #4a9eff;
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 12px 0;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.address {
  color: #c5d3e0;
  font-size: 15px;
  line-height: 1.7;
  font-weight: 500;
}

.address-item header {
  margin-bottom: 0;
  flex: 1;
}

.address-item hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, #2a3f5f 50%, transparent 100%);
  margin: 20px 0 16px;
  opacity: 0.6;
}

.address-footer {
  display: flex;
  gap: 20px;
  align-items: center;
}

.address-footer a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #8ba3bf;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 6px 12px;
  border-radius: 6px;
}

.address-footer a:hover {
  color: #4a9eff;
  background: rgba(74, 158, 255, 0.1);
}

.address-footer a.delete-address:hover {
  color: #ff5555;
  background: rgba(255, 85, 85, 0.1);
}

.address-footer .material-icons {
  font-size: 18px;
}

.modern-address-add a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #4a9eff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  padding: 12px 24px;
  border: 2px dashed #2a3f5f;
  border-radius: 10px;
  transition: all 0.3s ease;
  background: rgba(74, 158, 255, 0.05);
}

.modern-address-add a:hover {
  border-color: #4a9eff;
  background: rgba(74, 158, 255, 0.1);
  transform: translateY(-2px);
}

.modern-address-link a {
  color: #8ba3bf;
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(139, 163, 191, 0.3);
  text-underline-offset: 4px;
  transition: all 0.2s ease;
}

.modern-address-link a:hover {
  color: #4a9eff;
  text-decoration-color: #4a9eff;
}

@media (max-width: 768px) {
  #delivery-addresses.modern-address-selector-block,
  #invoice-addresses.modern-address-selector-block {
    grid-template-columns: 1fr !important;
  }
}

/* Carrier info card */
.carrier-info-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--checkout-primary-bg);
  border: 2px solid var(--checkout-border);
  border-radius: 12px;
  transition: var(--checkout-transition);
  position: relative;
  overflow: hidden;
}

.carrier-info-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--checkout-accent) 0%, var(--checkout-accent-hover) 100%);
}

.carrier-info-card:hover {
  border-color: var(--checkout-accent-light);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.2);
  transform: translateY(-2px);
}

.carrier-logo {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--checkout-card-bg);
  border: 2px solid var(--checkout-border);
  border-radius: 12px;
  padding: 12px;
  transition: var(--checkout-transition);
}

.carrier-info-card:hover .carrier-logo {
  border-color: var(--checkout-accent);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.carrier-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.carrier-logo svg {
  color: var(--checkout-accent);
  width: 40px;
  height: 40px;
}

.carrier-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.carrier-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--checkout-text-primary);
  line-height: 1.3;
}

.carrier-delay {
  font-size: 14px;
  color: var(--checkout-text-secondary);
  line-height: 1.5;
}

.carrier-price-box {
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--checkout-accent) 0%, var(--checkout-accent-hover) 100%);
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
  transition: var(--checkout-transition);
}

.carrier-info-card:hover .carrier-price-box {
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
  transform: scale(1.05);
}

.carrier-price {
  font-size: 19px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
}

/* Products section styles */
.products-section {
  padding: 0;
  background: transparent;
  border: none;
}

/* Override per tabella prodotti con sfondo bianco */
.modern-order-summary .card {
  background: var(--checkout-card-bg) !important;
  border: 1px solid var(--checkout-border) !important;
  color: var(--checkout-text-primary) !important;
}

.modern-order-summary .card-block {
  background: var(--checkout-card-bg) !important;
  color: var(--checkout-text-primary) !important;
}

.modern-order-summary table {
  color: var(--checkout-text-primary) !important;
}

.modern-order-summary table td,
.modern-order-summary table th {
  color: var(--checkout-text-primary) !important;
  border-color: var(--checkout-border) !important;
}

.modern-order-summary .summary-line {
  background: var(--checkout-card-bg) !important;
}

/* ==================== ORDER SUMMARY RESPONSIVE ==================== */
@media (max-width: 768px) {
  .summary-header {
    padding: 16px 20px;
  }
  
  .summary-header h4 {
    font-size: 15px;
  }
  
  .summary-section {
    padding: 16px;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .step-edit {
    width: 100%;
    justify-content: center;
  }
  
  .address-icon {
    width: 40px;
    height: 40px;
    top: 16px;
    right: 16px;
  }
  
  .address-icon svg {
    width: 20px;
    height: 20px;
  }
  
  .address-card .card-block {
    padding: 16px;
  }
  
  .address-card .addresshead {
    font-size: 13px;
    padding-right: 50px;
  }
  
  .address-content {
    font-size: 14px;
  }
  
  .carrier-info-card {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }
  
  .carrier-logo {
    width: 64px;
    height: 64px;
  }
  
  .carrier-details {
    align-items: center;
  }
  
  .carrier-price-box {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .summary-header svg {
    width: 20px;
    height: 20px;
  }
  
  .summary-header h4 {
    font-size: 14px;
  }
  
  .address-cards-row {
    margin: 0;
  }
  
  .address-cards-row .col-md-6 {
    padding: 0 0 16px 0;
  }
  
  .carrier-logo {
    width: 56px;
    height: 56px;
  }
  
  .carrier-name {
    font-size: 15px;
  }
  
  .carrier-price {
    font-size: 17px;
  }
}

/* ==================== PRINT STYLES ==================== */
@media print {
  .modern-checkout-identity,
  .modern-checkout-auth {
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  .auth-tab,
  .modern-logout-btn {
    box-shadow: none;
  }
  
  .payment-option-card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  .address-card,
  .carrier-info-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
  
  .step-edit {
    display: none;
  }
}
/* ======== MIGLIORAMENTO LEGGIBILITÀ TESTI CHECKOUT ======== */

/* Colori di testo principali */
:root {
  --checkout-text-primary: #e9ecf2;   /* colore testo principale più chiaro */
  --checkout-text-secondary: #c5cad5; /* colore testo secondario */
  --checkout-card-bg: #1c2331;        /* sfondo carte (più chiaro del fondo globale) */
  --checkout-primary-bg: #151b27;     /* sfondo principale leggermente più chiaro */
  --checkout-border: #2c3650;         /* bordi più visibili */
  --checkout-accent: #3b82f6;         /* blu acceso */
  --checkout-accent-hover: #2563eb;   /* blu più profondo per hover */
  --checkout-accent-light: #60a5fa;   /* blu chiaro per testo e bordi attivi */
}

/* Migliora contrasto testo nei box */
.modern-order-summary h4,
.modern-order-summary h5,
.modern-order-summary .address-content,
.modern-order-summary .carrier-name,
.modern-order-summary .carrier-delay,
.modern-order-summary .carrier-price {
  color: var(--checkout-text-primary) !important;
}

/* Forza contrasto nei titoli secondari */
.modern-order-summary .section-header h4,
.modern-order-summary .addresshead {
  color: #ffffff !important;
}

/* Sfondo leggermente più chiaro per box indirizzi e spedizione */
.address-card,
.carrier-info-card {
  background: #1b2433 !important;
}

/* Migliora leggibilità testi su sfondo scuro */
.address-content address,
.address-content {
  color: #d9dce2 !important;
}

/* Pulsanti "modifica" */
.step-edit {
  color: #9abaff !important;
  border-color: rgba(59, 130, 246, 0.6) !important;
}
.step-edit:hover {
  color: #ffffff !important;
  border-color: var(--checkout-accent) !important;
}

/* Etichette e titoli */
.section-title h4 {
  color: #f0f3ff !important;
}

/* Evita che gli SVG assumano il colore del testo (quindi troppo scuro) */
.summary-section svg {
  color: var(--checkout-accent) !important;
}
/* ======== FIX RIEPILOGO ORDINE (TABELLA ARTICOLI) ======== */

.modern-order-summary .order-confirmation-table {
  background: var(--checkout-card-bg) !important;
  border: 1px solid var(--checkout-border) !important;
  border-radius: 10px;
  padding: 20px;
  color: var(--checkout-text-primary) !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Colonne della tabella */
.modern-order-summary .order-confirmation-table table {
  width: 100%;
  color: var(--checkout-text-primary) !important;
  background: transparent !important;
}

.modern-order-summary .order-confirmation-table table td {
  color: var(--checkout-text-primary) !important;
  border-color: var(--checkout-border) !important;
  font-size: 15px;
  padding: 10px 0;
}

/* Totali */
.modern-order-summary .order-confirmation-table .font-weight-bold td {
  color: #ffffff !important;
  font-weight: 700;
  border-top: 2px solid var(--checkout-border);
  padding-top: 12px;
}

/* Etichette totali secondarie */
.modern-order-summary .order-confirmation-table .sub td {
  color: var(--checkout-text-secondary) !important;
}

/* Linea divisoria */
.modern-order-summary .order-confirmation-table hr {
  border-color: var(--checkout-border) !important;
  opacity: 0.4;
}

/* Titolo sezione */
.modern-order-summary .card-title.h3 {
  color: #f1f3f7 !important;
  margin-bottom: 16px;
  border-left: 4px solid var(--checkout-accent);
  padding-left: 10px;
}

/* Prezzi e quantità */
.modern-order-summary .order-line .col-xs-5,
.modern-order-summary .order-line .col-xs-2 {
  color: var(--checkout-text-primary) !important;
  font-weight: 600;
}

/* Immagine prodotto */
.modern-order-summary .order-line img {
  border-radius: 8px;
  background: var(--checkout-primary-bg);
  border: 1px solid var(--checkout-border);
  padding: 4px;
}
/* ======== FIX: allineamento blocco "Articoli nell'ordine" ======== */

/* Contenitore principale della sezione */
#order-items {
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin: 0 !important;
}

/* Tabella e box interni centrati */
.modern-order-summary .order-confirmation-table {
  margin: 0 auto;
  width: 100%;
  max-width: calc(100% - 20px);
  border-radius: 12px;
  overflow: hidden;
  box-sizing: border-box;
}

/* Evita che le colonne o immagini facciano "sporgere" il blocco */
.modern-order-summary .order-line {
  margin-right: 0 !important;
  margin-left: 0 !important;
  width: 100%;
  box-sizing: border-box;
}

/* Aggiunge un margine interno coerente al titolo */
#order-items .card-title.h3 {
  padding-left: 8px;
  margin-left: 2px;
  border-left: 4px solid var(--checkout-accent);
}

/* Corregge eventuali bug di Bootstrap o PrestaShop con colonne */
#order-items .col-md-8 {
  flex: 0 0 100%;
  max-width: 100%;
}

/* Allinea visivamente con il pulsante a destra */
#order-items {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ==================== MODERN SHIPPING (ISOLATED) ==================== */

.modern-shipping-wrapper {
  background: var(--checkout-card-bg);
  border: 1px solid var(--checkout-border);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 28px;
  animation: slideInUp 0.4s ease-out;
  box-shadow: 0 4px 12px rgba(59,130,246,0.15);
}

/* Header */
.modern-shipping-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  border-bottom: 2px solid var(--checkout-border);
  padding-bottom: 10px;
}

.modern-shipping-header svg {
  color: var(--checkout-accent);
}

.modern-shipping-title {
  color: var(--checkout-text-primary);
  font-weight: 700;
  font-size: 17px;
  margin: 0;
}

/* Lista opzioni */
.modern-shipping-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modern-shipping-option {
  display: block;
}

.modern-shipping-option input {
  display: none;
}

/* Card */
.modern-shipping-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--checkout-primary-bg);
  border: 1px solid var(--checkout-border);
  border-radius: 12px;
  padding: 18px 24px;
  transition: all 0.25s ease;
  cursor: pointer;
}

.modern-shipping-option.active .modern-shipping-card,
.modern-shipping-card:hover {
  border-color: var(--checkout-accent);
  box-shadow: 0 0 12px rgba(59,130,246,0.25);
  transform: translateY(-2px);
}

/* Radio custom */
.modern-shipping-radio {
  width: 18px;
  height: 18px;
  border: 2px solid var(--checkout-accent-light);
  border-radius: 50%;
  margin-right: 12px;
  position: relative;
  transition: all 0.25s ease;
}

.modern-shipping-option input:checked + .modern-shipping-card .modern-shipping-radio::after,
.modern-shipping-option.active .modern-shipping-radio::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--checkout-accent);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  box-shadow: 0 0 6px var(--checkout-accent);
}

/* Sinistra */
.modern-shipping-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modern-shipping-logo img {
  height: 42px;
  border-radius: 8px;
  background: var(--checkout-card-bg);
  padding: 4px;
  border: 1px solid var(--checkout-border);
}

.modern-shipping-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modern-shipping-name {
  font-weight: 700;
  color: var(--checkout-text-primary);
  font-size: 15px;
}

.modern-shipping-delay {
  color: var(--checkout-text-secondary);
  font-size: 14px;
}

/* Prezzo */
.modern-shipping-price {
  background: linear-gradient(135deg, var(--checkout-accent) 0%, var(--checkout-accent-hover) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 8px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
  white-space: nowrap;
  transition: 0.3s ease;
}

/* Extra contenuti */
.modern-shipping-extra {
  background: var(--checkout-card-bg);
  border: 1px solid var(--checkout-border);
  border-radius: 10px;
  padding: 16px 20px;
  color: var(--checkout-text-primary);
  margin-top: 12px;
}

/* Opzioni extra */
.modern-shipping-options-extra {
  margin-top: 22px;
  background: var(--checkout-primary-bg);
  border: 1px solid var(--checkout-border);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Checkbox custom */
.modern-checkbox {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--checkout-text-primary);
  font-size: 14px;
  cursor: pointer;
}

.modern-checkbox input {
  display: none;
}

.modern-checkbox span {
  width: 18px;
  height: 18px;
  border: 2px solid var(--checkout-accent-light);
  border-radius: 4px;
  position: relative;
  transition: 0.2s ease;
}

.modern-checkbox input:checked + span {
  background: var(--checkout-accent);
  border-color: var(--checkout-accent);
}

.modern-checkbox input:checked + span::after {
  content: '✓';
  position: absolute;
  color: white;
  font-size: 13px;
  left: 3px;
  top: -1px;
}

/* Box messaggio regalo */
.modern-gift-message {
  margin-top: 10px;
  display: none;
}

.modern-gift-message.open {
  display: block;
}

.modern-gift-message textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--checkout-border);
  background: var(--checkout-card-bg);
  color: var(--checkout-text-primary);
  padding: 10px;
}

/* Pulsante continua */
.modern-shipping-continue {
  margin-top: 24px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--checkout-accent) 0%, var(--checkout-accent-hover) 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 16px rgba(59,130,246,0.4);
  width: 100%;
}

.modern-shipping-continue:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59,130,246,0.6);
}

/* Nessun corriere disponibile */
.modern-shipping-alert {
  background: rgba(220, 53, 69, 0.15);
  color: #ff7b84;
  border: 1px solid rgba(220, 53, 69, 0.3);
  border-radius: 10px;
  padding: 16px 20px;
  margin-top: 16px;
}

/* Responsive */
@media (max-width: 768px) {
  .modern-shipping-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .modern-shipping-price {
    align-self: flex-end;
  }
}

/* ==================== MODERN ADDRESS STEP ==================== */

.modern-address-wrapper {
  background: var(--checkout-card-bg);
  border: 1px solid var(--checkout-border);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 28px;
  animation: slideInUp 0.4s ease-out;
  box-shadow: 0 4px 12px rgba(59,130,246,0.15);
}

/* Header */
.modern-address-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid var(--checkout-border);
  margin-bottom: 20px;
  padding-bottom: 10px;
}

.modern-address-header svg {
  color: var(--checkout-accent);
}

.modern-address-title {
  color: var(--checkout-text-primary);
  font-weight: 700;
  font-size: 17px;
  margin: 0;
}

/* Subtitle */
.modern-address-subtitle {
  color: var(--checkout-text-primary);
  font-size: 15px;
  font-weight: 700;
  margin: 16px 0 10px;
}

/* Note */
.modern-address-note {
  color: var(--checkout-text-secondary);
  font-size: 14px;
  margin-bottom: 18px;
}

/* Blocchi indirizzi */
.modern-address-selector-block,
.modern-address-form {
  background: var(--checkout-primary-bg);
  border: 1px solid var(--checkout-border);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 20px;
  transition: all 0.25s ease;
}

.modern-address-selector-block:hover {
  border-color: var(--checkout-accent);
  box-shadow: 0 4px 12px rgba(59,130,246,0.2);
}

/* Alert */
.modern-address-alert {
  background: rgba(220,53,69,0.1);
  color: #ff7b84;
  border: 1px solid rgba(220,53,69,0.3);
  border-radius: 10px;
  padding: 10px 16px;
  margin-top: 10px;
}

/* Link aggiungi nuovo indirizzo */
.modern-address-add a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--checkout-accent);
  font-weight: 600;
  text-decoration: none;
  margin-top: 10px;
  transition: color 0.3s ease;
}

.modern-address-add a:hover {
  color: var(--checkout-accent-hover);
}

/* Link secondario */
.modern-address-link a {
  font-size: 14px;
  color: var(--checkout-text-secondary);
  text-decoration: underline;
}

/* Footer */
.modern-address-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

/* Pulsante continua */
.modern-address-continue {
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--checkout-accent) 0%, var(--checkout-accent-hover) 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 16px rgba(59,130,246,0.4);
}

.modern-address-continue:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59,130,246,0.6);
}

/* Responsive */
@media (max-width: 768px) {
  .modern-address-wrapper {
    padding: 20px;
  }
  .modern-address-continue {
    width: 100%;
  }
}

/* ==================== MODERN CHECKBOX FIX ==================== */

.modern-checkbox-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--checkout-accent-light);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  background: var(--checkout-card-bg);
}

.modern-checkbox-wrapper:hover {
  border-color: var(--checkout-accent);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

/* Nascondi input reale, ma mantiene la funzionalità */
.modern-checkbox-input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 2;
}

/* Box che contiene la spunta SVG */
.checkbox-box {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: all 0.3s ease;
}

.checkbox-box svg {
  opacity: 0;
  transform: scale(0.5);
  stroke: white;
  transition: all 0.25s ease;
}

/* Stato attivo (quando è spuntato) */
.modern-checkbox-input:checked + .checkbox-box {
  background: var(--checkout-accent);
  border-color: var(--checkout-accent);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.modern-checkbox-input:checked + .checkbox-box svg {
  opacity: 1;
  transform: scale(1);
}

/* Etichetta testo accanto */
.modern-checkbox-label {
  margin-left: 10px;
  color: var(--checkout-text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

/* Lista condizioni */
.conditions-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.condition-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--checkout-primary-bg);
  border: 1px solid var(--checkout-border);
  border-radius: 10px;
  padding: 12px 16px;
  transition: all 0.25s ease;
}

.condition-item:hover {
  border-color: var(--checkout-accent);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.condition-label a {
  color: var(--checkout-accent-light);
  text-decoration: underline;
}


/* ============== CTA RIPPLE WHITE (ISOLATED) ============== */
.cta-ripple-white {
  position: relative;
  overflow: hidden;                 /* tiene il ripple dentro il bordo */
  isolation: isolate;               /* evita di “bucare” lo sfondo */
  border: 0;
  border-radius: 12px;
  padding: 14px 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  box-shadow: 0 0 20px rgba(59,130,246,0.30);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
  z-index: 0;                       /* il ripple sta sotto al contenuto */
}

/* testo e icone sempre sopra il ripple */
.cta-ripple-white > * { position: relative; z-index: 2; }

/* disinnesca qualunque pseudo-elemento ereditato */
.cta-ripple-white::before { content: none !important; }

/* RIPPLE bianco luminoso (centrato) */
.cta-ripple-white::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;

  /* luce bianca che si fonde col blu */
  background: radial-gradient(circle,
              rgba(255,255,255,0.85) 0%,
              rgba(255,255,255,0.55) 35%,
              rgba(255,255,255,0.00) 72%);
  mix-blend-mode: screen;           /* ❤️ niente nero, effetto “luce” */
  opacity: 0;
  transition: none;
}

/* espansione al click */
.cta-ripple-white:active::after {
  width: 340%;
  height: 340%;
  opacity: 1;
  transition: width .45s ease, height .45s ease, opacity .9s ease;
}

/* hover gradevole */
.cta-ripple-white:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 26px rgba(59,130,246,0.50);
}

/* stato disabilitato */
.cta-ripple-white[disabled],
.cta-ripple-white:disabled {
  background: #374151 !important;
  color: #9ca3af !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* utenti che preferiscono meno animazioni */
@media (prefers-reduced-motion: reduce) {
  .cta-ripple-white,
  .cta-ripple-white:active::after {
    transition: none !important;
  }
}
/* ==================== MODERN SUMMARY CARD ==================== */
.summary-modern-card {
  background: linear-gradient(180deg, rgba(15,25,45,0.96) 0%, rgba(5,10,25,0.98) 100%);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(37,99,235,0.15);
  padding: 24px 22px;
  color: #f3f4f6;
  position: sticky;
  top: 1.5rem;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.summary-modern-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(59,130,246,0.35);
}

/* Header e contenitore principale */
.summary-modern-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Numero articoli */
.summary-modern-count {
  font-size: 14px;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 0.8rem;
}

/* Lista prodotti */
.summary-modern-product-list {
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  padding: 10px 14px;
}

.summary-modern-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.summary-modern-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.summary-modern-line:last-child {
  border-bottom: none;
}

/* Subtotali */
.summary-modern-subtotals {
  margin-top: 10px;
}

.summary-modern-subline {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 4px 0;
}

.summary-modern-label {
  color: #cbd5e1;
}

.summary-modern-value {
  color: #fff;
  font-weight: 600;
}

/* Voucher */
.summary-modern-voucher {
  margin-top: 14px;
  background: rgba(59,130,246,0.08);
  border-radius: 10px;
  padding: 10px 14px;
}

/* Separatore */
.summary-modern-separator {
  border: none;
  height: 1px;
  margin: 1rem 0;
  background: linear-gradient(90deg, rgba(59,130,246,0.5), rgba(59,130,246,0));
}

/* Totale finale */
.summary-modern-totals {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  background: linear-gradient(90deg, rgba(59,130,246,0.12) 0%, rgba(37,99,235,0.05) 100%);
  padding: 14px 18px;
  border-radius: 12px;
}

.summary-modern-totals .summary-modern-label {
  color: #a5b4fc;
}

.summary-modern-totals .summary-modern-value {
  color: #fff;
  font-weight: 700;
}

/* Responsive */
@media (max-width: 992px) {
  .summary-modern-card {
    position: relative;
    top: 0;
    margin-top: 1rem;
  }
}
/* ========== IMMAGINI PRODOTTI NELLA CARD ========== */
.summary-modern-product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary-modern-thumb {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-modern-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.summary-modern-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-modern-name {
  font-size: 13px;
  font-weight: 500;
  color: #f9fafb;
  line-height: 1.3;
}

.summary-modern-qty {
  font-size: 12px;
  color: #9ca3af;
}

.summary-modern-price {
  font-weight: 600;
  color: #ffffff;
  font-size: 13px;
  white-space: nowrap;
}

/* --- FORZA L'ALLINEAMENTO DEI PREZZI A DESTRA --- */
.summary-modern-card .summary-modern-subline,
.summary-modern-card .cart-summary-subtotals,
.summary-modern-card .cart-summary-line {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100%;
}

/* Prezzi sempre a destra */
.summary-modern-card .summary-modern-value,
.summary-modern-card .cart-summary-subtotals .value,
.summary-modern-card .cart-summary-line .value {
  text-align: right !important;
  min-width: 90px;
  font-weight: 600;
  color: #fff;
}

/* --- AUMENTA SPAZIO E VISIBILITÀ TRA TOTALE E PREZZO --- */
.summary-modern-card .summary-modern-totals,
.summary-modern-card .cart-summary-totals {
  margin-top: 1.2rem !important;
  padding: 18px 20px !important;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(59,130,246,0.12), rgba(37,99,235,0.05)) !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

/* Etichetta totale */
.summary-modern-card .summary-modern-totals .summary-modern-label,
.summary-modern-card .cart-summary-totals .label {
  color: #a5b4fc;
  font-weight: 600;
  font-size: 15px;
}

/* Prezzo totale (più grande e chiaro) */
.summary-modern-card .summary-modern-totals .summary-modern-value,
.summary-modern-card .cart-summary-totals .value {
  color: #ffffff;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.3px;
}

/* --- SPAZIO EXTRA SOPRA LA SEZIONE IVA --- */
.summary-modern-card .summary-modern-subtotals,
.summary-modern-card .cart-summary-subtotals {
  margin-top: 1.2rem !important;
  padding-top: 0.8rem !important;
  border-top: 1px solid rgba(255,255,255,0.05);
}
/* ======= Riquadro Totale a larghezza piena ======= */
.summary-modern-card .cart-summary-totals {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 1.2rem !important;
  padding: 18px 20px !important;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(59,130,246,0.12), rgba(37,99,235,0.05)) !important;
  width: 100% !important;
  box-sizing: border-box;
}

/* Ogni riga dentro la sezione Totali */
.summary-modern-card .cart-summary-totals .cart-summary-line {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100%;
  padding: 4px 0;
}

/* Etichette e valori */
.summary-modern-card .cart-summary-totals .label {
  color: #a5b4fc;
  font-weight: 600;
  font-size: 15px;
}

.summary-modern-card .cart-summary-totals .value {
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  text-align: right;
  letter-spacing: 0.3px;
}
/* ======= ALLINEAMENTO FINALE PREZZI ======= */
.summary-modern-card .cart-summary-totals {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  padding: 18px 20px !important;
  margin-top: 1.2rem !important;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(59,130,246,0.12), rgba(37,99,235,0.05)) !important;
  box-sizing: border-box;
}

.summary-modern-card .cart-summary-totals .cart-summary-line {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
  padding: 4px 0 !important;
  margin: 0 !important;
}

/* Etichette */
.summary-modern-card .cart-summary-totals .label {
  flex: 1 !important;
  text-align: left !important;
  color: #a5b4fc !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  white-space: nowrap !important;
}

/* Prezzi allineati perfettamente a destra */
.summary-modern-card .cart-summary-totals .value {
  flex: 0 0 90px !important;
  text-align: right !important;
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 17px !important;
  letter-spacing: 0.3px !important;
  margin-left: auto !important;
}

/* Correzione eventuali allineamenti residui */
.summary-modern-card .cart-summary-totals .cart-summary-line > * {
  vertical-align: middle !important;
}
@media (max-width: 576px) {
  /* Rende i pulsanti Modifica più coerenti e centrati su mobile */
  .step-edit.text-muted {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 130px;               /* ✅ pulsante a tutta larghezza */
    margin-top: 10px;
    padding: 10px 0;
    border: 1px solid #2a63ff;
    border-radius: 8px;
    background: rgba(42, 99, 255, 0.1);
    color: #d1dbff !important;
    font-weight: 500;
    font-size: 14px;
    text-transform: none;
    transition: all 0.25s ease;
    box-sizing: border-box;
	text-align:center;
  }

  .step-edit.text-muted i.material-icons {
    font-size: 16px;
    margin-right: 6px;
    color: #9ab3ff;
    transition: color 0.3s ease;
  }

  /* Hover (solo se toccato/attivo) */
  .step-edit.text-muted:hover,
  .step-edit.text-muted:active {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    border-color: #3b82f6;
    color: #fff !important;
  }

  .step-edit.text-muted:hover i.material-icons,
  .step-edit.text-muted:active i.material-icons {
    color: #fff;
  }

  /* Migliora l’allineamento dei blocchi */
  .checkout-step,
  .step-title {
    flex-direction: column;
    align-items: flex-start;
  }
}
/* Fix per select Provincia e Nazione tagliati */
.modern-address-form .form-control-select {
    width: 100% !important;
    max-width: 100%;
    padding: 10px 12px;
    background-color: #0a1929;
    color: #fff;
    border: 1px solid #1e3a5f;
    border-radius: 4px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Fix per la colonna dei select */
.modern-address-form .js-input-column {
    width: 100%;
    padding: 0 15px;
}

/* Migliorare visibilità bottoni */
.modern-form-actions {
    display: flex;
    gap: 15px;
    padding: 20px 0;
    justify-content: flex-start;
    margin-top: 20px;
}

.modern-btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-block;
}

.modern-btn-primary {
    background-color: #0066cc;
    color: #ffffff !important;
    border: 2px solid #0066cc;
}

.modern-btn-primary:hover {
    background-color: #0052a3;
    border-color: #0052a3;
}

.modern-btn-secondary {
    background-color: transparent;
    color: #ffffff !important;
    border: 2px solid #ffffff;
}

.modern-btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Fix per checkbox in basso */
.modern-checkbox-group {
    margin: 20px 0;
}

.modern-checkbox-text {
    color: #ffffff;
    margin-left: 8px;
}

/* Responsive per mobile */
@media (max-width: 768px) {
    .modern-form-actions {
        flex-direction: column;
    }
    
    .modern-btn {
        width: 100%;
        text-align: center;
    }
}
/* Nascondi di default il form PayPal */
#pay-with-payment-option-4-form {
    display: none;
}

/* Mostra il form PayPal quando il radio button è selezionato */
#payment-option-4:checked ~ #pay-with-payment-option-4-form,
#payment-option-4:checked ~ * #pay-with-payment-option-4-form,
input[data-module-name="ps_checkout"]:checked ~ #pay-with-payment-option-4-form,
input[data-module-name="ps_checkout"]:checked ~ * #pay-with-payment-option-4-form {
    display: block !important;
}

/* Alternativa: se il radio è dentro un label/div e il form è fuori */
.payment-option:has(#payment-option-4:checked) ~ #pay-with-payment-option-4-form,
.payment-options:has(#payment-option-4:checked) #pay-with-payment-option-4-form {
    display: block !important;
}

/* Container principale del form PayPal */
#ps_checkout-card-fields-form {
    padding: 20px;
    background: #fff;
    border-radius: 4px;
    position: relative;
    z-index: 1;
}

/* Loader */
#ps_checkout-card-fields-form-loader {
    text-align: center;
    padding: 40px;
}

#ps_checkout-card-fields-form-loader img {
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Labels */
#ps_checkout-card-fields-form .form-control-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

/* Wrapper dei campi */
#ps_checkout-card-fields-name,
#ps_checkout-card-fields-number,
#ps_checkout-card-fields-expiry,
#ps_checkout-card-fields-cvv {
    margin-bottom: 15px;
    position: relative;
    min-height: 50px;
}

/* Container iframe - stilizzazione */
#ps_checkout-card-fields-name > div,
#ps_checkout-card-fields-number > div,
#ps_checkout-card-fields-expiry > div,
#ps_checkout-card-fields-cvv > div {
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: #fff;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    height: 50px;
    overflow: visible;
}

/* Hover effects */
#ps_checkout-card-fields-name > div:hover,
#ps_checkout-card-fields-number > div:hover,
#ps_checkout-card-fields-expiry > div:hover,
#ps_checkout-card-fields-cvv > div:hover {
    border-color: #0070ba;
    box-shadow: 0 0 0 1px #0070ba;
}

/* Focus effects */
#ps_checkout-card-fields-name > div:focus-within,
#ps_checkout-card-fields-number > div:focus-within,
#ps_checkout-card-fields-expiry > div:focus-within,
#ps_checkout-card-fields-cvv > div:focus-within {
    border-color: #0070ba;
    box-shadow: 0 0 0 2px rgba(0, 112, 186, 0.2);
}

/* Iframe styling - rendi cliccabili */
#ps_checkout-card-fields-name iframe,
#ps_checkout-card-fields-number iframe,
#ps_checkout-card-fields-expiry iframe,
#ps_checkout-card-fields-cvv iframe {
    position: relative;
    z-index: 3;
    display: block;
    width: 100%;
    height: 50px;
    border: none;
    background: transparent;
}

/* Forza visibilità iframe PayPal */
#ps_checkout-card-fields-form iframe[name*="paypal_card"] {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Nascondi iframe di rilevamento */
iframe[name*="__detect_close"] {
    display: none !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

/* Row per expiry e CVV */
#ps_checkout-card-fields-form .row {
    display: flex;
    margin: 0 -10px;
}

#ps_checkout-card-fields-form .col-xs-6,
#ps_checkout-card-fields-form .col-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 10px;
    box-sizing: border-box;
}

/* CVV Label wrapper */
.ps_checkout-card-fields-cvv-label-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.ps_checkout-info-wrapper {
    position: relative;
    display: inline-block;
}

.ps_checkout-info-button {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0070ba;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    transition: background 0.3s ease;
    line-height: 1;
}

.ps_checkout-info-button:hover {
    background: #005a94;
}

/* CVV Popup - funziona solo con :hover in CSS puro */
.popup-content {
    display: none;
    position: absolute;
    left: 30px;
    top: -10px;
    background: white;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    padding: 15px;
    width: 280px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    font-size: 13px;
    line-height: 1.5;
}

.ps_checkout-info-button:hover + .popup-content,
.ps_checkout-info-wrapper:hover .popup-content {
    display: block;
}

.popup-content img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
    border-radius: 4px;
}

.popup-content b {
    color: #0070ba;
}

/* Messaggi di errore */
#ps_checkout-card-fields-form .alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 13px;
}

#ps_checkout-card-fields-form .alert-danger.hidden {
    display: none;
}

/* Nascondi il pulsante submit */
#pay-with-payment-option-4 {
    display: none;
}

/* Icona Mastercard sotto expiry */
#ps_checkout-card-fields-form .row img[alt*="card"],
#ps_checkout-card-fields-form .row img[src*="mastercard"] {
    margin-top: 5px;
    max-width: 40px;
    height: auto;
}

/* Responsive */
@media (max-width: 768px) {
    #ps_checkout-card-fields-form {
        padding: 15px;
    }
    
    #ps_checkout-card-fields-form .row {
        flex-direction: column;
    }
    
    #ps_checkout-card-fields-form .col-xs-6,
    #ps_checkout-card-fields-form .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 0;
        margin-bottom: 15px;
    }
    
    .popup-content {
        left: auto;
        right: 0;
        top: 25px;
        width: 250px;
    }
}

/* Fix per il lightbox PayPal */
#payments-sdk__contingency-lightbox {
    pointer-events: none;
}

/* Assicurati che il container sia visibile */
#pay-with-payment-option-4-form > div {
    display: block;
}

/* HEADER CONFERMA ORDINE */
.card-title.h1 {
    background: linear-gradient(135deg, #1e4d7b 0%, #0a1929 100%);
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 5px solid #4CAF50;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.card-title.h1 i.material-icons {
    color: #4CAF50;
    font-size: 48px;
    vertical-align: middle;
    margin-right: 15px;
    animation: checkPulse 2s infinite;
}

@keyframes checkPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.card-title.h1,
.card-title.h1 + p {
    color: #ffffff;
    font-weight: 600;
}

/* SEZIONI PRINCIPALI */
.tvorder-conformation-wrapper {
    margin-top: 30px;
}

.page-order-confirmation.card,
.card.definition-list {
    background: linear-gradient(135deg, #0d2137 0%, #0a1929 100%);
    border: 1px solid #1e3a5f;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.card-block {
    padding: 30px;
}

/* TITOLI SEZIONI */
.card-title.h3,
.h3.card-title {
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #1e3a5f;
    position: relative;
}

.card-title.h3::after,
.h3.card-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, #0066cc, #00a8ff);
}

/* ARTICOLI NELL'ORDINE */
.order-confirmation-table {
    background: rgba(30, 58, 95, 0.3);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.order-line {
    padding: 15px 0;
}

.order-line .image img {
    border-radius: 8px;
    border: 2px solid #1e3a5f;
    max-width: 100%;
    transition: transform 0.3s ease;
}

.order-line .image img:hover {
    transform: scale(1.05);
}

.order-line .details span {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    display: block;
    margin-top: 10px;
}

.order-line .qty {
    color: #ffffff;
    font-size: 16px;
}

.order-line .qty .bold {
    font-weight: 700;
    color: #00a8ff;
}

.order-confirmation-table hr {
    border-top: 1px solid #1e3a5f;
    margin: 20px 0;
}

/* TABELLA TOTALI */
.order-confirmation-table table {
    width: 100%;
    margin-top: 20px;
}

.order-confirmation-table table td {
    padding: 12px 15px;
    color: #ffffff;
    border-bottom: 1px solid rgba(30, 58, 95, 0.5);
}

.order-confirmation-table table td:last-child {
    text-align: right;
    font-weight: 600;
}

.order-confirmation-table table tr.font-weight-bold td {
    background: linear-gradient(90deg, rgba(0, 102, 204, 0.2), rgba(0, 168, 255, 0.2));
    font-size: 18px;
    font-weight: 700;
    color: #00a8ff;
    border-bottom: none;
    border-radius: 4px;
}

.order-confirmation-table table tr.sub td {
    font-size: 14px;
    opacity: 0.8;
}

/* DETTAGLI ORDINE */
#order-details {
    background: rgba(30, 58, 95, 0.3);
    border-radius: 8px;
    padding: 25px;
    height: fit-content;
}

#order-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#order-details ul li {
    color: #ffffff;
    padding: 12px 15px;
    margin-bottom: 10px;
    background: rgba(10, 25, 41, 0.5);
    border-left: 3px solid #0066cc;
    border-radius: 4px;
    font-size: 15px;
}

#order-details ul li em {
    color: #00a8ff;
    font-style: italic;
    display: block;
    margin-top: 5px;
    font-size: 13px;
}

/* SEZIONE BONIFICO */
.definition-list .card-block p {
    color: #ffffff;
    line-height: 1.8;
    margin-bottom: 20px;
}

.definition-list dl {
    background: rgba(30, 58, 95, 0.3);
    border-radius: 8px;
    padding: 25px;
    margin: 25px 0;
}

.definition-list dt {
    color: #00a8ff;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 15px;
    margin-bottom: 8px;
}

.definition-list dt:first-child {
    margin-top: 0;
}

.definition-list dd {
    color: #ffffff;
    font-size: 16px;
    padding: 12px 15px;
    background: rgba(10, 25, 41, 0.5);
    border-left: 3px solid #0066cc;
    border-radius: 4px;
    margin-left: 0;
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
}

.definition-list strong {
    display: block;
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.1));
    color: #4CAF50;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
    margin: 25px 0;
    font-size: 16px;
}

.definition-list a {
    color: #00a8ff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.definition-list a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .card-block {
        padding: 20px;
    }
    
    .card-title.h1 {
        padding: 20px;
    }
    
    .card-title.h1 i.material-icons {
        font-size: 36px;
    }
    
    #order-details {
        margin-top: 30px;
    }
    
    .order-line .details span {
        margin-top: 5px;
        font-size: 14px;
    }
}

/* ANIMAZIONI EXTRA */
.card {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.order-line {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* OTTIMIZZAZIONI MOBILE AVANZATE */

/* Tablet e mobile grande */
@media (max-width: 991px) {
    .card-block {
        padding: 20px 15px;
    }
    
    .tvorder-conformation-wrapper {
        margin-top: 20px;
    }
    
    #order-items,
    #order-details {
        margin-bottom: 20px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Header conferma */
    .card-title.h1 {
        padding: 20px 15px;
        font-size: 22px;
        text-align: center;
    }
    
    .card-title.h1 i.material-icons {
        font-size: 36px;
        display: block;
        margin: 0 auto 10px;
    }
    
    .card-title.h1 + p {
        font-size: 14px;
        text-align: center;
    }
    
    /* Titoli sezioni */
    .card-title.h3,
    .h3.card-title {
        font-size: 20px;
        margin-bottom: 20px;
        padding-bottom: 10px;
    }
    
    /* Articoli ordine */
    .order-confirmation-table {
        padding: 15px 10px;
    }
    
    .order-line {
        padding: 15px 0;
    }
    
    .order-line .col-sm-2,
    .order-line .col-xs-3 {
        flex: 0 0 30%;
        max-width: 30%;
    }
    
    .order-line .col-sm-4,
    .order-line .col-xs-9 {
        flex: 0 0 70%;
        max-width: 70%;
    }
    
    .order-line .details span {
        font-size: 14px;
        line-height: 1.4;
        margin-top: 5px;
    }
    
    .order-line .qty {
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #1e3a5f;
    }
    
    .order-line .qty .row {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .order-line .qty .col-xs-5,
    .order-line .qty .col-xs-2 {
        flex: 0 0 auto;
        font-size: 14px;
    }
    
    /* Tabella totali */
    .order-confirmation-table table {
        font-size: 14px;
    }
    
    .order-confirmation-table table td {
        padding: 10px 5px;
        display: block;
        width: 100%;
        border: none;
    }
    
    .order-confirmation-table table td:first-child {
        font-weight: 600;
        margin-bottom: 5px;
    }
    
    .order-confirmation-table table td:last-child {
        text-align: left;
        margin-bottom: 15px;
        font-size: 16px;
    }
    
    .order-confirmation-table table tr.font-weight-bold td {
        background: linear-gradient(90deg, rgba(0, 102, 204, 0.3), rgba(0, 168, 255, 0.3));
        padding: 15px 10px;
        margin-bottom: 0;
    }
    
    .order-confirmation-table table tr.font-weight-bold td:first-child {
        margin-bottom: 5px;
    }
    
    /* Dettagli ordine */
    #order-details {
        padding: 20px 15px;
        margin-top: 20px;
    }
    
    #order-details ul li {
        padding: 12px;
        font-size: 14px;
        word-wrap: break-word;
    }
    
    /* Sezione bonifico */
    .definition-list .card-block {
        padding: 20px 15px;
    }
    
    .definition-list .card-block p {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .definition-list dl {
        padding: 15px;
    }
    
    .definition-list dt {
        font-size: 12px;
        margin-top: 15px;
    }
    
    .definition-list dd {
        font-size: 13px;
        padding: 10px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .definition-list strong {
        padding: 12px 15px;
        font-size: 14px;
        line-height: 1.5;
    }
}

/* Mobile piccolo */
@media (max-width: 576px) {
    .card-title.h1 {
        font-size: 18px;
        padding: 15px 10px;
    }
    
    .card-title.h1 i.material-icons {
        font-size: 32px;
    }
    
    .card-block {
        padding: 15px 10px;
    }
    
    .card-title.h3,
    .h3.card-title {
        font-size: 18px;
    }
    
    /* Immagine prodotto più grande su mobile piccolo */
    .order-line .col-sm-2,
    .order-line .col-xs-3 {
        flex: 0 0 35%;
        max-width: 35%;
    }
    
    .order-line .col-sm-4,
    .order-line .col-xs-9 {
        flex: 0 0 65%;
        max-width: 65%;
    }
    
    .order-line .details span {
        font-size: 13px;
    }
    
    .order-line .qty {
        font-size: 13px;
    }
    
    /* Stack completo per prezzi */
    .order-line .qty .row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .order-line .qty .col-xs-5:first-child::before {
        content: 'Prezzo: ';
        font-weight: 600;
        color: #00a8ff;
    }
    
    .order-line .qty .col-xs-2::before {
        content: 'Quantità: ';
        font-weight: 600;
        color: #00a8ff;
    }
    
    .order-line .qty .col-xs-5.bold::before {
        content: 'Totale: ';
        font-weight: 600;
        color: #00a8ff;
    }
    
    /* Tabella totali più compatta */
    .order-confirmation-table table td {
        padding: 8px 5px;
        font-size: 13px;
    }
    
    .order-confirmation-table table td:last-child {
        font-size: 15px;
    }
    
    .order-confirmation-table table tr.font-weight-bold td {
        padding: 12px 10px;
        font-size: 16px;
    }
    
    /* Dettagli ordine */
    #order-details {
        padding: 15px 10px;
    }
    
    #order-details ul li {
        padding: 10px;
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    /* Sezione bonifico */
    .definition-list dl {
        padding: 12px;
    }
    
    .definition-list dt {
        font-size: 11px;
    }
    
    .definition-list dd {
        font-size: 12px;
        padding: 8px;
    }
    
    .definition-list strong {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Mobile extra piccolo (iPhone SE, etc) */
@media (max-width: 375px) {
    .card-title.h1 {
        font-size: 16px;
        padding: 12px 8px;
    }
    
    .card-title.h1 i.material-icons {
        font-size: 28px;
        margin-bottom: 8px;
    }
    
    .card-block {
        padding: 12px 8px;
    }
    
    .order-confirmation-table {
        padding: 10px 5px;
    }
    
    .order-line .details span {
        font-size: 12px;
    }
    
    .definition-list dd {
        font-size: 11px;
        padding: 8px;
        line-height: 1.4;
    }
}

/* Orientamento landscape su mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .card-title.h1 {
        padding: 15px 20px;
    }
    
    .card-title.h1 i.material-icons {
        display: inline-block;
        margin: 0 10px 0 0;
        vertical-align: middle;
    }
    
    .order-line .col-sm-2,
    .order-line .col-xs-3 {
        flex: 0 0 20%;
        max-width: 20%;
    }
    
    .order-line .col-sm-4,
    .order-line .col-xs-9 {
        flex: 0 0 40%;
        max-width: 40%;
    }
    
    .order-line .qty {
        flex: 0 0 40%;
        max-width: 40%;
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }
}

/* Touch-friendly - aumenta area tap */
@media (hover: none) and (pointer: coarse) {
    .definition-list a {
        padding: 10px 5px;
        display: inline-block;
        min-height: 44px;
        line-height: 1.5;
    }
    
    .order-line .image img {
        border-width: 1px;
    }
}

/* Migliora leggibilità su schermi piccoli */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .order-confirmation-table,
    #order-details,
    .definition-list dl {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    /* Padding laterale consistente */
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .row > [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* SEZIONE BONIFICO BANCARIO - REDESIGN COMPLETO CON !IMPORTANT - FIXED */

.definition-list dl {
    background: transparent !important;
    padding: 0 !important;
    margin: 30px 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 15px !important;
}

/* Ogni coppia dt/dd diventa una card */
.definition-list dt {
    display: none !important; /* Nascondiamo il dt */
}

.definition-list dd {
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.4) 0%, rgba(10, 25, 41, 0.6) 100%) !important;
    border: 1px solid #1e3a5f !important;
    border-left: 4px solid #0066cc !important;
    border-radius: 12px !important;
    padding: 20px 25px !important;
    margin: 0 !important;
    font-family: inherit !important;
    position: relative !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    color: #ffffff !important;
    opacity: 1 !important; /* IMPORTANTE: sempre visibile */
    display: block !important; /* IMPORTANTE: forza display block */
}

.definition-list dd:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.3) !important;
    border-left-color: #00a8ff !important;
}

/* Aggiungiamo i titoli con ::before */
.definition-list dd::before {
    content: attr(data-label) !important;
    display: block !important;
    color: #00a8ff !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin-bottom: 10px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Icone per ogni tipo di info */
.definition-list dd:nth-of-type(1)::before {
    content: '💰 IMPORTO' !important;
}

.definition-list dd:nth-of-type(2)::before {
    content: '🏢 BENEFICIARIO' !important;
}

.definition-list dd:nth-of-type(3)::before {
    content: '🔐 DETTAGLI BANCARI' !important;
}

.definition-list dd:nth-of-type(4)::before {
    content: '🏦 ISTITUTO BANCARIO' !important;
}

/* Stile speciale per l'importo */
.definition-list dd:nth-of-type(1) {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3) 0%, rgba(56, 142, 60, 0.2) 100%) !important;
    border-left-color: #4CAF50 !important;
    font-size: 32px !important;
    font-weight: 700 !important;
    color: #4CAF50 !important;
    text-align: center !important;
    padding: 25px !important;
}

/* Stile per beneficiario */
.definition-list dd:nth-of-type(2) {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    text-align: center !important;
}

/* Stile speciale per IBAN e BIC */
.definition-list dd:nth-of-type(3) {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.3) 0%, rgba(0, 168, 255, 0.2) 100%) !important;
    border-left-color: #00a8ff !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 14px !important;
    line-height: 2 !important;
    color: #ffffff !important;
}

.definition-list dd:nth-of-type(3) br {
    display: block !important;
    content: "" !important;
    margin: 8px 0 !important;
}

/* Stile per istituto bancario */
.definition-list dd:nth-of-type(4) {
    color: #ffffff !important;
    font-size: 14px !important;
}

/* Evidenzia IBAN e BIC */
.definition-list dd:nth-of-type(3)::after {
    content: '📋 Clicca per copiare' !important;
    display: block !important;
    margin-top: 15px !important;
    padding-top: 15px !important;
    border-top: 1px solid rgba(0, 168, 255, 0.3) !important;
    font-size: 11px !important;
    color: #00a8ff !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    text-align: center !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.definition-list dd:nth-of-type(3):hover::after {
    opacity: 1 !important;
}

.definition-list dd:nth-of-type(3):hover {
    cursor: pointer !important;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.4) 0%, rgba(0, 168, 255, 0.3) 100%) !important;
}

/* Layout a 2 colonne su desktop */
@media (min-width: 768px) {
    .definition-list dl {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
    
    /* Importo occupa tutta la larghezza */
    .definition-list dd:nth-of-type(1) {
        grid-column: 1 / -1 !important;
    }
    
    /* Beneficiario occupa tutta la larghezza */
    .definition-list dd:nth-of-type(2) {
        grid-column: 1 / -1 !important;
    }
}

/* Ottimizzazione mobile */
@media (max-width: 767px) {
    .definition-list dd {
        padding: 15px 20px !important;
    }
    
    .definition-list dd:nth-of-type(1) {
        font-size: 28px !important;
        padding: 20px !important;
    }
    
    .definition-list dd:nth-of-type(2) {
        font-size: 16px !important;
    }
    
    .definition-list dd:nth-of-type(3) {
        font-size: 12px !important;
        line-height: 1.8 !important;
    }
    
    .definition-list dd::before {
        font-size: 11px !important;
    }
}

@media (max-width: 576px) {
    .definition-list dd:nth-of-type(1) {
        font-size: 24px !important;
        padding: 18px !important;
    }
    
    .definition-list dd:nth-of-type(3) {
        font-size: 11px !important;
        word-break: break-all !important;
    }
}

/* Fix per altri elementi della pagina che potrebbero essere in conflitto */
.definition-list .card-block p {
    color: #ffffff !important;
    line-height: 1.8 !important;
    margin-bottom: 20px !important;
}

.definition-list strong {
    display: block !important;
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.1)) !important;
    color: #4CAF50 !important;
    padding: 15px 20px !important;
    border-radius: 8px !important;
    border-left: 4px solid #4CAF50 !important;
    margin: 25px 0 !important;
    font-size: 16px !important;
}

.definition-list a {
    color: #00a8ff !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    transition: color 0.3s ease !important;
}

.definition-list a:hover {
    color: #ffffff !important;
    text-decoration: underline !important;
}

