/* ===== Garage365 Modal — Redesign ===== */

/* Overlay */
.g365-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
  z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px;
}

/* Modal container */
.g365-modal {
  background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%; max-width: 620px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1f2937;
  transform: translateY(20px) scale(.97); opacity: 0;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .25s ease;
}
.g365-modal.g365-modal-open {
  transform: translateY(0) scale(1); opacity: 1;
}

/* Header */
.g365-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid #e5e7eb;
}
.g365-modal-header h2 {
  margin: 0; font-size: 17px; font-weight: 700; color: #111827;
}
.g365-close {
  background: none; border: none; color: #9ca3af; width: 36px; height: 36px;
  border-radius: 50%; font-size: 24px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; line-height: 1; padding: 0;
  transition: background .2s, color .2s;
}
.g365-close:hover { background: #f3f4f6; color: #374151; }

/* Body */
.g365-modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; }

/* Product info bar */
.g365-product-info {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; background: #f9fafb; border: 1px solid #e5e7eb;
  border-radius: 10px; margin-bottom: 16px;
}
.g365-prod-img {
  width: 48px; height: 48px; background: #f3f4f6; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.g365-prod-detail { flex: 1; min-width: 0; }
.g365-prod-name {
  font-size: 13px; font-weight: 600; color: #111827;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.g365-prod-meta { font-size: 13px; color: #6b7280; margin-top: 3px; }
.g365-prod-meta strong { color: #111827; }

/* Collapsible "Cos'è incluso" */
.g365-collapsible { margin-bottom: 16px; }
.g365-collapsible-trigger {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 14px; font-weight: 500; color: #374151; font-family: inherit;
}
.g365-collapsible-trigger:hover { color: #111827; }
.g365-chevron { transition: transform .25s ease; }
.g365-collapsible-content { padding: 10px 0 0; }
.g365-included-list {
  list-style: none; padding: 0; margin: 0; font-size: 13px; color: #4b5563;
}
.g365-included-list li { padding: 4px 0; }

/* CAP search */
.g365-search-box { margin-bottom: 16px; }
.g365-label {
  font-size: 12px; font-weight: 600; color: #6b7280; margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .04em; display: block;
}
.g365-input-group { display: flex; gap: 0; }
.g365-input {
  flex: 1; padding: 12px 16px; border: 1px solid #d1d5db; border-radius: 8px 0 0 8px;
  font-size: 16px; outline: none; font-family: inherit; background: #fff;
}
.g365-input:focus { border-color: #374151; box-shadow: 0 0 0 2px rgba(55,65,81,.08); }
.g365-btn-search {
  padding: 0 16px; border: 1px solid #d1d5db; border-left: none;
  border-radius: 0 8px 8px 0; background: #f9fafb; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #374151; transition: background .2s;
}
.g365-btn-search:hover { background: #e5e7eb; }

/* Cart summary */
.g365-cart-summary {
  background: rgba(55,65,81,.05); border: 1px solid rgba(55,65,81,.12);
  border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px;
}

/* Loading */
.g365-loading {
  display: flex; flex-direction: column; align-items: center;
  padding: 32px 20px; gap: 14px; color: #6b7280;
}
.g365-spinner {
  width: 36px; height: 36px; border: 3px solid #e5e7eb; border-top-color: #374151;
  border-radius: 50%; animation: g365sp .8s linear infinite;
}
@keyframes g365sp { to { transform: rotate(360deg); } }

/* Results header */
.g365-results-header h3 { font-size: 14px; font-weight: 600; margin: 0 0 14px; color: #374151; }

/* Center card */
.g365-center-card {
  border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden;
  transition: border-color .25s, box-shadow .25s; margin-bottom: 14px;
}
.g365-center-card:hover { border-color: #9ca3af; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.g365-card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 14px 16px 0; gap: 12px;
}
.g365-card-header h4 { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.g365-badge {
  display: inline-flex; padding: 3px 10px; border-radius: 20px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em;
}
.g365-badge-open { background: rgba(16,185,129,.1); color: #059669; }
.g365-badge-closed { background: rgba(239,68,68,.1); color: #dc2626; }
.g365-badge-incompatible { background: rgba(156,163,175,.15); color: #6b7280; }

/* Centro non compatibile con il carrello */
.g365-center-incompatible { opacity: 0.6; pointer-events: none; }
.g365-center-incompatible:hover { border-color: #e5e7eb; box-shadow: none; }
.g365-btn-incompatible {
  background: #e5e7eb; color: #9ca3af; cursor: not-allowed;
  width: 100%; padding: 12px 16px;
}
.g365-incompatible-msg {
  font-size: 12px; color: #9ca3af; text-align: center;
  padding: 4px 0 8px; margin: 0; line-height: 1.5;
}

.g365-distance { font-size: 13px; font-weight: 600; color: #6b7280; white-space: nowrap; }

.g365-card-body { padding: 10px 16px 14px; }
.g365-address, .g365-phone { font-size: 13px; color: #6b7280; margin: 0 0 4px; }

.g365-prices {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px;
  margin: 12px 0; padding: 10px 12px; background: #f9fafb; border-radius: 8px;
}
.g365-price-item { display: flex; justify-content: space-between; font-size: 12px; color: #6b7280; }
.g365-pv { font-weight: 700; color: #111827; }

.g365-card-footer { padding: 0 16px 14px; }
.g365-card-total { text-align: center; padding: 8px 0 10px; font-size: 14px; }
.g365-card-total strong { color: #111827; font-size: 17px; }

/* No results */
.g365-no-results {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 32px 20px; color: #6b7280;
}
.g365-nores-icon { margin-bottom: 10px; color: #3b82f6; }
.g365-no-results p { font-size: 13px; margin: 0; line-height: 1.6; }

/* Error */
.g365-error {
  background: rgba(239,68,68,.06); border: 1px solid rgba(239,68,68,.15);
  border-radius: 8px; padding: 10px 14px; margin-top: 12px;
}
.g365-error p { margin: 0; font-size: 13px; color: #dc2626; font-weight: 500; }

/* How it works */
.g365-how-it-works {
  border-top: 1px solid #e5e7eb; margin-top: 20px; padding-top: 18px;
}
.g365-how-it-works h4 {
  margin: 0 0 14px; font-size: 15px; font-weight: 700; color: #111827;
}
.g365-steps { display: flex; flex-direction: column; gap: 14px; }
.g365-step { display: flex; gap: 12px; align-items: flex-start; }
.g365-step-num {
  width: 28px; height: 28px; border-radius: 50%; background: #111827; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.g365-step strong { font-size: 13px; color: #111827; }
.g365-step p { font-size: 12px; color: #6b7280; margin: 3px 0 0; line-height: 1.5; }

/* Shipping warning */
.g365-shipping-warn {
  display: flex; gap: 14px; align-items: flex-start;
  margin-top: 20px; padding: 16px 18px;
  background: #fef9c3; border: 1px solid #fde047; border-radius: 10px;
}
.g365-warn-icon { flex-shrink: 0; color: #92400e; margin-top: 2px; }
.g365-shipping-warn p { margin: 0; font-size: 13px; color: #78350f; line-height: 1.6; }
.g365-shipping-warn strong { color: #451a03; }

/* Buttons */
.g365-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all .2s;
  font-family: inherit;
}
.g365-btn:disabled { opacity: .5; cursor: not-allowed; }
.g365-btn-primary { background: #111827; color: #fff; }
.g365-btn-primary:hover:not(:disabled) { background: #1f2937; }
.g365-btn-outline {
  background: #fff; color: #374151; border: 1px solid #d1d5db;
}
.g365-btn-outline:hover { background: #f9fafb; }
.g365-btn-select { background: #111827; color: #fff; width: 100%; padding: 12px 16px; }
.g365-btn-select:hover:not(:disabled) { background: #1f2937; }

/* Notes step */
.g365-notes-step { padding: 8px 0; }
.g365-notes-step h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.g365-notes-sub { font-size: 13px; color: #6b7280; margin: 0 0 12px; }
.g365-notes-step textarea.g365-input {
  min-height: 80px; line-height: 1.5; border-radius: 8px;
}
.g365-notes-actions { display: flex; gap: 8px; margin-top: 14px; }
.g365-notes-actions .g365-btn-outline { flex: 1; }
.g365-notes-actions .g365-btn-primary { flex: 2; }

/* Confirmed step */
.g365-confirmed { text-align: center; padding: 24px 0; }
.g365-success-icon { color: #059669; margin-bottom: 14px; }
.g365-confirmed h3 { margin: 0 0 10px; font-size: 20px; font-weight: 700; color: #059669; }
.g365-confirmed p { font-size: 14px; color: #6b7280; margin: 0 0 20px; }

/* Footer */
.g365-modal-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-top: 1px solid #e5e7eb; background: #f9fafb;
}
.g365-powered { font-size: 11px; color: #9ca3af; }
.g365-powered strong { color: #6b7280; }

/* Product badge (page) */
.g365-product-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; background: #f9fafb; border: 1px solid #e5e7eb;
  border-radius: 8px; font-size: 13px; font-weight: 500; color: #374151; margin: 10px 0;
}

/* Responsive */
@media (max-width: 640px) {
  .g365-modal { max-height: 95vh; border-radius: 10px 10px 0 0; }
  .g365-modal-header { padding: 16px 18px; }
  .g365-modal-body { padding: 16px 18px; }
  .g365-prices { grid-template-columns: 1fr; }
  .g365-modal-footer { flex-direction: column; gap: 8px; padding: 12px 18px; }
  .g365-shipping-warn { flex-direction: column; gap: 10px; }
}

/* ── Riga servizio montaggio nel carrello/checkout ─────────────────────────── */
.g365-service-line .product-line-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  width: 100%;
}
.g365-service-line .product-line-desc {
  flex: 1;
}
.g365-service-label {
  font-weight: 600;
  font-size: 13px;
  color: #1f2937;
}
.g365-service-note {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
}
.g365-service-line .product-line-price {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  padding-left: 12px;
}

/* Checkbox spedizione officina partner nel checkout */
.g365-partner-delivery-row {
  /* Eredita tutto nativamente da PrestaShop/TheCheckout */
  margin-top: 8px;
}

/* Ereditato dal tema */
