/* ==============================================================================
   VendlyPOS Menú Digital — Modifiers Sheet & Customizer (modifiers.css)
   Modal interactivo de modificadores de platillos gastronómicos
   ============================================================================== */

.modifiers-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--bg-overlay);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.modifiers-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modifiers-sheet {
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  background-color: var(--bg-surface);
  border-top: 2px solid var(--accent-gold);
  border-left: 1px solid var(--accent-border);
  border-right: 1px solid var(--accent-border);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 -10px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modifiers-overlay.active .modifiers-sheet {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .modifiers-overlay {
    align-items: center;
  }
  .modifiers-sheet {
    max-height: 85vh;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--accent-border-active);
    transform: scale(0.92) translateY(20px);
  }
  .modifiers-overlay.active .modifiers-sheet {
    transform: scale(1) translateY(0);
  }
}

/* Header del Platillo en Modificadores */
.sheet-hero-header {
  position: relative;
  background-color: var(--bg-card);
  padding: 16px 20px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.15);
  display: flex;
  align-items: center;
  gap: 16px;
}

.sheet-dish-thumb {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--accent-border);
  flex-shrink: 0;
}

.sheet-hero-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sheet-dish-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.sheet-dish-base-price {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-gold-light);
}

.sheet-dish-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.btn-close-sheet {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-close-sheet:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: rotate(90deg);
}

/* Cuerpo con Scroll de Grupos */
.sheet-scroll-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Tarjeta de Grupo de Modificadores */
.mod-group-card {
  background-color: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s ease;
}

.mod-group-card.has-error {
  border-color: var(--color-danger);
  background-color: rgba(239, 68, 68, 0.04);
}

.mod-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.mod-group-title-wrap {
  display: flex;
  flex-direction: column;
}

.mod-group-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.mod-group-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.mod-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.mod-badge.required {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.mod-badge.required.satisfied {
  background: var(--color-success-soft);
  color: var(--color-success);
  border-color: rgba(16, 185, 129, 0.3);
}

.mod-badge.optional {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-gold-light);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Opciones: Grid y Píldoras */
.mod-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Opción tipo Fila Seleccionable */
.mod-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1.5px solid var(--accent-border);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.mod-option-row:hover:not(.disabled) {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.05);
}

.mod-option-row.selected {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.08));
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.15);
}

.mod-option-row.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(80%);
}

.mod-option-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mod-custom-control {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--accent-border-active);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.mod-option-row.checkbox-mode .mod-custom-control {
  border-radius: 6px;
}

.mod-option-row.selected .mod-custom-control {
  background-color: var(--accent-gold);
  border-color: var(--accent-gold);
}

.mod-custom-control::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #120700;
  display: none;
}

.mod-option-row.selected .mod-custom-control::after {
  display: block;
}

.mod-option-row.checkbox-mode.selected .mod-custom-control::after {
  content: '✓';
  background: transparent;
  color: #120700;
  font-size: 13px;
  font-weight: 900;
  width: auto;
  height: auto;
  line-height: 1;
}

.mod-option-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.mod-option-row.selected .mod-option-name {
  color: var(--text-primary);
  font-weight: 700;
}

.mod-option-price {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-gold);
}

/* Área de Instrucciones Especiales para el Chef */
.sheet-notes-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet-notes-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sheet-notes-textarea {
  width: 100%;
  min-height: 72px;
  background-color: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text-primary);
  outline: none;
  resize: vertical;
}

.sheet-notes-textarea:focus {
  border-color: var(--accent-gold);
}

/* Footer Fijo con Cálculo Dinámico del Precio */
.sheet-sticky-footer,
.sheet-footer {
  padding: 16px 20px;
  background-color: var(--bg-card);
  border-top: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.sheet-qty-stepper,
.sheet-stepper {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-full);
  height: 48px;
  padding: 0 4px;
  flex-shrink: 0;
}

.sheet-qty-btn,
.sheet-stepper-btn {
  background: transparent !important;
  border: none !important;
  outline: none;
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1;
  padding: 0;
}

.sheet-qty-btn:hover,
.sheet-stepper-btn:hover {
  background: var(--accent-soft) !important;
  color: var(--accent-gold);
}

.sheet-qty-val,
.sheet-stepper-val {
  padding: 0 12px;
  font-weight: 800;
  font-size: 1.05rem;
  color: #ffffff;
  display: inline-block;
  min-width: 20px;
  text-align: center;
  user-select: none;
}

.btn-confirm-dish {
  flex: 1;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-hover));
  color: #120700;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
  transition: all 0.2s ease;
}

.btn-confirm-dish:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.55);
}

.btn-confirm-dish:disabled {
  background: #361a07;
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
