/* ==========================================================================
   SynoviaFlex (SFX) - Specific Component Styles
   - Cart Drawer & Cart Items
   - Interactive Assessment (Hydration Calculator, WOMAC, Deficiency Map)
   - Checkout Form & Italian Delivery Fields
   - Thank You Page Elements
   - Articles & Monograph Layouts
   ========================================================================== */

/* ==========================================================================
   Slide-out Cart Drawer
   ========================================================================== */

.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background-color: #ffffff;
  z-index: 1210;
  box-shadow: var(--shadow-drawer);
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-drawer-overlay.active .cart-drawer {
  right: 0;
}

.cart-drawer-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  background-color: var(--bg-subtle);
}

.cart-drawer-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cart-drawer-title-wrap h3 {
  font-size: 1.15rem;
  margin-bottom: 0;
}

.cart-drawer-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color var(--transition-normal);
}

.cart-drawer-close:hover {
  background-color: var(--border-light);
  color: var(--text-main);
}

.cart-drawer-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.cart-empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.cart-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.cart-empty-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.cart-empty-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Drawer Item Card */
.drawer-items-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  background-color: var(--bg-icy);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  position: relative;
}

.drawer-item-img {
  width: 55px;
  height: 70px;
  object-fit: contain;
  flex-shrink: 0;
}

.drawer-item-info {
  flex-grow: 1;
}

.drawer-item-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--primary);
  background-color: var(--primary-light);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  display: inline-block;
  margin-bottom: 0.2rem;
}

.drawer-item-title {
  font-size: 0.88rem;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.drawer-item-calc {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-item-price {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
}

.qty-selector {
  display: flex;
  align-items: center;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.btn-qty {
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-qty:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
}

.qty-num {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0 6px;
  min-width: 22px;
  text-align: center;
}

.btn-drawer-remove {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  align-self: flex-start;
}

.btn-drawer-remove:hover {
  color: var(--danger);
}

/* Drawer Footer */
.cart-drawer-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-light);
  background-color: var(--bg-subtle);
}

.cart-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.cart-total-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
}

.cart-shipping-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  background-color: var(--success-bg);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid #bbf7d0;
}

.free-tag {
  color: var(--success);
  font-weight: 800;
  margin-left: auto;
}

.drawer-security-note {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 0.75rem;
}

/* ==========================================================================
   Interactive Tests Center (test-interattivi.html)
   ========================================================================== */

.assessment-tabs-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border-light);
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.assessment-tab-btn {
  background: none;
  border: none;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dim);
  padding: 0.85rem 1.25rem;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-normal);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  min-height: 48px;
}

.assessment-tab-btn:hover {
  color: var(--primary);
  background-color: var(--primary-light);
}

.assessment-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background-color: #ffffff;
}

.assessment-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.assessment-pane.active {
  display: block;
}

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

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

@media (min-width: 992px) {
  .calc-card {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.form-group-calc {
  margin-bottom: 1.75rem;
}

.form-group-calc label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.calc-slider-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  background-color: var(--primary-light);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}

.custom-range-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #99f6e4 0%, var(--primary) 100%);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

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

.custom-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  background-color: #ffffff;
  min-height: 48px;
}

.custom-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

/* Water Calculator Results Card */
.calc-results-panel {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
}

.calc-res-big {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.calc-water-val-display {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  color: #2dd4bf;
}

.calc-water-unit {
  font-size: 0.95rem;
  color: #e6f6f4;
  font-weight: 600;
  margin-top: 0.5rem;
}

.schedule-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.schedule-item {
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.schedule-val {
  color: #2dd4bf;
  font-size: 1.1rem;
  font-weight: 800;
}

.schedule-item p {
  font-size: 0.8rem;
  color: #cbd5e1;
  margin-bottom: 0;
}

/* Tab 2: WOMAC Questionnaire */
.womac-card {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 2.25rem;
  box-shadow: var(--shadow-sm);
  max-width: 860px;
  margin: 0 auto;
}

.womac-progress-wrap {
  margin-bottom: 2rem;
}

.womac-progress-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.womac-progress-bar {
  width: 100%;
  height: 8px;
  background-color: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

.womac-progress-fill {
  height: 100%;
  width: 0%;
  background-color: var(--primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.womac-question-block {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.womac-question-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.womac-options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.womac-option-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition-normal);
  min-height: 44px;
}

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

.womac-option-label input[type="radio"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}

.womac-result-card {
  margin-top: 2rem;
  padding: 2rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-icy);
  border: 2px solid var(--border-teal);
  display: none;
}

.womac-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.phase-green {
  background-color: var(--success-bg);
  color: var(--success);
  border: 1px solid #bbf7d0;
}

.phase-amber {
  background-color: var(--warning-bg);
  color: var(--warning);
  border: 1px solid #fde68a;
}

.phase-red {
  background-color: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fca5a5;
}

/* Tab 3: Deficiency Cards */
.deficiency-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .deficiency-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.deficiency-card {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.deficiency-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.deficiency-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.deficiency-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.deficiency-toggle-icon {
  font-size: 1.25rem;
  color: var(--primary);
  transition: transform var(--transition-normal);
}

.deficiency-card.expanded .deficiency-toggle-icon {
  transform: rotate(45deg);
}

.deficiency-sub {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-top: 0.25rem;
}

.deficiency-detail {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.35s ease, margin-top 0.35s ease;
}

.deficiency-card.expanded .deficiency-detail {
  max-height: 200px;
  opacity: 1;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

/* ==========================================================================
   Checkout Page (carrello.html)
   ========================================================================== */

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-top: 2rem;
}

@media (min-width: 992px) {
  .checkout-grid {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

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

.checkout-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.checkout-table th {
  text-align: left;
  font-size: 0.85rem;
  color: var(--text-dim);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.checkout-table td {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.checkout-prod-flex {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.checkout-prod-thumb {
  width: 60px;
  height: 75px;
  object-fit: contain;
}

.checkout-prod-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.btn-remove-item {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1.1rem;
  margin-left: 0.5rem;
}

/* Form inputs */
.form-row-2col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 600px) {
  .form-row-2col {
    grid-template-columns: 1fr 1fr;
  }
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  background-color: #ffffff;
  min-height: 48px;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

/* Payment Selector Cards */
.payment-methods-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
}

.payment-card-opt {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.payment-card-opt.selected,
.payment-card-opt:has(input[type="radio"]:checked) {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.payment-card-opt input[type="radio"] {
  accent-color: var(--primary);
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.payment-card-content h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.payment-card-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* Trust Badges Bar */
.trust-badges-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-around;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

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

/* ==========================================================================
   Thank You Page (grazie.html)
   ========================================================================== */

.thanks-order-box {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  max-width: 800px;
  margin: 0 auto;
}

.thanks-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.thanks-success-icon {
  width: 64px;
  height: 64px;
  background-color: var(--success-bg);
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.25rem;
  border: 2px solid #86efac;
}

.thanks-code-tag {
  display: inline-block;
  font-family: monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  background-color: var(--primary-light);
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  margin-top: 0.5rem;
}

.thanks-steps-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 2rem 0;
}

.thanks-step-item {
  display: flex;
  gap: 1rem;
}

.thanks-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.thanks-doctor-letter {
  background-color: var(--bg-icy);
  border: 1px solid var(--border-teal);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-top: 2.5rem;
}

.thanks-doctor-letter h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.thanks-doctor-letter p {
  font-size: 0.95rem;
  line-height: 1.7;
}

.thanks-signature-block {
  margin-top: 1.5rem;
  font-style: italic;
  font-weight: 700;
  color: var(--text-main);
}

/* ==========================================================================
   Article Pages (articoli/...)
   ========================================================================== */

.article-header {
  max-width: 800px;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.article-meta {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 1rem;
}

.article-content {
  max-width: 780px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.85;
}

.article-content h2 {
  font-size: 1.6rem;
  margin: 2.5rem 0 1rem;
}

.article-content h3 {
  font-size: 1.25rem;
  margin: 1.75rem 0 0.75rem;
}

.article-content ul,
.article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-callout {
  background-color: var(--bg-icy);
  border-left: 4px solid var(--primary);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 2rem 0;
}
