/* ============================================================================
 * bySENDA — Components CSS v1.0
 * ----------------------------------------------------------------------------
 * Componentes base del design system. HTML+CSS puro (framework agnostic).
 * Depende de tokens.css + base.css.
 * ========================================================================= */

/* =========================================================================
 * 1. BUTTON
 * ========================================================================= */

.bys-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--bys-space-2);
  padding: var(--bys-space-3) var(--bys-space-5);
  min-height: 44px; /* WCAG 2.5.5 target size */
  font-family: var(--bys-font-secondary);
  font-size: var(--bys-font-size-base);
  font-weight: var(--bys-font-weight-semibold);
  line-height: 1;
  text-decoration: none;
  border-radius: var(--bys-radius-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition:
    background-color var(--bys-duration-fast) var(--bys-ease-standard),
    color var(--bys-duration-fast) var(--bys-ease-standard),
    border-color var(--bys-duration-fast) var(--bys-ease-standard),
    transform var(--bys-duration-fast) var(--bys-ease-standard);
  white-space: nowrap;
  user-select: none;
}

.bys-btn:disabled,
.bys-btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.bys-btn--primary {
  background-color: var(--bys-brand-navy);
  color: var(--bys-text-on-primary);
  border-color: var(--bys-brand-navy);
}
.bys-btn--primary:hover { background-color: var(--bys-brand-navy-hover); border-color: var(--bys-brand-navy-hover); }
.bys-btn--primary:active { transform: translateY(1px); }

.bys-btn--secondary {
  background-color: var(--bys-bg-surface);
  color: var(--bys-brand-navy);
  border-color: var(--bys-brand-navy);
}
.bys-btn--secondary:hover {
  background-color: var(--bys-color-primary-50);
}
.bys-btn--secondary:active { transform: translateY(1px); }

.bys-btn--ghost {
  background-color: transparent;
  color: var(--bys-brand-navy);
  border-color: transparent;
}
.bys-btn--ghost:hover {
  background-color: var(--bys-bg-subtle);
}

.bys-btn--danger {
  background-color: var(--bys-color-error-500);
  color: var(--bys-text-on-primary);
  border-color: var(--bys-color-error-500);
}
.bys-btn--danger:hover { background-color: var(--bys-color-error-700); border-color: var(--bys-color-error-700); }

.bys-btn--sm { min-height: 36px; padding: var(--bys-space-2) var(--bys-space-4); font-size: var(--bys-font-size-sm); }
.bys-btn--lg { min-height: 52px; padding: var(--bys-space-4) var(--bys-space-6); font-size: var(--bys-font-size-md); }
.bys-btn--full { width: 100%; }

.bys-btn--loading {
  pointer-events: none;
  color: transparent !important;
  position: relative;
}
.bys-btn--loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2.5px solid currentColor;
  border-top-color: var(--bys-text-on-primary);
  border-radius: 50%;
  animation: bys-spin 0.8s linear infinite;
  color: var(--bys-brand-navy);
}
.bys-btn--primary.bys-btn--loading::after { color: var(--bys-text-on-primary); border-top-color: transparent; }

@keyframes bys-spin {
  to { transform: rotate(360deg); }
}

/* =========================================================================
 * 2. INPUT / TEXTAREA / SELECT
 * ========================================================================= */

.bys-field {
  display: flex;
  flex-direction: column;
  gap: var(--bys-space-2);
  margin-bottom: var(--bys-space-4);
}

.bys-label {
  font-size: var(--bys-font-size-sm);
  font-weight: var(--bys-font-weight-semibold);
  color: var(--bys-text-primary);
  display: flex;
  align-items: center;
  gap: var(--bys-space-1);
}

.bys-label__required {
  color: var(--bys-color-error-500);
  font-weight: var(--bys-font-weight-bold);
}

.bys-input,
.bys-textarea,
.bys-select {
  width: 100%;
  padding: var(--bys-space-3) var(--bys-space-4);
  min-height: 44px;
  font-family: var(--bys-font-secondary);
  font-size: var(--bys-font-size-base);
  color: var(--bys-text-primary);
  background-color: var(--bys-bg-surface);
  border: 1.5px solid var(--bys-border-default);
  border-radius: var(--bys-radius-md);
  transition: border-color var(--bys-duration-fast) var(--bys-ease-standard),
              box-shadow var(--bys-duration-fast) var(--bys-ease-standard);
  appearance: none;
}

.bys-input::placeholder,
.bys-textarea::placeholder { color: var(--bys-color-neutral-500); opacity: 1; }

.bys-input:hover,
.bys-textarea:hover,
.bys-select:hover { border-color: var(--bys-border-strong); }

.bys-input:focus,
.bys-textarea:focus,
.bys-select:focus {
  outline: none;
  border-color: var(--bys-border-focus);
  box-shadow: 0 0 0 3px var(--bys-color-secondary-100);
}

.bys-input[aria-invalid="true"],
.bys-textarea[aria-invalid="true"],
.bys-select[aria-invalid="true"] {
  border-color: var(--bys-color-error-500);
  box-shadow: 0 0 0 3px var(--bys-color-error-50);
}

.bys-input:disabled,
.bys-textarea:disabled,
.bys-select:disabled {
  background-color: var(--bys-bg-muted);
  color: var(--bys-text-muted);
  cursor: not-allowed;
}

.bys-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: var(--bys-line-height-normal);
}

.bys-select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20' fill='%23536879'><path d='M5.23 7.21a.75.75 0 011.06.02L10 11.06l3.71-3.83a.75.75 0 111.08 1.04l-4.25 4.39a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z'/></svg>");
  background-repeat: no-repeat;
  background-position: right var(--bys-space-3) center;
  padding-right: var(--bys-space-10);
}

.bys-field__hint {
  font-size: var(--bys-font-size-xs);
  color: var(--bys-text-muted);
}

.bys-field__error {
  font-size: var(--bys-font-size-sm);
  color: var(--bys-color-error-700);
  display: flex;
  align-items: center;
  gap: var(--bys-space-1);
}

/* =========================================================================
 * 3. CHECKBOX / RADIO
 * ========================================================================= */

.bys-check {
  display: flex;
  align-items: flex-start;
  gap: var(--bys-space-3);
  cursor: pointer;
  min-height: 44px;
  padding: var(--bys-space-2) 0;
}

.bys-check__input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--bys-brand-navy);
  cursor: pointer;
  flex-shrink: 0;
}

.bys-check__label {
  font-size: var(--bys-font-size-base);
  color: var(--bys-text-primary);
  line-height: var(--bys-line-height-normal);
}

/* =========================================================================
 * 4. CARD
 * ========================================================================= */

.bys-card {
  background-color: var(--bys-bg-surface);
  border: 1px solid var(--bys-border-subtle);
  border-radius: var(--bys-radius-lg);
  padding: var(--bys-space-6);
  box-shadow: var(--bys-shadow-sm);
  transition: box-shadow var(--bys-duration-base) var(--bys-ease-standard),
              transform var(--bys-duration-base) var(--bys-ease-standard);
}

.bys-card--interactive { cursor: pointer; }
.bys-card--interactive:hover {
  box-shadow: var(--bys-shadow-md);
  transform: translateY(-2px);
  border-color: var(--bys-color-secondary-300);
}

.bys-card__title {
  font-family: var(--bys-font-primary);
  font-size: var(--bys-font-size-lg);
  font-weight: var(--bys-font-weight-semibold);
  margin-bottom: var(--bys-space-2);
  color: var(--bys-text-primary);
}

.bys-card__body {
  color: var(--bys-text-secondary);
  line-height: var(--bys-line-height-relaxed);
}

.bys-card__footer {
  margin-top: var(--bys-space-4);
  padding-top: var(--bys-space-4);
  border-top: 1px solid var(--bys-border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--bys-space-3);
}

/* =========================================================================
 * 5. MODAL / DIALOG
 * ========================================================================= */

.bys-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 44, 77, 0.55);
  z-index: var(--bys-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--bys-space-4);
  animation: bys-fade-in var(--bys-duration-base) var(--bys-ease-decelerate);
}

@keyframes bys-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.bys-modal {
  background-color: var(--bys-bg-surface);
  border-radius: var(--bys-radius-lg);
  padding: var(--bys-space-6);
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 2 * var(--bys-space-4));
  overflow-y: auto;
  box-shadow: var(--bys-shadow-xl);
  position: relative;
}

.bys-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: var(--bys-space-3);
  margin-bottom: var(--bys-space-4);
}

.bys-modal__title {
  font-family: var(--bys-font-primary);
  font-size: var(--bys-font-size-xl);
  color: var(--bys-text-primary);
  margin: 0;
}

.bys-modal__close {
  width: 36px;
  height: 36px;
  border-radius: var(--bys-radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bys-text-muted);
}
.bys-modal__close:hover { background: var(--bys-bg-subtle); color: var(--bys-text-primary); }

.bys-modal__body { color: var(--bys-text-secondary); line-height: var(--bys-line-height-relaxed); }

.bys-modal__footer {
  margin-top: var(--bys-space-6);
  display: flex;
  justify-content: flex-end;
  gap: var(--bys-space-3);
  flex-wrap: wrap;
}

/* =========================================================================
 * 6. ALERT / TOAST
 * ========================================================================= */

.bys-alert {
  padding: var(--bys-space-4);
  border-radius: var(--bys-radius-md);
  border-left: 4px solid;
  display: flex;
  gap: var(--bys-space-3);
  align-items: flex-start;
}

.bys-alert__icon { flex-shrink: 0; margin-top: 2px; }
.bys-alert__content { flex: 1; }
.bys-alert__title { font-weight: var(--bys-font-weight-semibold); margin-bottom: var(--bys-space-1); }
.bys-alert__description { font-size: var(--bys-font-size-sm); color: inherit; }

.bys-alert--success { background: var(--bys-color-success-50); border-color: var(--bys-color-success-500); color: var(--bys-color-success-700); }
.bys-alert--warning { background: var(--bys-color-warning-50); border-color: var(--bys-color-warning-500); color: var(--bys-color-warning-700); }
.bys-alert--error   { background: var(--bys-color-error-50);   border-color: var(--bys-color-error-500);   color: var(--bys-color-error-700); }
.bys-alert--info    { background: var(--bys-color-info-50);    border-color: var(--bys-color-info-500);    color: var(--bys-color-info-700); }

.bys-toast {
  position: fixed;
  top: var(--bys-space-6);
  right: var(--bys-space-6);
  z-index: var(--bys-z-toast);
  min-width: 280px;
  max-width: 420px;
  box-shadow: var(--bys-shadow-lg);
  animation: bys-slide-in var(--bys-duration-base) var(--bys-ease-decelerate);
}

@keyframes bys-slide-in {
  from { transform: translateX(16px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* =========================================================================
 * 7. TABLE
 * ========================================================================= */

.bys-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--bys-border-subtle);
  border-radius: var(--bys-radius-md);
  background: var(--bys-bg-surface);
}

.bys-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--bys-font-size-sm);
}

.bys-table th,
.bys-table td {
  padding: var(--bys-space-3) var(--bys-space-4);
  text-align: left;
  border-bottom: 1px solid var(--bys-border-subtle);
  vertical-align: middle;
}

.bys-table th {
  font-weight: var(--bys-font-weight-semibold);
  color: var(--bys-text-primary);
  background: var(--bys-bg-subtle);
  position: sticky;
  top: 0;
  z-index: 1;
}

.bys-table th[aria-sort] { cursor: pointer; }
.bys-table th[aria-sort="ascending"]::after { content: " ↑"; }
.bys-table th[aria-sort="descending"]::after { content: " ↓"; }

.bys-table tr:hover td { background: var(--bys-bg-subtle); }
.bys-table tr:last-child td { border-bottom: none; }

.bys-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--bys-space-3) var(--bys-space-4);
  background: var(--bys-bg-surface);
  border-top: 1px solid var(--bys-border-subtle);
  flex-wrap: wrap;
  gap: var(--bys-space-3);
}

.bys-pagination__info { font-size: var(--bys-font-size-sm); color: var(--bys-text-muted); }
.bys-pagination__controls { display: flex; gap: var(--bys-space-2); }

/* =========================================================================
 * 8. BADGE / CHIP
 * ========================================================================= */

.bys-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--bys-space-1);
  padding: var(--bys-space-1) var(--bys-space-3);
  border-radius: var(--bys-radius-full);
  font-size: var(--bys-font-size-xs);
  font-weight: var(--bys-font-weight-semibold);
  line-height: 1.4;
}

.bys-badge--neutral   { background: var(--bys-bg-subtle); color: var(--bys-text-secondary); }
.bys-badge--primary   { background: var(--bys-color-primary-100); color: var(--bys-color-primary-700); }
.bys-badge--secondary { background: var(--bys-color-secondary-100); color: var(--bys-color-secondary-700); }
.bys-badge--success   { background: var(--bys-color-success-50); color: var(--bys-color-success-700); }
.bys-badge--warning   { background: var(--bys-color-warning-50); color: var(--bys-color-warning-700); }
.bys-badge--error     { background: var(--bys-color-error-50); color: var(--bys-color-error-700); }

/* =========================================================================
 * 9. AVATAR
 * ========================================================================= */

.bys-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--bys-radius-full);
  background: var(--bys-color-secondary-100);
  color: var(--bys-color-secondary-700);
  font-weight: var(--bys-font-weight-semibold);
  font-size: var(--bys-font-size-sm);
  overflow: hidden;
}

.bys-avatar--lg { width: 64px; height: 64px; font-size: var(--bys-font-size-lg); }
.bys-avatar--xl { width: 96px; height: 96px; font-size: var(--bys-font-size-xl); }

.bys-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* =========================================================================
 * 10. BREADCRUMB
 * ========================================================================= */

.bys-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bys-space-2);
  font-size: var(--bys-font-size-sm);
  color: var(--bys-text-muted);
  padding: var(--bys-space-3) 0;
}

.bys-breadcrumb__item { display: flex; align-items: center; gap: var(--bys-space-2); }
.bys-breadcrumb__item + .bys-breadcrumb__item::before {
  content: "/";
  color: var(--bys-border-strong);
}
.bys-breadcrumb__link {
  color: var(--bys-text-muted);
  text-decoration: none;
}
.bys-breadcrumb__link:hover { color: var(--bys-brand-navy); text-decoration: underline; }
.bys-breadcrumb__current { color: var(--bys-text-primary); font-weight: var(--bys-font-weight-medium); }

/* =========================================================================
 * 11. TABS
 * ========================================================================= */

.bys-tabs__list {
  display: flex;
  gap: var(--bys-space-1);
  border-bottom: 1px solid var(--bys-border-subtle);
  margin-bottom: var(--bys-space-6);
  overflow-x: auto;
  scrollbar-width: thin;
}

.bys-tabs__trigger {
  padding: var(--bys-space-3) var(--bys-space-4);
  font-weight: var(--bys-font-weight-medium);
  color: var(--bys-text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  background: transparent;
  white-space: nowrap;
  transition: color var(--bys-duration-fast), border-color var(--bys-duration-fast);
}

.bys-tabs__trigger[aria-selected="true"] {
  color: var(--bys-brand-navy);
  border-bottom-color: var(--bys-brand-navy);
}

.bys-tabs__trigger:hover { color: var(--bys-brand-navy); }

/* =========================================================================
 * 12. LOADER / SPINNER / SKELETON
 * ========================================================================= */

.bys-spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--bys-color-secondary-100);
  border-top-color: var(--bys-brand-sky);
  border-radius: 50%;
  animation: bys-spin 0.8s linear infinite;
  display: inline-block;
}

.bys-spinner--sm { width: 16px; height: 16px; border-width: 2px; }
.bys-spinner--lg { width: 40px; height: 40px; border-width: 3px; }

.bys-skeleton {
  background: linear-gradient(90deg,
    var(--bys-bg-subtle) 0%,
    var(--bys-bg-muted) 50%,
    var(--bys-bg-subtle) 100%);
  background-size: 200% 100%;
  animation: bys-skeleton-shimmer 1.4s linear infinite;
  border-radius: var(--bys-radius-sm);
  min-height: 1em;
}

@keyframes bys-skeleton-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.bys-skeleton--text { height: 1em; margin-bottom: var(--bys-space-2); }
.bys-skeleton--title { height: 1.8em; width: 60%; margin-bottom: var(--bys-space-3); }
.bys-skeleton--card { height: 160px; }
.bys-skeleton--circle { border-radius: 50%; width: 48px; height: 48px; }

/* =========================================================================
 * 13. TOOLTIP
 * ========================================================================= */

.bys-tooltip {
  position: relative;
  display: inline-block;
}

.bys-tooltip__content {
  position: absolute;
  bottom: calc(100% + var(--bys-space-2));
  left: 50%;
  transform: translateX(-50%);
  background: var(--bys-color-primary-900);
  color: var(--bys-text-on-primary);
  padding: var(--bys-space-2) var(--bys-space-3);
  border-radius: var(--bys-radius-sm);
  font-size: var(--bys-font-size-xs);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--bys-duration-fast);
  z-index: var(--bys-z-tooltip);
}

.bys-tooltip:hover .bys-tooltip__content,
.bys-tooltip:focus-within .bys-tooltip__content {
  opacity: 1;
}

/* =========================================================================
 * 14. STEPPER (flujo multi-paso de reserva)
 * ========================================================================= */

.bys-stepper {
  display: flex;
  align-items: center;
  gap: var(--bys-space-2);
  padding: var(--bys-space-4) 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.bys-stepper::-webkit-scrollbar { display: none; }

.bys-stepper__step {
  display: flex;
  align-items: center;
  gap: var(--bys-space-2);
  flex-shrink: 0;
}

.bys-stepper__indicator {
  width: 32px;
  height: 32px;
  border-radius: var(--bys-radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--bys-font-weight-bold);
  font-size: var(--bys-font-size-sm);
  background: var(--bys-bg-muted);
  color: var(--bys-text-muted);
  border: 2px solid transparent;
}

.bys-stepper__label {
  font-size: var(--bys-font-size-sm);
  color: var(--bys-text-muted);
  font-weight: var(--bys-font-weight-medium);
}

.bys-stepper__step[data-state="completed"] .bys-stepper__indicator {
  background: var(--bys-color-success-500);
  color: var(--bys-text-on-primary);
}
.bys-stepper__step[data-state="completed"] .bys-stepper__label { color: var(--bys-text-secondary); }

.bys-stepper__step[data-state="active"] .bys-stepper__indicator {
  background: var(--bys-brand-navy);
  color: var(--bys-text-on-primary);
  border-color: var(--bys-color-secondary-300);
}
.bys-stepper__step[data-state="active"] .bys-stepper__label {
  color: var(--bys-brand-navy);
  font-weight: var(--bys-font-weight-semibold);
}

.bys-stepper__divider {
  flex: 1;
  min-width: 24px;
  height: 2px;
  background: var(--bys-border-subtle);
}

/* =========================================================================
 * 15. RATING (ADR-0004 — satisfaccion post-cita)
 * ========================================================================= */

.bys-rating {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: var(--bys-space-1);
  padding: var(--bys-space-2);
}

.bys-rating__input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}

.bys-rating__star {
  cursor: pointer;
  color: var(--bys-border-strong);
  transition: color var(--bys-duration-fast);
  padding: var(--bys-space-1);
  border-radius: var(--bys-radius-sm);
  line-height: 1;
}

.bys-rating__star svg {
  width: 36px;
  height: 36px;
  display: block;
}

.bys-rating__input:checked ~ .bys-rating__star,
.bys-rating__star:hover,
.bys-rating__star:hover ~ .bys-rating__star {
  color: #D4A017; /* Ambar accesible */
}

.bys-rating__input:focus-visible + .bys-rating__star {
  outline: var(--bys-focus-ring-width) solid var(--bys-focus-ring-color);
  outline-offset: 2px;
}

/* =========================================================================
 * 16. EMPTY STATE
 * ========================================================================= */

.bys-empty {
  text-align: center;
  padding: var(--bys-space-10) var(--bys-space-6);
  color: var(--bys-text-muted);
}

.bys-empty__icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--bys-space-4);
  color: var(--bys-color-secondary-300);
}

.bys-empty__title {
  font-size: var(--bys-font-size-lg);
  font-family: var(--bys-font-primary);
  color: var(--bys-text-primary);
  margin-bottom: var(--bys-space-2);
}

.bys-empty__description {
  max-width: 380px;
  margin: 0 auto var(--bys-space-6);
}

/* =========================================================================
 * 17. HONEYPOT (anti-spam, visible solo a bots)
 * ========================================================================= */

.bys-honeypot {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* =========================================================================
 * 18. CMS BLOCK EDITOR (ADR-0005)
 * ========================================================================= */

.bys-cms-editor {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--bys-space-6);
}

@media (min-width: 1024px) {
  .bys-cms-editor { grid-template-columns: 1fr 1fr; }
}

.bys-cms-editor__pane {
  background: var(--bys-bg-surface);
  border: 1px solid var(--bys-border-subtle);
  border-radius: var(--bys-radius-lg);
  padding: var(--bys-space-5);
}

.bys-cms-block {
  border: 1.5px dashed var(--bys-border-default);
  border-radius: var(--bys-radius-md);
  padding: var(--bys-space-4);
  margin-bottom: var(--bys-space-4);
  background: var(--bys-bg-subtle);
}

.bys-cms-block__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--bys-space-3);
  gap: var(--bys-space-2);
  flex-wrap: wrap;
}

.bys-cms-block__type {
  font-size: var(--bys-font-size-xs);
  font-weight: var(--bys-font-weight-semibold);
  text-transform: uppercase;
  color: var(--bys-brand-sky);
  letter-spacing: var(--bys-letter-spacing-wide);
}

.bys-cms-toolbar {
  display: flex;
  gap: var(--bys-space-1);
  padding: var(--bys-space-2);
  background: var(--bys-bg-surface);
  border-radius: var(--bys-radius-sm);
  border: 1px solid var(--bys-border-subtle);
  margin-bottom: var(--bys-space-2);
}

.bys-cms-toolbar__btn {
  padding: var(--bys-space-1) var(--bys-space-3);
  border-radius: var(--bys-radius-xs);
  color: var(--bys-text-secondary);
  font-size: var(--bys-font-size-sm);
}
.bys-cms-toolbar__btn:hover { background: var(--bys-bg-subtle); color: var(--bys-brand-navy); }
.bys-cms-toolbar__btn[aria-pressed="true"] { background: var(--bys-color-primary-100); color: var(--bys-brand-navy); }

/* =========================================================================
 * 19. HEADER / FOOTER (portal publico)
 * ========================================================================= */

.bys-header {
  background: var(--bys-bg-surface);
  border-bottom: 1px solid var(--bys-border-subtle);
  position: sticky;
  top: 0;
  z-index: var(--bys-z-sticky);
  height: var(--bys-header-height);
}

.bys-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--bys-space-4);
}

.bys-header__logo {
  display: inline-flex;
  align-items: center;
  gap: var(--bys-space-2);
  text-decoration: none;
}

.bys-header__logo img { height: 72px; width: auto; }

.bys-nav {
  display: none;
  align-items: center;
  gap: var(--bys-space-2);
}

@media (min-width: 768px) {
  .bys-nav { display: flex; }
}

.bys-nav__link {
  padding: var(--bys-space-2) var(--bys-space-3);
  color: var(--bys-text-secondary);
  text-decoration: none;
  font-weight: var(--bys-font-weight-medium);
  border-radius: var(--bys-radius-sm);
  transition: background var(--bys-duration-fast), color var(--bys-duration-fast);
}
.bys-nav__link:hover { background: var(--bys-bg-subtle); color: var(--bys-brand-navy); text-decoration: none; }
.bys-nav__link[aria-current="page"] { color: var(--bys-brand-navy); background: var(--bys-color-primary-50); }

.bys-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--bys-radius-sm);
  color: var(--bys-brand-navy);
}
.bys-nav-toggle:hover { background: var(--bys-bg-subtle); }

@media (min-width: 768px) {
  .bys-nav-toggle { display: none; }
}

.bys-footer {
  background: var(--bys-color-primary-800);
  color: var(--bys-color-neutral-200);
  padding: var(--bys-space-10) 0;
  margin-top: var(--bys-space-16);
}

.bys-footer a { color: var(--bys-color-neutral-100); }
.bys-footer a:hover { color: var(--bys-color-neutral-0); }

.bys-footer__columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--bys-space-8);
}

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

@media (min-width: 1024px) {
  .bys-footer__columns { grid-template-columns: repeat(4, 1fr); }
}

.bys-footer__heading {
  color: var(--bys-text-on-primary);
  font-size: var(--bys-font-size-sm);
  font-weight: var(--bys-font-weight-semibold);
  margin-bottom: var(--bys-space-3);
  text-transform: uppercase;
  letter-spacing: var(--bys-letter-spacing-wide);
}

.bys-footer__list { list-style: none; padding: 0; }
.bys-footer__list li { margin-bottom: var(--bys-space-2); }

.bys-footer__legal {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: var(--bys-space-8);
  padding-top: var(--bys-space-6);
  font-size: var(--bys-font-size-sm);
  color: var(--bys-color-neutral-300);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--bys-space-3);
}

/* Redes sociales footer — BYSENDA-FIX-IMG-SERVICIOS-API-Y-REDES-SOCIALES-2026-11-20 */
.bys-footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bys-color-neutral-300);
  transition: color 0.15s ease, opacity 0.15s ease;
  line-height: 0;
}

.bys-footer__social-link:hover,
.bys-footer__social-link:focus-visible {
  color: var(--bys-color-neutral-0);
  opacity: 1;
}

.bys-footer__social-link:focus-visible {
  outline: 2px solid var(--bys-color-secondary-500);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============================================================================
 * Ciclo 2A — Filter chips (catálogo público)
 * Emisor: sofia-disenador-ui-ux | Task: BYSENDA-DISENADOR-CICLO-2A-WIREFRAMES
 * ========================================================================= */

.bys-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bys-space-2);
  margin-bottom: var(--bys-space-6);
}

.bys-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--bys-space-2);
  padding: var(--bys-space-2) var(--bys-space-4);
  min-height: 36px;
  background-color: var(--bys-bg-subtle);
  color: var(--bys-text-secondary);
  border: 1.5px solid var(--bys-border-subtle);
  border-radius: var(--bys-radius-full);
  font-family: var(--bys-font-secondary);
  font-size: var(--bys-font-size-sm);
  font-weight: var(--bys-font-weight-medium);
  cursor: pointer;
  transition:
    background-color var(--bys-duration-fast) var(--bys-ease-standard),
    color var(--bys-duration-fast) var(--bys-ease-standard),
    border-color var(--bys-duration-fast) var(--bys-ease-standard);
  user-select: none;
}

.bys-chip:hover {
  background-color: var(--bys-color-primary-50);
  border-color: var(--bys-color-primary-200);
  color: var(--bys-brand-navy);
}

.bys-chip--active,
.bys-chip[aria-pressed="true"] {
  background-color: var(--bys-brand-sky);
  color: var(--bys-text-on-primary);
  border-color: var(--bys-brand-sky);
}

.bys-chip--active:hover,
.bys-chip[aria-pressed="true"]:hover {
  background-color: var(--bys-brand-sky-hover);
  border-color: var(--bys-brand-sky-hover);
  color: var(--bys-text-on-primary);
}

.bys-chip:focus-visible {
  outline: none;
  box-shadow: var(--bys-shadow-focus);
}

.bys-chip__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--bys-radius-full);
  background-color: rgba(255, 255, 255, 0.25);
  font-size: var(--bys-font-size-xs);
  font-weight: var(--bys-font-weight-semibold);
}

.bys-chip:not(.bys-chip--active):not([aria-pressed="true"]) .bys-chip__count {
  background-color: var(--bys-color-neutral-200);
  color: var(--bys-text-secondary);
}

/* ============================================================================
 * Ciclo 2A — Filter tabs (listado admin con conteos por estado)
 * ========================================================================= */

.bys-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bys-space-1);
  border-bottom: 1px solid var(--bys-border-subtle);
  margin-bottom: var(--bys-space-6);
}

.bys-filter-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--bys-space-2);
  padding: var(--bys-space-3) var(--bys-space-5);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--bys-text-muted);
  font-family: var(--bys-font-secondary);
  font-size: var(--bys-font-size-sm);
  font-weight: var(--bys-font-weight-medium);
  cursor: pointer;
  transition:
    color var(--bys-duration-fast) var(--bys-ease-standard),
    border-color var(--bys-duration-fast) var(--bys-ease-standard);
  margin-bottom: -1px; /* Para que el borde activo cubra el border-bottom del container */
}

.bys-filter-tab:hover {
  color: var(--bys-brand-navy);
}

.bys-filter-tab--active,
.bys-filter-tab[aria-selected="true"] {
  color: var(--bys-brand-navy);
  border-bottom-color: var(--bys-brand-sky);
  font-weight: var(--bys-font-weight-semibold);
}

.bys-filter-tab:focus-visible {
  outline: none;
  box-shadow: var(--bys-shadow-focus);
  border-radius: var(--bys-radius-sm);
}

.bys-filter-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  background-color: var(--bys-color-neutral-100);
  color: var(--bys-text-secondary);
  border-radius: var(--bys-radius-full);
  font-size: var(--bys-font-size-xs);
  font-weight: var(--bys-font-weight-semibold);
}

.bys-filter-tab--active .bys-filter-tab__count,
.bys-filter-tab[aria-selected="true"] .bys-filter-tab__count {
  background-color: var(--bys-color-secondary-100);
  color: var(--bys-color-secondary-700);
}

/* ============================================================================
 * Ciclo 2A — State badges específicos de servicio
 * Patrón visual: punto indicador 8px + label semibold uppercase small
 * ========================================================================= */

.bys-badge--state-borrador {
  background-color: var(--bys-color-neutral-200);
  color: var(--bys-color-neutral-700);
}

.bys-badge--state-publicado {
  background-color: var(--bys-color-success-50);
  color: var(--bys-color-success-700);
}

.bys-badge--state-archivado {
  background-color: var(--bys-color-neutral-100);
  color: var(--bys-color-neutral-500);
}

.bys-badge--jurisdic-pendiente {
  background-color: var(--bys-color-warning-50);
  color: var(--bys-color-warning-700);
}

.bys-badge--jurisdic-validada {
  background-color: var(--bys-color-success-50);
  color: var(--bys-color-success-700);
}

.bys-badge--jurisdic-revocada {
  background-color: var(--bys-color-error-50);
  color: var(--bys-color-error-700);
}

.bys-badge--jurisdic-vencida {
  background-color: var(--bys-color-warning-50);
  color: var(--bys-color-warning-700);
  position: relative;
  padding-left: 24px;
}

.bys-badge--jurisdic-vencida::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translateY(-50%);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A5F00' stroke-width='2.5'><circle cx='12' cy='12' r='9'/><path d='M12 7v5l3 2' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-size: contain;
}

/* Indicador puntual (dot) opcional dentro de cualquier badge de estado */
.bys-badge__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
  margin-right: var(--bys-space-2);
  flex-shrink: 0;
}

/* ============================================================================
 * Ciclo 2A — Consentimiento legal Ley 29733 PE (reutilizable)
 * ========================================================================= */

.bys-legal-consent {
  background-color: var(--bys-color-info-50);
  border: 1px solid var(--bys-color-info-500);
  border-radius: var(--bys-radius-md);
  padding: var(--bys-space-5);
  margin: var(--bys-space-6) 0;
}

.bys-legal-consent__title {
  font-family: var(--bys-font-secondary);
  font-size: var(--bys-font-size-sm);
  font-weight: var(--bys-font-weight-semibold);
  color: var(--bys-color-info-700);
  text-transform: uppercase;
  letter-spacing: var(--bys-letter-spacing-wide);
  margin-bottom: var(--bys-space-3);
}

.bys-legal-consent__check {
  display: flex;
  align-items: flex-start;
  gap: var(--bys-space-3);
  margin-bottom: var(--bys-space-3);
  color: var(--bys-text-primary);
  font-size: var(--bys-font-size-sm);
  line-height: var(--bys-line-height-normal);
}

.bys-legal-consent__check a {
  color: var(--bys-text-link);
  text-decoration: underline;
}

.bys-legal-consent__help {
  margin: var(--bys-space-2) 0 0 0;
  font-size: var(--bys-font-size-xs);
  color: var(--bys-text-muted);
  line-height: var(--bys-line-height-snug);
}

.bys-legal-consent__help a {
  color: var(--bys-text-link);
  text-decoration: underline;
}

/* ============================================================================
 * Ciclo 2A — Service card (portal público) — refinamiento sobre bys-card
 * ========================================================================= */

.bys-service-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--bys-bg-surface);
  border: 1px solid var(--bys-border-subtle);
  border-radius: var(--bys-radius-lg);
  padding: var(--bys-space-6);
  transition:
    border-color var(--bys-duration-base) var(--bys-ease-standard),
    box-shadow var(--bys-duration-base) var(--bys-ease-standard),
    transform var(--bys-duration-base) var(--bys-ease-standard);
  text-decoration: none;
  color: inherit;
}

.bys-service-card:hover {
  border-color: var(--bys-brand-sky);
  box-shadow: var(--bys-shadow-md);
  transform: translateY(-2px);
}

.bys-service-card:focus-visible {
  outline: none;
  box-shadow: var(--bys-shadow-focus), var(--bys-shadow-md);
}

.bys-service-card__eyebrow {
  font-family: var(--bys-font-secondary);
  font-size: var(--bys-font-size-xs);
  font-weight: var(--bys-font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--bys-letter-spacing-wide);
  color: var(--bys-brand-sky);
  margin-bottom: var(--bys-space-2);
}

.bys-service-card__title {
  font-family: var(--bys-font-primary);
  font-size: var(--bys-font-size-lg);
  font-weight: var(--bys-font-weight-semibold);
  color: var(--bys-brand-navy);
  line-height: var(--bys-line-height-snug);
  margin: 0 0 var(--bys-space-3) 0;
}

.bys-service-card__description {
  font-size: var(--bys-font-size-sm);
  color: var(--bys-text-secondary);
  line-height: var(--bys-line-height-normal);
  margin: 0 0 var(--bys-space-4) 0;
  flex-grow: 1;
}

.bys-service-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bys-space-2);
  margin-bottom: var(--bys-space-4);
}

.bys-service-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--bys-space-4);
  border-top: 1px solid var(--bys-border-subtle);
}

.bys-service-card__cta {
  font-size: var(--bys-font-size-sm);
  font-weight: var(--bys-font-weight-semibold);
  color: var(--bys-text-link);
  display: inline-flex;
  align-items: center;
  gap: var(--bys-space-1);
}

/* Fila de acción en tabla admin — contenedora de botones icónicos */
.bys-row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--bys-space-1);
  align-items: center;
  justify-content: flex-end;
}

.bys-row-actions .bys-btn {
  min-height: 32px;
  padding: var(--bys-space-1) var(--bys-space-3);
  font-size: var(--bys-font-size-xs);
}

/* Form section divider (modal servicio con secciones generales + jurisdicciones) */
.bys-form-section {
  padding-bottom: var(--bys-space-5);
  margin-bottom: var(--bys-space-5);
  border-bottom: 1px solid var(--bys-border-subtle);
}
.bys-form-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.bys-form-section__title {
  font-family: var(--bys-font-secondary);
  font-size: var(--bys-font-size-sm);
  font-weight: var(--bys-font-weight-semibold);
  color: var(--bys-brand-navy);
  text-transform: uppercase;
  letter-spacing: var(--bys-letter-spacing-wide);
  margin: 0 0 var(--bys-space-4) 0;
}

.bys-form-section__hint {
  font-size: var(--bys-font-size-xs);
  color: var(--bys-text-muted);
  margin: calc(var(--bys-space-4) * -1 + 0px) 0 var(--bys-space-4) 0;
}

/* Jurisdicción row (inline list dentro del modal servicio) */
.bys-jurisdic-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: var(--bys-space-3);
  align-items: center;
  padding: var(--bys-space-3);
  background-color: var(--bys-bg-subtle);
  border-radius: var(--bys-radius-md);
  margin-bottom: var(--bys-space-2);
}

@media (max-width: 639px) {
  .bys-jurisdic-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
 * Ciclo 2A — Details/Summary expandible (formulario inline de jurisdicción)
 * ========================================================================= */

.bys-details {
  margin-top: var(--bys-space-4);
}

.bys-details summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.bys-details summary::-webkit-details-marker { display: none; }

.bys-details[open] summary {
  margin-bottom: var(--bys-space-3);
}

/* ============================================================================
 * Ciclo 2A — Contenedor de paginación del catálogo público
 * ========================================================================= */

#paginacion-servicios {
  margin-top: var(--bys-space-8);
}

/* ============================================================================
 * Ciclo 2A — Texto utilitario pequeño con color semántico
 * ========================================================================= */

.bys-text-small {
  font-size: var(--bys-font-size-sm);
}

.bys-text-muted {
  color: var(--bys-text-muted);
}

/* ============================================================================
 * Ciclo 2B — Scheduler semanal admin (bys-scheduler-week + day-avail + timeslot)
 * US-BYS-020 — CRUD disponibilidad
 * ========================================================================= */

.bys-scheduler-week {
  display: flex;
  flex-direction: column;
  gap: var(--bys-space-6);
}

.bys-scheduler-week__header {
  display: flex;
  flex-direction: column;
  gap: var(--bys-space-2);
}

.bys-scheduler-week__title {
  font-family: var(--bys-font-primary);
  font-size: var(--bys-font-size-xl);
  font-weight: var(--bys-font-weight-semibold);
  color: var(--bys-text-primary);
  margin: 0;
}

.bys-scheduler-week__hint {
  color: var(--bys-text-muted);
  font-size: var(--bys-font-size-sm);
  margin: 0;
}

.bys-scheduler-week__grid {
  display: flex;
  flex-direction: column;
  gap: var(--bys-space-4);
}

/* Desktop XL: grid 2x4 opcional para densidad (fuera de default MVP) */
@media (min-width: 1280px) {
  .bys-scheduler-week__grid--dense {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--bys-space-4);
  }
}

.bys-day-avail {
  background: var(--bys-bg-surface);
  border: 1px solid var(--bys-border-subtle);
  border-radius: var(--bys-radius-lg);
  padding: var(--bys-space-5);
  display: flex;
  flex-direction: column;
  gap: var(--bys-space-3);
}

.bys-day-avail--inactivo {
  opacity: 0.6;
  background: var(--bys-bg-subtle);
}

.bys-day-avail__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--bys-space-4);
}

.bys-day-avail__name {
  font-family: var(--bys-font-secondary);
  font-size: var(--bys-font-size-md);
  font-weight: var(--bys-font-weight-semibold);
  color: var(--bys-text-primary);
  margin: 0;
  text-transform: capitalize;
}

.bys-day-avail__slots {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--bys-space-2);
}

.bys-day-avail__error {
  color: var(--bys-color-error-700, #B3261E);
  font-size: var(--bys-font-size-sm);
  padding: var(--bys-space-2) var(--bys-space-3);
  background: var(--bys-color-error-50, #FDECEA);
  border-left: 3px solid var(--bys-color-error-700, #B3261E);
  border-radius: var(--bys-radius-sm);
}

.bys-timeslot {
  display: flex;
  align-items: center;
  gap: var(--bys-space-2);
  flex-wrap: wrap;
}

.bys-timeslot__sep {
  color: var(--bys-text-muted);
  font-weight: var(--bys-font-weight-medium);
  padding: 0 var(--bys-space-1);
}

.bys-input--sm {
  padding: var(--bys-space-2) var(--bys-space-3);
  min-height: 44px; /* WCAG 2.5.5 target */
  max-width: 120px;
  font-size: var(--bys-font-size-base);
}

/* ============================================================================
 * Ciclo 2B — Switch toggle (bys-switch)
 * Patron: checkbox nativo + track/thumb visual.
 * ========================================================================= */

.bys-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 44px; /* area clickeable WCAG 2.5.5 */
  cursor: pointer;
  user-select: none;
}

.bys-switch input[type="checkbox"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.bys-switch__track {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--bys-color-neutral-300);
  border-radius: var(--bys-radius-full);
  transition: background var(--bys-duration-fast) var(--bys-ease-standard);
  flex-shrink: 0;
}

.bys-switch__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--bys-bg-surface);
  border-radius: 50%;
  box-shadow: var(--bys-shadow-sm);
  transition: transform var(--bys-duration-fast) var(--bys-ease-standard);
}

.bys-switch input:checked ~ .bys-switch__track {
  background: var(--bys-brand-sky);
}

.bys-switch input:checked ~ .bys-switch__track::after {
  transform: translateX(20px);
}

.bys-switch input:focus-visible ~ .bys-switch__track {
  box-shadow: var(--bys-shadow-focus);
}

.bys-switch input:disabled ~ .bys-switch__track {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ============================================================================
 * Ciclo 2B — Exception row (bys-excep-row)
 * ========================================================================= */

.bys-excep-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--bys-space-2);
}

.bys-excep-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--bys-space-3);
  align-items: center;
  padding: var(--bys-space-3) var(--bys-space-4);
  background: var(--bys-bg-surface);
  border: 1px solid var(--bys-border-subtle);
  border-radius: var(--bys-radius-md);
  transition: background var(--bys-duration-fast);
}

.bys-excep-row:hover {
  background: var(--bys-bg-subtle);
}

.bys-excep-row__date {
  font-family: var(--bys-font-mono, var(--bys-font-secondary));
  font-size: var(--bys-font-size-sm);
  font-weight: var(--bys-font-weight-semibold);
  color: var(--bys-text-primary);
  white-space: nowrap;
}

.bys-excep-row__desc {
  color: var(--bys-text-secondary, var(--bys-text-primary));
  font-size: var(--bys-font-size-sm);
}

@media (min-width: 768px) {
  .bys-excep-row {
    grid-template-columns: 120px auto 1fr auto;
  }
}

/* ============================================================================
 * Ciclo 2B — Language switcher (bys-lang-switcher)
 * US-BYS-007 — MVP: solo es-PE, patron listbox preparado para multi-locale.
 * ========================================================================= */

.bys-lang-switcher {
  position: relative;
  display: inline-block;
}

.bys-lang-switcher__trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--bys-space-2);
  padding: var(--bys-space-2) var(--bys-space-3);
  min-height: 44px;
  background: transparent;
  border: 1px solid var(--bys-border-subtle);
  border-radius: var(--bys-radius-md);
  color: var(--bys-text-primary);
  font-family: var(--bys-font-secondary);
  font-size: var(--bys-font-size-sm);
  font-weight: var(--bys-font-weight-medium);
  cursor: pointer;
  transition: background var(--bys-duration-fast), border-color var(--bys-duration-fast);
}

.bys-lang-switcher__trigger:hover {
  background: var(--bys-bg-subtle);
  border-color: var(--bys-color-neutral-400);
}

.bys-lang-switcher__trigger:focus-visible {
  outline: none;
  box-shadow: var(--bys-shadow-focus);
  border-color: var(--bys-brand-sky);
}

.bys-lang-switcher__trigger[aria-expanded="true"] {
  background: var(--bys-bg-subtle);
  border-color: var(--bys-brand-sky);
}

.bys-lang-switcher__icon,
.bys-lang-switcher__chevron {
  flex-shrink: 0;
  color: var(--bys-text-muted);
}

.bys-lang-switcher__chevron {
  transition: transform var(--bys-duration-fast);
}

.bys-lang-switcher__trigger[aria-expanded="true"] .bys-lang-switcher__chevron {
  transform: rotate(180deg);
}

.bys-lang-switcher__current {
  font-weight: var(--bys-font-weight-semibold);
  letter-spacing: 0.02em;
}

.bys-lang-switcher__list {
  position: absolute;
  top: calc(100% + var(--bys-space-1));
  right: 0;
  min-width: 180px;
  list-style: none;
  padding: var(--bys-space-2);
  margin: 0;
  background: var(--bys-bg-surface);
  border: 1px solid var(--bys-border-subtle);
  border-radius: var(--bys-radius-md);
  box-shadow: var(--bys-shadow-lg);
  z-index: var(--bys-z-dropdown, 50);
}

.bys-lang-switcher__list[hidden] {
  display: none;
}

.bys-lang-switcher__option {
  display: flex;
  align-items: center;
  gap: var(--bys-space-3);
  padding: var(--bys-space-2) var(--bys-space-3);
  min-height: 44px;
  border-radius: var(--bys-radius-sm);
  color: var(--bys-text-primary);
  font-size: var(--bys-font-size-sm);
  cursor: pointer;
  transition: background var(--bys-duration-fast);
}

.bys-lang-switcher__option:hover,
.bys-lang-switcher__option:focus-visible {
  background: var(--bys-color-primary-50, var(--bys-bg-subtle));
  outline: none;
}

.bys-lang-switcher__option--active,
.bys-lang-switcher__option[aria-selected="true"] {
  background: var(--bys-color-primary-50, var(--bys-bg-subtle));
  font-weight: var(--bys-font-weight-semibold);
}

.bys-lang-switcher__option--active::after,
.bys-lang-switcher__option[aria-selected="true"]::after {
  content: "✓";
  margin-left: auto;
  color: var(--bys-brand-sky);
  font-weight: var(--bys-font-weight-bold);
}

.bys-lang-switcher__flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 18px;
  border-radius: 2px;
  background: var(--bys-color-neutral-200);
  color: var(--bys-text-primary);
  font-size: 10px;
  font-weight: var(--bys-font-weight-bold);
  font-family: var(--bys-font-mono, var(--bys-font-secondary));
}

/* Posicion dentro del header: entre nav y CTA reservar */
@media (min-width: 1024px) {
  .bys-header__lang {
    margin-left: var(--bys-space-3);
    margin-right: var(--bys-space-3);
  }
}

/* ============================================================================
 * AUTH NAV — dropdown del usuario logueado (Ciclo 5A US-BYS-093/094)
 * Fix BYSENDA-FRONTEND-FIX-DROPDOWN-PERSISTENTE-DEV-LOCAL-2026-12-01:
 * Mueve estilos del dropdown al CSS (evita dependencia de inline style para
 * posicionamiento y visibilidad). Toggle via clase .is-open.
 * ========================================================================= */

/* Contenedor del bloque auth (siempre position:relative — ancla del dropdown) */
#auth-nav-logueado {
  position: relative;
}

/* Estilos base del dropdown — siempre oculto por defecto */
.bys-auth-nav__dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + var(--bys-space-2));
  min-width: 160px;
  background: var(--bys-bg-surface);
  border: 1px solid var(--bys-border-subtle);
  border-radius: var(--bys-radius-lg);
  box-shadow: var(--bys-shadow-lg);
  padding: var(--bys-space-1) 0;
  z-index: var(--bys-z-dropdown);
  list-style: none;
  margin: 0;
}

/* Dropdown visible cuando el contenedor tiene la clase .is-open */
#auth-nav-logueado.is-open .bys-auth-nav__dropdown {
  display: block;
}

/* Items del dropdown */
.bys-auth-nav__dropdown-item {
  display: block;
  width: 100%;
  padding: var(--bys-space-2) var(--bys-space-4);
  color: var(--bys-text-primary);
  font-size: var(--bys-font-size-sm);
  text-decoration: none;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.bys-auth-nav__dropdown-item:hover {
  background: var(--bys-bg-subtle);
  color: var(--bys-brand-navy);
  text-decoration: none;
}

/* Mobile: dentro del drawer (abajo de los links) */
@media (max-width: 1023px) {
  .bys-drawer .bys-lang-switcher {
    width: 100%;
    margin-top: var(--bys-space-4);
  }
  .bys-drawer .bys-lang-switcher__trigger {
    width: 100%;
    justify-content: space-between;
  }
  .bys-drawer .bys-lang-switcher__list {
    position: static;
    width: 100%;
    margin-top: var(--bys-space-2);
    box-shadow: none;
  }
}

/* ============================================================================
 * Ciclo 2B — Section variante narrow (editorial)
 * ========================================================================= */

.bys-section--narrow .bys-container {
  max-width: 720px;
}

/* ============================================================================
 * Ciclo 2B — Hero variantes (documentadas; base bys-hero vive en pages.css)
 * ========================================================================= */

.bys-hero--interno {
  padding-top: var(--bys-space-6);
  padding-bottom: var(--bys-space-8);
}

.bys-hero--interno .bys-hero__grid {
  grid-template-columns: 1fr;
}

.bys-hero--contacto .bys-hero__description {
  max-width: 580px;
}

/* ============================================================================
 * Ciclo 2B — Credenciales grid (sobre.eta)
 * ========================================================================= */

.bys-credencial-card {
  padding: var(--bys-space-5);
  background: var(--bys-bg-surface);
  border: 1px solid var(--bys-border-subtle);
  border-radius: var(--bys-radius-lg);
  display: flex;
  flex-direction: column;
  gap: var(--bys-space-2);
}

.bys-credencial-card__titulo {
  font-weight: var(--bys-font-weight-semibold);
  color: var(--bys-text-primary);
  margin: 0;
  font-size: var(--bys-font-size-md);
}

.bys-credencial-card__detalle {
  font-size: var(--bys-font-size-sm);
  color: var(--bys-text-muted);
  margin: 0;
}

.bys-credencial-card__ano {
  font-family: var(--bys-font-mono, var(--bys-font-secondary));
  font-size: var(--bys-font-size-xs);
  color: var(--bys-brand-sky);
  font-weight: var(--bys-font-weight-semibold);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ============================================================================
 * Ciclo 2B — Pilares enfoque (sobre.eta)
 * ========================================================================= */

.bys-pilar {
  text-align: center;
  padding: var(--bys-space-6) var(--bys-space-4);
}

.bys-pilar__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: var(--bys-color-secondary-100, var(--bys-bg-subtle));
  border-radius: 50%;
  margin: 0 auto var(--bys-space-4);
  color: var(--bys-brand-navy);
}

.bys-pilar__titulo {
  font-family: var(--bys-font-primary);
  font-weight: var(--bys-font-weight-semibold);
  margin: 0 0 var(--bys-space-2);
}

.bys-pilar__descripcion {
  color: var(--bys-text-muted);
  font-size: var(--bys-font-size-sm);
}

/* ============================================================================
 * Ciclo 2B — Info contacto (contacto-page.eta sidebar)
 * ========================================================================= */

.bys-info-contacto {
  padding: var(--bys-space-6);
  background: var(--bys-bg-subtle);
  border-radius: var(--bys-radius-lg);
  display: flex;
  flex-direction: column;
  gap: var(--bys-space-4);
}

.bys-info-contacto__item {
  display: flex;
  gap: var(--bys-space-3);
  align-items: flex-start;
}

.bys-info-contacto__icon {
  flex-shrink: 0;
  color: var(--bys-brand-sky);
}

.bys-info-contacto__label {
  font-weight: var(--bys-font-weight-semibold);
  color: var(--bys-text-primary);
  font-size: var(--bys-font-size-sm);
  margin: 0 0 var(--bys-space-1);
}

.bys-info-contacto__valor {
  color: var(--bys-text-muted);
  font-size: var(--bys-font-size-sm);
  margin: 0;
}

/* ============================================================================
 * Ciclo 3A — Slot picker semanal publico (US-BYS-021)
 * Selector de disponibilidad embebido en servicio-detalle.eta
 * Emisor: sofia-frontend-dev | BYSENDA-FRONTEND-DEV-CICLO-3A-IMPLEMENTACION-2026-11-21
 * ========================================================================= */

/* Navegacion de semana */
.bys-slot-picker__nav {
  display: flex;
  align-items: center;
  gap: var(--bys-space-2);
  margin-bottom: var(--bys-space-3);
}

/* Grid semanal (7 columnas, una por dia) */
.bys-slot-picker__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--bys-space-1);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bys-border-subtle) transparent;
}

/* Columna de un dia */
.bys-slot-picker__col {
  display: flex;
  flex-direction: column;
  gap: var(--bys-space-1);
  min-width: 36px;
}

.bys-slot-picker__col--pasado {
  opacity: 0.45;
}

/* Encabezado del dia (nombre corto + numero) */
.bys-slot-picker__dia-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding-bottom: var(--bys-space-2);
  border-bottom: 1px solid var(--bys-border-subtle);
  margin-bottom: var(--bys-space-1);
}

.bys-slot-picker__dia-corto {
  font-size: var(--bys-font-size-xs);
  font-weight: var(--bys-font-weight-semibold);
  color: var(--bys-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--bys-letter-spacing-wide);
}

.bys-slot-picker__dia-nro {
  font-size: var(--bys-font-size-sm);
  font-weight: var(--bys-font-weight-bold);
  color: var(--bys-text-primary);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--bys-radius-full);
}

/* Indicador "sin horarios" */
.bys-slot-picker__no-slots {
  font-size: var(--bys-font-size-xs);
  color: var(--bys-text-muted);
  text-align: center;
  padding: var(--bys-space-2) 0;
}

/* Contenedor de slots por dia */
.bys-slot-picker__slots {
  display: flex;
  flex-direction: column;
  gap: var(--bys-space-1);
}

/* Slot individual — boton de hora */
.bys-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 36px;
  padding: var(--bys-space-1) var(--bys-space-1);
  font-size: var(--bys-font-size-xs);
  font-weight: var(--bys-font-weight-medium);
  font-family: var(--bys-font-secondary);
  color: var(--bys-brand-navy);
  background-color: var(--bys-color-secondary-50);
  border: 1.5px solid var(--bys-color-secondary-200);
  border-radius: var(--bys-radius-sm);
  cursor: pointer;
  transition:
    background-color var(--bys-duration-fast) var(--bys-ease-standard),
    border-color var(--bys-duration-fast) var(--bys-ease-standard),
    color var(--bys-duration-fast) var(--bys-ease-standard),
    transform var(--bys-duration-fast) var(--bys-ease-standard);
  text-align: center;
  line-height: 1.2;
}

.bys-slot:hover {
  background-color: var(--bys-brand-sky-bg);
  border-color: var(--bys-brand-sky);
  color: var(--bys-color-secondary-700);
}

.bys-slot:focus-visible {
  outline: none;
  box-shadow: var(--bys-shadow-focus);
}

.bys-slot:active {
  transform: scale(0.96);
}

/* Estado seleccionado */
.bys-slot--selected,
.bys-slot[aria-checked="true"] {
  background-color: var(--bys-brand-navy);
  border-color: var(--bys-brand-navy);
  color: var(--bys-text-on-primary);
  font-weight: var(--bys-font-weight-semibold);
}

.bys-slot--selected:hover,
.bys-slot[aria-checked="true"]:hover {
  background-color: var(--bys-brand-navy-dark);
  border-color: var(--bys-brand-navy-dark);
  color: var(--bys-text-on-primary);
}

/* Responsive: en movil mostrar 4 dias y hacer scroll horizontal */
@media (max-width: 479px) {
  .bys-slot-picker__grid {
    grid-template-columns: repeat(4, minmax(44px, 1fr));
  }
}

/* En sidebar sticky el grid se comprime — mantener legibilidad */
@media (min-width: 1024px) {
  .bys-slot-picker__grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .bys-slot {
    font-size: 0.65rem;
    min-height: 32px;
    padding: 2px;
  }

  .bys-slot-picker__dia-corto {
    font-size: 0.6rem;
  }
}

/* Formulario de reserva footer */
.bys-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--bys-space-3);
  flex-wrap: wrap;
  margin-top: var(--bys-space-6);
  padding-top: var(--bys-space-6);
  border-top: 1px solid var(--bys-border-subtle);
}

/* Aviso legal en form card */
.bys-legal-notice {
  font-size: var(--bys-font-size-sm);
  color: var(--bys-text-muted);
  background: var(--bys-bg-subtle);
  border-radius: var(--bys-radius-sm);
  padding: var(--bys-space-3) var(--bys-space-4);
  margin-bottom: var(--bys-space-4);
}

/* Form card contenedor del form de reserva */
.bys-form-card {
  background: var(--bys-bg-surface);
  border: 1px solid var(--bys-border-subtle);
  border-radius: var(--bys-radius-lg);
  padding: var(--bys-space-6);
  box-shadow: var(--bys-shadow-sm);
}

@media (prefers-reduced-motion: reduce) {
  .bys-slot {
    transition: none;
  }
  .bys-slot:active {
    transform: none;
  }
}
