/* ==========================================================
   DIRECTRICES COESA — Figma 22889:76707
   Route: /auditoria/actividad-internacional/colaboracion-internacional/directrices-coesa
   Reuses .verificacion-* classes from verificacion-normas.css
   ========================================================== */

/* ── Hero ──────────────────────────────────────────────── */
.coesadir-hero {
  position: relative;
  width: 100%;
  height: 288px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #172554;
}

.coesadir-hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.coesadir-hero__bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.coesadir-hero__bg-crop {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.coesadir-hero__bg-overlay-img {
  position: absolute;
  left: 0;
  top: -155.92%;
  width: 100%;
  height: 355.6%;
  max-width: none;
  display: block;
}

.coesadir-hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.coesadir-hero__content {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  width: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.coesadir-hero__breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.coesadir-hero__breadcrumb-item {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: #fafafa;
  white-space: nowrap;
}

.coesadir-hero__breadcrumb-item a {
  color: inherit;
  text-decoration: none;
  opacity: 0.85;
}

.coesadir-hero__breadcrumb-item a:hover {
  text-decoration: underline;
  opacity: 1;
}

.coesadir-hero__breadcrumb-item--current {
  opacity: 0.7;
}

.coesadir-hero__breadcrumb-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  opacity: 0.7;
}

.coesadir-hero__title {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 36px;
  line-height: 40px;
  color: #fafafa;
  margin: 0;
  letter-spacing: 0;
  max-width: 1152px;
}

/* ── Content Section ───────────────────────────────────── */
.coesadir-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 0;
  width: 100%;
  background: white;
}

.coesadir-content__container {
  max-width: 1280px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Top bar ───────────────────────────────────────────── */
.coesadir-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.coesadir-topbar .btn-view-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: #0a0a0a;
  transition: background 0.15s;
}

.coesadir-topbar .btn-view-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
}

.coesadir-topbar .btn-view-toggle svg {
  width: 16px;
  height: 16px;
}

.coesadir-topbar .coesadir-select-sort {
  height: 36px;
  padding: 8px 12px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: white;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: #525252;
  cursor: pointer;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* ── Separator ─────────────────────────────────────────── */
.coesadir-separator {
  width: 100%;
  border: none;
  border-top: 1px solid #e5e5e5;
  margin: 0;
}

/* ── Layout: sidebar + table ───────────────────────────── */
.coesadir-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* ── Filter sidebar ────────────────────────────────────── */
.coesadir-filter-panel {
  width: 305px;
  flex-shrink: 0;
}

.coesadir-filter-panel .filter-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.coesadir-filter-panel .filter-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  color: #0a0a0a;
}

.coesadir-filter-panel .filter-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 12px;
  border-bottom: 1px solid #e5e5e5;
}

.coesadir-filter-panel .filter-search-wrap svg {
  width: 16px;
  height: 16px;
  color: #525252;
  flex-shrink: 0;
}

.coesadir-filter-panel .filter-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: #0a0a0a;
  background: transparent;
}

.coesadir-filter-panel .filter-select-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.coesadir-filter-panel .filter-select-label {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  color: #0a0a0a;
}

.coesadir-filter-panel .filter-select {
  height: 36px;
  padding: 8px 12px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: white;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: #0a0a0a;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.coesadir-filter-panel .filter-btn-submit {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: #b91c1c;
  color: #fafafa;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: background 0.15s;
}

.coesadir-filter-panel .filter-btn-submit:hover {
  background: #991b1b;
}

/* ── Table wrapper ─────────────────────────────────────── */
.coesadir-table-wrapper {
  flex: 1;
  min-width: 0;
}

/* Hide Views exposed form (we use custom sidebar) */
.coesadir-table-wrapper .views-exposed-form {
  display: none !important;
}

/* Card wrapper — Figma: bg #f8fafc, border #e2e8f0, radius 16px, padding 20px */
.coesadir-table-wrapper .views-element-container > div {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
}

/* Table styles */
.coesadir-table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* Column widths matching Figma: Consulta 602px, Idioma 116px, Acciones 150px */
.coesadir-table-wrapper table th:nth-child(1),
.coesadir-table-wrapper table td:nth-child(1) {
  width: 602px;
}

.coesadir-table-wrapper table th:nth-child(2),
.coesadir-table-wrapper table td:nth-child(2) {
  width: 116px;
}

.coesadir-table-wrapper table th:nth-child(3),
.coesadir-table-wrapper table td:nth-child(3) {
  width: 150px;
  text-align: right;
}

.coesadir-table-wrapper table thead tr {
  background: transparent;
}

.coesadir-table-wrapper table th {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: #525252;
  padding: 8px;
  height: 40px;
  border-bottom: 1px solid #e5e5e5;
  text-align: left;
  background: transparent;
}

.coesadir-table-wrapper table td {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: #0a0a0a;
  padding: 8px;
  height: 72px;
  border-bottom: 1px solid #e5e5e5;
  vertical-align: middle;
  background: transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coesadir-table-wrapper table td:last-child {
  font-weight: 400;
}

.coesadir-table-wrapper table tr:last-child td {
  border-bottom: none;
}

/* ── Static COESA table (2 columns: Documento + Acciones) ─── */
.coesadir-table-wrapper .coesadir-table {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
}

.coesadir-table.coesadir-table th:nth-child(1),
.coesadir-table.coesadir-table td:nth-child(1) {
  width: auto;
}

.coesadir-table.coesadir-table th:nth-child(2),
.coesadir-table.coesadir-table td:nth-child(2) {
  width: 100px;
  text-align: center;
}

.coesadir-table__head--actions {
  text-align: center;
}

.coesadir-icon-btn,
.coesadir-icon-btn--view,
.coesadir-icon-btn--download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: white;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  color: #0a0a0a;
  text-decoration: none;
  transition: background 0.15s;
}

.coesadir-icon-btn:hover,
.coesadir-icon-btn--view:hover,
.coesadir-icon-btn--download:hover {
  background: #f8fafc;
}

.coesadir-icon-btn svg,
.coesadir-icon-btn--view svg,
.coesadir-icon-btn--download svg {
  width: 16px;
  height: 16px;
}

/* ── Card view ─────────────────────────────────────────── */
.coesadir-cards {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.coesadir-cards[hidden],
.coesadir-table-wrapper[hidden] {
  display: none !important;
}

.coesadir-card {
  display: flex;
  min-height: 132px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.coesadir-card__title {
  margin: 0;
  color: #0a0a0a;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

.coesadir-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.coesadir-card__view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #ffffff;
  color: #0a0a0a;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: background 0.15s;
}

.coesadir-card__view:hover {
  background: #f5f5f5;
}

.coesadir-card__view svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.coesadir-card__download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  color: #b91c1c;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: none;
  transition: background 0.15s;
}

.coesadir-card__download:hover {
  background: #fff1f2;
}

.coesadir-card__download svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

/* ── Language badge ─────────────────────────────────────── */
.coesadir-lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: white;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 12px;
  line-height: 16px;
  color: #0a0a0a;
  white-space: nowrap;
}

.coesadir-lang-flag {
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.coesadir-lang-flag img,
.coesadir-lang-flag .ley-reglamento-flag {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 2px;
  object-fit: contain;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  vertical-align: middle;
}

/* ── Action buttons ─────────────────────────────────────── */
.coesadir-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.coesadir-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: background 0.15s;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.coesadir-action-btn:hover {
  background: #f5f5f5;
}

.coesadir-action-btn--disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.coesadir-action-btn img {
  width: 16px;
  height: 16px;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1024px) {
  .coesadir-hero__content {
    padding: 0 24px;
  }
  .coesadir-content__container {
    padding: 0 24px;
  }
  .coesadir-filter-panel {
    width: 240px;
  }
}

@media (max-width: 768px) {
  .coesadir-hero {
    height: auto;
    min-height: 220px;
    padding: 40px 0;
  }
  .coesadir-hero__content {
    padding: 0 16px;
  }
  .coesadir-hero__title {
    font-size: 28px;
    line-height: 32px;
  }
  .coesadir-content {
    padding: 32px 0;
  }
  .coesadir-content__container {
    padding: 0 16px;
  }
  .coesadir-layout {
    flex-direction: column;
  }
  .coesadir-filter-panel {
    width: 100%;
  }
  .coesadir-table-wrapper {
    overflow-x: auto;
  }
  .coesadir-cards {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}
