/**
 * Downloads Pages Styles
 * Styles pour les pages de téléchargements (Notices, Dossiers techniques, Manuels)
 */

/* ================================================
   HEADER SECTION
   ================================================ */

.downloads-page-header {
  position: relative;
  background-color: #E8E8E8;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 60px 120px;
  margin-bottom: 0;
  min-height: 280px;
  display: flex;
  align-items: center;
}

.downloads-page-header__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  z-index: 1;
}

.downloads-page-header__content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 60px;
}

.downloads-page-header__text {
  flex: 1;
  max-width: 700px;
}

.downloads-page-header__icon {
  flex-shrink: 0;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  padding: 40px;
}

.downloads-page-header__icon svg {
  width: 100%;
  height: 100%;
  opacity: 0.6;
}

.downloads-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.downloads-breadcrumb__link {
  color: #8B8B8B;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  transition: color 0.3s ease;
}

.downloads-breadcrumb__link:hover {
  color: #000;
  text-decoration: underline;
}

.downloads-breadcrumb__separator {
  color: #8B8B8B;
  font-size: 14px;
}

.downloads-breadcrumb__current {
  color: #000;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
}

.downloads-page-header__title {
  color: #000;
  font-family: Poppins, sans-serif;
  font-size: 48px;
  font-weight: 300;
  line-height: 1.3;
  margin: 0 0 15px 0;
}

.downloads-page-header__description {
  color: #555758;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  margin: 0;
  max-width: 600px;
}

/* ================================================
   LOGIN MODAL (pop-up au clic sur document verrouillé)
   ================================================ */

.rg-dt-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.rg-dt-login-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.rg-dt-login-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.rg-dt-login-modal__box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

/* Carte de la modal : position relative pour que la croix soit à l'intérieur */
.downloads-login-box--modal {
  position: relative;
  padding-top: 20px;
  padding-right: 52px;
  margin-bottom: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.rg-dt-login-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: #333;
  cursor: pointer;
  border-radius: 8px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  transition: background 0.2s ease, color 0.2s ease;
}

.rg-dt-login-modal__close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #000;
}

.rg-dt-login-modal__close svg {
  flex-shrink: 0;
}

.rg-dt-login-modal__close-text {
  white-space: nowrap;
}

/* ================================================
   LOGIN BOX (contenu de la pop-up)
   ================================================ */

.rg-dt-login-modal__box .downloads-login-box {
  margin-bottom: 0;
}

.downloads-login-box {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 32px;
  max-width: 420px;
}

.downloads-login-box__title {
  font-family: Poppins, sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #000;
  margin: 0 0 8px 0;
}

.downloads-login-box__desc {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  color: #555758;
  margin: 0 0 20px 0;
  line-height: 1.4;
}

.downloads-login-box__error {
  background: #ffebee;
  color: #c62828;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  margin: 0 0 16px 0;
}

.downloads-login-box__form {
  margin: 0;
}

.downloads-login-box__row {
  margin: 0 0 16px 0;
}

.downloads-login-box__row--submit {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.downloads-login-box__label {
  display: block;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 6px;
}

.downloads-login-box__input {
  width: 100%;
  max-width: 320px;
  padding: 10px 14px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
  box-sizing: border-box;
}

.downloads-login-box__input:focus {
  border-color: #000;
  outline: none;
}

.downloads-login-box__remember {
  font-size: 14px;
  color: #555;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.downloads-login-box__remember input {
  margin: 0;
}

.downloads-login-box__submit {
  padding: 10px 24px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease;
}

.downloads-login-box__submit:hover {
  background: #333;
}

/* ================================================
   DOWNLOADS LIST SECTION
   ================================================ */

.downloads-list-section {
  background-color: #F8F8F8;
  padding: 60px 120px 80px;
  position: relative;
}

.downloads-list-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, #D0D0D0 50%, transparent 100%);
}

.downloads-list-container {
  max-width: 100%;
}

.downloads-export-link {
  margin-bottom: 16px;
  text-align: right;
}

.downloads-export-link__a {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #555758;
  text-decoration: none;
}

.downloads-export-link__a:hover {
  text-decoration: underline;
  color: #000;
}

/* ================================================
   TEST DOC TYPE BAR (Notices / Manuels) – conservé pour autres types si besoin
   ================================================ */

.downloads-doc-type-test {
  margin-bottom: 24px;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid #f97373;
  background: #fff4f4;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: space-between;
}

.downloads-doc-type-test__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.downloads-doc-type-test__label {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #b91c1c;
}

.downloads-doc-type-test__counts {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #7f1d1d;
}

.downloads-doc-type-test__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.downloads-doc-type-test__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #f87171;
  background: #fee2e2;
  color: #7f1d1d;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.downloads-doc-type-test__btn:hover {
  background: #fecaca;
  border-color: #fb7185;
  color: #7f1d1d;
}

.downloads-doc-type-test__btn.is-active {
  background: #ef4444;
  border-color: #b91c1c;
  color: #fff;
}

.downloads-doc-type-test__btn--export {
  border-style: dashed;
  background: #ffffff;
  color: #7f1d1d;
}

.downloads-doc-type-test__btn--export:hover {
  background: #fee2e2;
}

/* Filters Bar */
.downloads-filters-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  gap: 20px;
  flex-wrap: wrap;
}

.downloads-filters-left {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  flex: 1;
}

.downloads-filter-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.downloads-filter-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: #555758;
}

.downloads-filter-label {
  color: #555758;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.downloads-filters-right {
  display: flex;
  gap: 12px;
}

.downloads-filter-select {
  min-width: 200px;
  padding: 12px 40px 12px 16px;
  background-color: #FFF;
  color: #000;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23555758' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  transition: all 0.3s ease;
}

.downloads-filter-select:hover {
  border-color: #F0C800;
}

.downloads-filter-select:focus {
  outline: none;
  border-color: #F0C800;
  box-shadow: 0 0 0 3px rgba(240, 200, 0, 0.1);
}

/* Downloads Table */
.downloads-table-wrapper {
  background-color: transparent;
  overflow-x: auto;
}

.downloads-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
}

/* Annule le reset : pas de bordure en haut du thead, toutes les lignes blanches */
.downloads-table caption + thead tr:first-child td,
.downloads-table caption + thead tr:first-child th,
.downloads-table colgroup + thead tr:first-child td,
.downloads-table colgroup + thead tr:first-child th,
.downloads-table thead:first-child tr:first-child td,
.downloads-table thead:first-child tr:first-child th {
  border-block-start: none;
}

.downloads-table tbody > tr:nth-child(odd) > td,
.downloads-table tbody > tr:nth-child(odd) > th {
  background-color: #FFF;
}

.downloads-table tbody tr:hover > td,
.downloads-table tbody tr:hover > th {
  background-color: #FFF;
}

.downloads-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.downloads-table thead tr {
  background-color: transparent;
}

.downloads-table th {
  background-color: transparent;
  padding: 16px 20px;
  text-align: left;
  color: #555758;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  border: none;
  align-content: center;
}

.downloads-th {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.downloads-th-icon {
  color: #555758;
}

.downloads-th-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.downloads-th-label {
  white-space: nowrap;
}

.downloads-th--download {
  width: 100%;
}

.downloads-th--filter {
  align-items: center;
  width: 100%;
}

.downloads-th--filter .downloads-filter-select {
  margin-left: 8px;
  min-width: 180px;
}

.downloads-table th:first-child {
  padding-left: 24px;
}

.downloads-table th:last-child {
  text-align: right;
  padding-right: 24px;
}

.downloads-table tbody tr {
  background-color: #FFF;
  transition: all 0.3s ease;
}

.downloads-table tbody tr:hover {
  background-color: #FFF;
}

.downloads-table td {
  padding: 20px;
  color: #000;
  font-feature-settings: "liga" 0, "clig" 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 140%;
  letter-spacing: 0.14px;
  border: none;
  vertical-align: middle;
}

.downloads-table tbody tr td:first-child {
  padding-left: 24px;
}

.downloads-table tbody tr td:last-child {
  padding-right: 24px;
  text-align: right;
}

/* Column: Reference */
.downloads-table__reference {
  font-weight: 500;
  color: #000;
  white-space: nowrap;
}

/* Column: Product Name */
.downloads-table__product {
  color: #000;
  max-width: 400px;
}

/* Column: Document (filename) */
.downloads-table__document {
  color: #000;
  max-width: 280px;
}

.downloads-table__document .downloads-filename {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  word-break: break-all;
}

/* Column: Type (legacy) */
.downloads-table__type {
  color: #555758;
  white-space: nowrap;
}

/* Column: Filter (empty cell, select is in header) */
.downloads-table__filter {
  width: 1%;
  white-space: nowrap;
  padding: 12px 24px 12px 12px;
}

/* Column: Download Button */
.downloads-table__download {
  text-align: right;
}

.download-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: transparent;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.download-btn-icon:hover {
  background-color: #F0C800;
  border-color: #F0C800;
  transform: scale(1.1);
}

.download-btn-icon svg {
  width: 24px;
  height: 24px;
}

.download-btn-icon:hover svg path {
  stroke: #FFF;
}

/* Locked state for technical docs */
.download-btn-icon.is-locked {
  background-color: #F5F5F5;
  cursor: not-allowed;
  border-color: #E0E0E0;
}

.download-btn-icon.is-locked:hover {
  background-color: #F5F5F5;
  border-color: #E0E0E0;
  transform: none;
}

.download-btn-icon.is-locked svg path {
  stroke: #BDBDBD;
}

/* Lock icon for protected downloads */
.lock-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #C9252D;
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px;
}

.lock-icon svg {
  width: 14px;
  height: 14px;
}

/* Empty state */
.downloads-empty {
  text-align: center;
  padding: 80px 20px;
  background-color: #FFF;
  border-radius: 12px;
  margin-top: 20px;
}

.downloads-empty__icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  opacity: 0.3;
}

.downloads-empty__title {
  color: #000;
  font-family: Poppins, sans-serif;
  font-size: 24px;
  font-weight: 500;
  margin: 0 0 10px 0;
}

.downloads-empty__text {
  color: #555758;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 16px;
  font-weight: 400;
  margin: 0;
}

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 768px) {
  .downloads-pagination {
    padding: 20px 0;
    gap: 12px;
  }
  
  .downloads-pagination__arrow {
    width: 36px;
    height: 36px;
  }
  
  .downloads-pagination__info {
    font-size: 13px;
    padding: 0 5px;
  }
}

@media (max-width: 1200px) {
  .downloads-page-header {
    padding: 50px 60px;
  }

  .downloads-list-section {
    padding: 50px 60px 60px;
  }

  .downloads-page-header__content {
    gap: 40px;
  }

  .downloads-page-header__icon {
    width: 150px;
    height: 150px;
  }
}

@media (max-width: 1024px) {
  .downloads-page-header,
  .downloads-list-section {
    padding-left: 40px;
    padding-right: 40px;
  }

  .downloads-page-header__title {
    font-size: 36px;
  }

  .downloads-page-header__content {
    flex-direction: column;
    text-align: center;
    gap: 30px;
  }

  .downloads-page-header__text {
    max-width: 100%;
  }

  .downloads-page-header__icon {
    width: 120px;
    height: 120px;
  }

  .downloads-breadcrumb {
    justify-content: center;
  }

  .downloads-filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .downloads-filters-left,
  .downloads-filters-right {
    width: 100%;
  }

  .downloads-filter-select {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .downloads-page-header,
  .downloads-list-section {
    padding-left: 20px;
    padding-right: 20px;
  }

  .downloads-page-header {
    padding-top: 40px;
    padding-bottom: 40px;
    min-height: 200px;
  }

  .downloads-page-header__title {
    font-size: 28px;
  }

  .downloads-page-header__description {
    font-size: 14px;
  }

  .downloads-page-header__icon {
    width: 100px;
    height: 100px;
    padding: 20px;
  }

  /* Mobile: Convert table to cards */
  .downloads-table-wrapper {
    overflow-x: visible;
  }

  .downloads-table,
  .downloads-table thead,
  .downloads-table tbody,
  .downloads-table th,
  .downloads-table td,
  .downloads-table tr {
    display: block;
  }

  .downloads-table thead {
    display: none;
  }

  .downloads-table tbody tr {
    margin-bottom: 16px;
    padding: 20px;
  }

  .downloads-table td {
    padding: 8px 0;
    text-align: left !important;
    border-radius: 0 !important;
  }

  .downloads-table td:first-child {
    padding-left: 0;
  }

  .downloads-table td:last-child {
    padding-right: 0;
  }

  .downloads-table td:before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    color: #555758;
    font-size: 12px;
    margin-bottom: 4px;
    text-transform: uppercase;
  }

  .downloads-table__download {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #F0F0F0;
  }
}

@media (max-width: 480px) {
  .downloads-page-header__title {
    font-size: 24px;
  }

  .downloads-breadcrumb {
    font-size: 12px;
  }
}

/* ================================================
   PAGINATION
   ================================================ */

.downloads-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 30px 0;
  margin-top: 20px;
}

.downloads-pagination__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 2px solid #E0E0E0;
  border-radius: 8px;
  background-color: #FFF;
  color: #000;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.downloads-pagination__arrow:not(.is-disabled):hover {
  background-color: #F0C800;
  border-color: #F0C800;
  transform: scale(1.1);
}

.downloads-pagination__arrow.is-disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.downloads-pagination__arrow svg {
  width: 20px;
  height: 20px;
}

.downloads-pagination__info {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #555758;
  padding: 0 10px;
  white-space: nowrap;
}

/* ================================================
   STATS SECTION (4 colonnes avec icônes)
   ================================================ */

#clem-logo-2 {
  --flex-direction: row !important;
  --gap: 40px !important;
  --justify-content: space-evenly !important;
  --align-items: center !important;
  --flex-wrap: nowrap !important;
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-evenly !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 40px !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 60px 120px !important;
  background-color: #FFF !important;
  position: relative !important;
}

#clem-logo-2::after {
  content: '' !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 1px !important;
  background: linear-gradient(90deg, transparent 0%, #D0D0D0 50%, transparent 100%) !important;
}

/* Override des variables CSS Elementor pour chaque item enfant direct */
#clem-logo-2 > .e-con-full.e-flex.e-child {
  --flex-direction: column !important;
  --flex-grow: 1 !important;
  --flex-shrink: 1 !important;
  --flex-basis: 0 !important;
  --align-items: center !important;
  --justify-content: center !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  flex: 1 1 0 !important;
  min-width: 0 !important;
  max-width: none !important;
}

#clem-logo-2 .elementor-widget-image {
  margin-bottom: 15px !important;
  width: 100% !important;
}

#clem-logo-2 .elementor-widget-image img {
  width: 80px !important;
  height: 80px !important;
  object-fit: contain !important;
  margin: 0 auto !important;
  display: block !important;
}

#clem-logo-2 .elementor-widget-heading {
  width: 100% !important;
}

#clem-logo-2 .elementor-heading-title {
  color: #555758 !important;
  font-family: "Plus Jakarta Sans", sans-serif !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  margin: 0 !important;
  text-align: center !important;
}

/* Responsive */
@media (max-width: 1200px) {
  #clem-logo-2 {
    padding: 50px 60px !important;
  }

  #clem-logo-2 .e-con-inner {
    gap: 30px !important;
  }
}

@media (max-width: 900px) {
  #clem-logo-2 {
    padding: 40px 40px !important;
  }

  #clem-logo-2 .e-con-inner {
    gap: 20px !important;
  }

  #clem-logo-2 .elementor-widget-image img {
    width: 60px !important;
    height: 60px !important;
  }

  #clem-logo-2 .elementor-heading-title {
    font-size: 14px !important;
  }
}

@media (max-width: 768px) {
  #clem-logo-2 {
    padding: 40px 20px !important;
  }

  #clem-logo-2 .e-con-inner {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 30px !important;
  }

  #clem-logo-2 .e-con-full.e-flex {
    flex: 0 1 calc(50% - 15px) !important;
  }
}

@media (max-width: 480px) {
  #clem-logo-2 .e-con-inner {
    flex-direction: column !important;
    gap: 25px !important;
  }

  #clem-logo-2 .e-con-full.e-flex {
    flex: 1 !important;
    max-width: 100% !important;
  }
}
