/* ==========================================================================
   SYNOVIAFLEX™ | COMPONENT MODULES
   Tabs, Calculators, WOMAC, Certificates Lightbox, Cart Drawer, Checkout
   ========================================================================== */

/* ==========================================================================
   1. OFF-CANVAS CART DRAWER
   ========================================================================== */
.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background-color: var(--bg-pure);
  box-shadow: -10px 0 40px rgba(15, 23, 42, 0.2);
  z-index: 2200;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-drawer.open {
  right: 0;
}

.cart-drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-drawer-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-empty-state {
  text-align: center;
  padding: 40px 10px;
  color: var(--text-muted);
}

.cart-empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.cart-item-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  background-color: var(--bg-ice);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  align-items: center;
}

.cart-item-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  background-color: #ffffff;
  border-radius: var(--radius-sm);
  padding: 4px;
  border: 1px solid var(--border-light);
}

.cart-item-info {
  flex: 1;
}

.cart-item-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.3;
}

.cart-item-badge {
  font-size: 0.75rem;
  color: var(--primary-teal);
  font-weight: 600;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background-color: #ffffff;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.qty-btn:hover {
  background-color: var(--teal-subtle);
  border-color: var(--primary-teal);
  color: var(--primary-teal);
}

.qty-val {
  font-size: 0.9rem;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.cart-item-delete {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 6px;
  transition: color var(--transition-fast);
}

.cart-item-delete:hover {
  color: var(--danger-red);
}

.cart-drawer-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-light);
  background-color: var(--bg-ice);
}

.cart-subtotal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-heading);
}

.cart-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 2199;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.cart-drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   2. INTERACTIVE ASSESSMENT HUB (test-interattivi.html)
   ========================================================================== */
.assessment-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 14px 24px;
  border-radius: var(--radius-full);
  background-color: var(--bg-ice);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all var(--transition-fast);
  min-height: 48px;
}

.tab-btn:hover {
  background-color: #ffffff;
  color: var(--primary-teal);
  border-color: var(--teal-border);
}

.tab-btn.active {
  background-color: var(--primary-teal);
  color: #ffffff;
  border-color: var(--primary-teal);
  box-shadow: var(--shadow-teal);
}

.tab-panel {
  display: none;
  animation: fadeIn 0.35s ease;
}

.tab-panel.active {
  display: block;
}

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

/* Tab 1: Water Calculator */
.calc-card {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
}

.calc-control-group {
  margin-bottom: 28px;
}

.calc-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 12px;
}

.calc-badge-val {
  background-color: var(--teal-subtle);
  color: var(--primary-teal);
  border: 1px solid var(--teal-border);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 800;
}

.range-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  outline: none;
  -webkit-appearance: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-teal);
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.pill-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pill-option {
  position: relative;
}

.pill-option input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.pill-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background-color: var(--bg-ice);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  min-height: 52px;
}

.pill-option input:checked + .pill-label {
  background-color: var(--teal-subtle);
  border-color: var(--primary-teal);
  color: var(--primary-teal);
  font-weight: 700;
}

/* Calculator Output Box */
.calc-result-box {
  background: linear-gradient(135deg, #042f2e, #0f766e);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-teal);
}

.calc-liters-hero {
  text-align: center;
  padding: 20px 0;
}

.calc-liters-num {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #5eead4;
}

.calc-liters-unit {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ccfbf1;
  margin-top: 4px;
}

.calc-schedule-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 20px 0;
}

.schedule-card {
  text-align: center;
}

.schedule-time {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #99f6e4;
  font-weight: 700;
  margin-bottom: 4px;
}

.schedule-amount {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
}

/* Tab 2: WOMAC Clinical Test */
.womac-card {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  max-width: 800px;
  margin: 0 auto;
}

.womac-progress-wrapper {
  margin-bottom: 30px;
}

.womac-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.womac-progress-bar {
  width: 100%;
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.womac-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-teal), var(--accent-blue));
  width: 20%;
  transition: width 0.3s ease;
}

.womac-question-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 20px;
}

.womac-options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 30px;
}

.womac-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  background-color: var(--bg-pure);
}

.womac-option:hover {
  border-color: var(--primary-teal);
  background-color: var(--teal-subtle);
}

.womac-option.selected {
  border-color: var(--primary-teal);
  background-color: var(--teal-subtle);
}

.womac-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.womac-option.selected .womac-radio {
  border-color: var(--primary-teal);
  background-color: var(--primary-teal);
}

.womac-option.selected .womac-radio::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ffffff;
}

.womac-option-text {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-main);
}

/* WOMAC Diagnosis Result Box */
.womac-diagnosis-box {
  display: none;
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 2px solid var(--primary-teal);
  animation: fadeIn 0.4s ease;
}

.diagnosis-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.diagnosis-badge {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.diagnosis-badge.phase1 {
  background-color: var(--gold-subtle);
  color: var(--gold-accent);
}

.diagnosis-badge.phase2 {
  background-color: #ffedd5;
  color: #ea580c;
}

.diagnosis-badge.phase3 {
  background-color: #fee2e2;
  color: var(--danger-red);
}

/* Tab 3: Nutrient Deficiency Symptom Cards */
.symptom-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.symptom-card {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.symptom-card:hover {
  border-color: var(--primary-teal);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.symptom-icon {
  font-size: 2rem;
  margin-bottom: 14px;
}

.symptom-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 8px;
}

.symptom-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.symptom-cure-reveal {
  padding: 16px;
  background-color: var(--teal-subtle);
  border: 1px solid var(--teal-border);
  border-radius: var(--radius-md);
  margin-top: 14px;
  display: none;
}

.symptom-card.active .symptom-cure-reveal {
  display: block;
}

.cure-badge {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--primary-teal);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.cure-text {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-heading);
}

/* ==========================================================================
   3. CERTIFICATES GRID & LIGHTBOX (certificati.html)
   ========================================================================== */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.cert-card {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.cert-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--teal-border);
}

.cert-preview-box {
  position: relative;
  background-color: var(--bg-ice);
  padding: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-light);
}

.cert-preview-box img {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast);
}

.cert-preview-box:hover img {
  transform: scale(1.02);
}

.cert-zoom-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
  color: #ffffff;
  font-weight: 700;
  gap: 8px;
}

.cert-preview-box:hover .cert-zoom-overlay {
  opacity: 1;
}

.cert-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cert-meta {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-teal);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.cert-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 10px;
}

.cert-summary {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  z-index: 2800;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px;
  animation: fadeIn 0.25s ease;
}

.lightbox-modal.open {
  display: flex;
}

.lightbox-content-box {
  position: relative;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
}

.lightbox-img {
  max-height: 70vh;
  width: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox-caption {
  margin-top: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading);
  text-align: center;
}

.lightbox-close-btn {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 40px;
  height: 40px;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  color: var(--text-heading);
}

/* ==========================================================================
   4. FORMULA MATRIX & PACKAGE BUNDLES (formula.html)
   ========================================================================== */
.matrix-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 60px;
}

.matrix-card {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.matrix-card:hover {
  transform: translateY(-4px);
  border-color: var(--teal-border);
  box-shadow: var(--shadow-md);
}

.matrix-number {
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--primary-teal);
  background-color: var(--teal-subtle);
  border: 1px solid var(--teal-border);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.matrix-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 6px;
}

.matrix-dose {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 12px;
}

.matrix-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Package Bundles (STRICT RULE: NO PRICES ON formula.html) */
.packages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.package-card {
  background-color: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.package-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.package-card.recommended {
  border-color: var(--primary-teal);
  box-shadow: var(--shadow-teal);
}

.package-badge-top {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--primary-teal);
  color: #ffffff;
  padding: 4px 16px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.package-badge-top.gold {
  background-color: var(--gold-accent);
}

.package-img-box {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.package-img-box img {
  max-height: 100%;
  object-fit: contain;
}

.package-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-heading);
  text-align: center;
  margin-bottom: 8px;
}

.package-duration {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 20px;
}

.package-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 30px;
  flex: 1;
}

.package-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--text-main);
}

.check-icon {
  color: var(--primary-teal);
  font-weight: bold;
}

/* ==========================================================================
   5. CHECKOUT NODE & FORM (carrello.html)
   ========================================================================== */
.checkout-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 40px;
  align-items: flex-start;
}

.checkout-card {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-sm);
}

.checkout-section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 6px;
}

.form-input, .form-select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  color: var(--text-heading);
  background-color: #ffffff;
  transition: all var(--transition-fast);
  min-height: 48px;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary-teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
}

/* Payment Method Cards */
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.payment-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  background-color: var(--bg-ice);
  transition: all var(--transition-fast);
}

.payment-card.selected {
  border-color: var(--primary-teal);
  background-color: var(--teal-subtle);
}

.payment-badge-free {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 800;
  background-color: var(--success-subtle);
  color: var(--success-green);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

/* Order Summary Box in Checkout (PRICES SHOWN HERE) */
.order-summary-box {
  background-color: var(--bg-ice);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.95rem;
  color: var(--text-main);
}

.summary-row.total {
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-heading);
}

.trust-badges-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.trust-badge-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}
