.talitor-docs-library-v3 {
  display: grid;
  gap: 24px;
}

.talitor-doc-category {
  margin-bottom: 0;
}

.t-cat-title {
  font-size: 18px;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 16px;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== TABLE PRODUITS ===== */
.talitor-product-docs-table-wrap {
  overflow-x: auto;
}

.talitor-product-docs-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.talitor-product-docs-table td {
  padding: 8px 8px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.talitor-product-docs-table .col-image {
  width: 52px;
}

.talitor-product-docs-table .col-name {
  width: 18%;
}

.talitor-product-docs-table .col-sku {
  width: 10%;
  color: #555;
  font-size: 0.84rem;
  line-height: 1.15;
}

.talitor-product-docs-table .col-doc {
  width: 24%;
}

.talitor-product-docs-table .col-image img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.talitor-product-docs-table__product-link {
  text-decoration: none;
  color: #333;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.15;
  display: inline-block;
}

.talitor-product-docs-table__product-link:hover,
.talitor-product-docs-table__product-link:focus {
  text-decoration: underline;
}

.talitor-doc-cell {
  display: grid;
  gap: 4px;
}

.talitor-doc-cell__empty {
  display: inline-block;
  color: #888;
  font-size: 0.82rem;
  line-height: 1.1;
}

/* ===== PARTIE MARQUES ===== */
.talitor-brand-doc-group {
  display: grid;
  gap: 10px;
}

.talitor-brand-doc-group__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  min-height: 48px;
}

.talitor-brand-doc-group__logo {
  display: block;
  width: 60px;
  height: 46px;
  object-fit: contain;
  border-radius: 6px;
  flex: 0 0 46px;
}

.talitor-brand-doc-group__title {
  margin: 0 !important;
  font-size: 1.05rem;
  line-height: 1.2;
  font-weight: 700;
  display: flex;
  align-items: center;
  min-height: 46px;
}

.talitor-brand-doc-list {
  display: grid;
  gap: 8px;
}

/* ===== MON COMPTE ===== */
.talitor-smart-docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.t-doc-card {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 15px;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  background: #fff;
}

.t-doc-thumb img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.t-doc-info {
  width: 100%;
  min-width: 0;
}

.t-prod-name {
  margin: 0 0 10px 0;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
}

.t-prod-name a {
  text-decoration: none;
  color: #333;
}

.t-prod-name a:hover,
.t-prod-name a:focus {
  text-decoration: underline;
}

.t-doc-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}

/* ===== ONGLET / ARCHIVES DOCUMENTS ===== */
.te-documents-tab {
  display: grid;
  gap: 28px;
}

.te-doc-section {
  display: grid;
  gap: 14px;
}

.te-doc-section--brand {
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.te-doc-section__title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.3;
  font-weight: 700;
}

.te-doc-group {
  display: grid;
  gap: 10px;
}

.te-doc-group__title {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.3;
  font-weight: 600;
  opacity: 0.88;
}

.te-doc-list {
  display: grid;
  gap: 10px;
}

.te-archive-documents {
  margin-top: 40px;
}

.te-doc-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  margin: 0 0 14px;
}

/* ===== VERSION COMPACTE POUR ARCHIVES ===== */
.te-doc-section--archive {
  gap: 10px;
}

.te-doc-section--archive .te-doc-section__title {
  font-size: 1.1rem;
  line-height: 1.25;
  margin-bottom: 2px;
}

.te-doc-section--archive .te-doc-group {
  gap: 6px;
}

.te-doc-section--archive .te-doc-group__title {
  font-size: 0.82rem;
  line-height: 1.2;
  font-weight: 600;
  opacity: 0.72;
  letter-spacing: 0.02em;
}

.te-doc-section--archive .te-doc-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}

/* ===== BOUTON ALU MAT BROSSÉ ===== */
.te-doc-link {
  position: relative;
  overflow: hidden;
  isolation: isolate;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;

  padding: 8px 9px;
  min-height: 40px;

  border: 0;
  border-radius: 10px;

  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.14) 0px,
      rgba(255, 255, 255, 0.14) 1px,
      rgba(0, 0, 0, 0.08) 1px,
      rgba(0, 0, 0, 0.08) 2px,
      transparent 2px,
      transparent 3.5px
    ),
    linear-gradient(135deg, #eef0f1 0%, #f6f7f8 52%, #fbfbfb 100%);

  background-blend-mode: overlay, normal;
  background-clip: padding-box;

  text-decoration: none !important;
  box-shadow:
    0 0 2px rgba(0, 0, 0, 0.2),
    0 1px 2px rgba(0, 0, 0, 0.1);

  transform: translateZ(0);
  backface-visibility: hidden;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;

  width: 100%;
  box-sizing: border-box;
}

/* Hover global */
.te-doc-link:hover,
.te-doc-link:focus {
  transform: scale(0.995) translateZ(0);
  filter: none;
  box-shadow:
    0 0 1px rgba(0, 0, 0, 0.08),
    0 1px 1px rgba(0, 0, 0, 0.07);
  text-decoration: none !important;
}

.te-doc-link:active {
  transform: scale(0.985) translateZ(0);
  filter: brightness(0.995);
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.07);
}

/* Hover séparé et plus soutenu pour Produktdokumenter */
.talitor-product-docs-table .te-doc-link:hover,
.talitor-product-docs-table .te-doc-link:focus {
  transform: scale(0.992) translateZ(0);
  filter: none;
  box-shadow:
    0 0 1px rgba(0, 0, 0, 0.06),
    0 0.5px 0.8px rgba(0, 0, 0, 0.05);
  text-decoration: none !important;
}

.talitor-product-docs-table .te-doc-link:active {
  transform: scale(0.978) translateZ(0);
  filter: brightness(0.995);
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.06);
}

.te-doc-link__left,
.te-doc-link__right {
  display: flex;
  align-items: center;
  min-width: 0;
}

.te-doc-link__left {
  flex: 1 1 auto;
  gap: 6px;
}

.te-doc-link__right {
  flex: 0 0 42px;
  width: 56px;
  justify-content: flex-end;
}

.te-doc-link__title {
  display: inline-block;
  min-width: 0;
  font-size: 0.8rem;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: 0.003em;
  color: #25282b;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
  flex: 1 1 auto;
}

/* comportement selon contexte */
.talitor-product-docs-table .te-doc-link__title {
  white-space: nowrap;
  word-break: normal;
}

.t-doc-actions .te-doc-link__title,
.te-doc-link--account .te-doc-link__title,
.te-doc-section .te-doc-link__title,
.te-doc-section--archive .te-doc-link__title {
  white-space: normal;
  word-break: break-word;
}

.te-doc-link__lang {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  white-space: nowrap;
}

.te-doc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex: 0 0 auto;
  font-weight: 700;
  line-height: 1;
}

/* Harmonisation hauteur / radius badges langue et type */
.te-doc-badge--lang,
.te-doc-badge--file,
.te-doc-badge--file-fixed,
.te-doc-flag {
  height: 24px;
  border-radius: 6px;
}

.te-doc-badge--lang {
  padding: 0 6px;
  font-size: 0.62rem;
  background: rgba(0, 0, 0, 0.045);
  color: #111;
}

.te-doc-badge--file,
.te-doc-badge--file-fixed {
  min-width: 30px;
  padding: 0 8px;
  font-size: 0.62rem;
  justify-content: center;
  background: rgba(0, 0, 0, 0.08);
  color: #111;
}

.te-doc-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  overflow: hidden;
}

.te-doc-flag-icon {
  display: inline-block;
  height: 18px;
  width: auto;
  vertical-align: middle;
  flex: 0 0 auto;
}

.te-doc-flag svg {
  display: block;
  height: 18px;
  width: auto;
  border-radius: 10px;
}

/* ===== AFFINAGE COMPACT ARCHIVES ===== */
.te-doc-section--archive .te-doc-link {
  padding: 8px 8px;
  border-radius: 10px;
  gap: 10px;
}

.te-doc-section--archive .te-doc-link__left,
.te-doc-section--archive .te-doc-link__right {
  gap: 8px;
}

.te-doc-section--archive .te-doc-link__title {
  font-size: 0.92rem;
  line-height: 1.25;
  font-weight: 600;
}

.te-doc-section--archive .te-doc-badge--file,
.te-doc-section--archive .te-doc-badge--lang,
.te-doc-section--archive .te-doc-flag {
  height: 22px;
}

.te-doc-section--archive .te-doc-badge--file,
.te-doc-section--archive .te-doc-badge--lang {
  font-size: 0.68rem;
}

.te-doc-section--archive .te-doc-flag-icon,
.te-doc-section--archive .te-doc-flag svg {
  height: 16px;
}

/* ===== RESPONSIVE PRODUKTDOKUMENTER ===== */
@media (max-width: 1200px) {
  .talitor-product-docs-table,
  .talitor-product-docs-table tbody,
  .talitor-product-docs-table tr,
  .talitor-product-docs-table td {
    display: block;
    width: 100% !important;
  }

  .talitor-product-docs-table {
    table-layout: auto;
    border-collapse: separate;
  }

  .talitor-product-docs-table tr {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  .talitor-product-docs-table td {
    padding: 0;
    border: 0;
    min-width: 0;
  }

  .talitor-product-docs-table .col-image {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 44px !important;
  }

  .talitor-product-docs-table .col-image img {
    width: 44px;
    height: 44px;
  }

  .talitor-product-docs-table .col-name {
    grid-column: 2;
    grid-row: 1;
    width: auto !important;
  }

  .talitor-product-docs-table .col-sku {
    grid-column: 2;
    grid-row: 2;
    width: auto !important;
    font-size: 0.8rem;
    line-height: 1.1;
  }

  .talitor-product-docs-table .col-doc {
    grid-column: 1 / -1;
    width: auto !important;
  }

  .talitor-doc-cell {
    gap: 6px;
  }

  .talitor-product-docs-table .col-doc + .col-doc {
    margin-top: 2px;
  }

  .talitor-product-docs-table .te-doc-link {
    width: 100%;
  }

  .talitor-product-docs-table .te-doc-link__title {
    white-space: normal;
    line-height: 1.1;
  }

  .talitor-product-docs-table-wrap {
    overflow: visible;
  }
}

@media (max-width: 768px) {
  .te-doc-section--archive .te-doc-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .talitor-brand-doc-group__logo {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
  }

  .talitor-brand-doc-group__title {
    min-height: 42px;
    margin: 0 !important;
  }

  .talitor-product-docs-table tr {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 8px 10px;
    padding: 10px 0;
  }

  .talitor-product-docs-table .col-image {
    width: 40px !important;
  }

  .talitor-product-docs-table .col-image img {
    width: 40px;
    height: 40px;
  }

  .talitor-product-docs-table__product-link {
    font-size: 0.86rem;
  }

  .talitor-product-docs-table .col-sku {
    font-size: 0.76rem;
  }

  .talitor-product-docs-table .te-doc-link {
    padding: 7px 8px;
    min-height: 38px;
  }

  .talitor-product-docs-table .te-doc-link__title {
    font-size: 0.78rem;
  }

  .talitor-product-docs-table .te-doc-link__right {
    width: 52px;
    flex: 0 0 52px;
  }

  .talitor-smart-docs-grid {
    grid-template-columns: 1fr;
  }

  .t-doc-card {
    padding: 12px;
  }

  .t-doc-thumb img {
    width: 56px;
    height: 56px;
  }

  .te-doc-link--account {
    padding: 7px 8px;
    min-height: 38px;
  }

  .te-doc-link--account .te-doc-link__left {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .te-doc-link--account .te-doc-link__right {
    width: 52px;
    flex: 0 0 52px;
    justify-content: flex-end;
  }

  .te-doc-link--account .te-doc-link__title {
    font-size: 0.78rem;
    white-space: normal;
    line-height: 1.1;
  }

  .te-doc-link--account .te-doc-link__lang {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .te-doc-link,
  .te-doc-section--archive .te-doc-link {
    padding: 8px 10px;
  }

  .te-doc-link__right {
    width: 52px;
    flex: 0 0 52px;
  }
}
