/********************************! Disposition *********************************/
.dz-table-container {
  width: 100% !important;
  border-radius: 10px;
  overflow: hidden !important;
}

.dz-table-container .content {
  padding-top: 0 !important;
}

.dz-table-container .container {
  padding: 0 !important;
  margin: 50px 0 0 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

.dz-table-header .avia-image-container,
.dz-table-description .avia-image-container {
  width: auto !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
}

.dz-table-container .column-top-margin {
  margin-top: 0 !important;
}

.dz-table-header,
.dz-table-description {
  display: flex !important;
  align-items: center !important;
  padding: 20px 20px !important;
  margin: 0 !important;
}

.dz-table-description img {
  width: 50px !important;
  height: 50px !important;
  margin-right: 10px;
}

.dz-table-header-img img {
  width: 36px !important;
  height: 36px !important;
  margin-right: 10px;
}

.dz-table-header h1 {
  margin: 0 !important;
}

@media screen and (min-width: 768px) {
  .dz-table-container {
    width: calc(100%) !important;
  }

  .dz-table-header,
  .dz-table-description {
    padding: 15px 20px !important;
  }
}

/* TODO : Réorganiser les styles */
.filters-header {
  background-color: #ffffff !important;
}

.dz-table-header h1,
.account-tabs-content h1 {
  color: white !important;
  text-transform: lowercase !important;
  font-weight: 500 !important;
}

.dz-table-header h1:first-letter,
.account-tabs-content h1:first-letter {
  text-transform: uppercase !important;
}

.dz-table-header img {
  display: none !important;
}

.product-table thead tr th:first-child {
  border-top-left-radius: 5px !important;
}

.product-table thead tr th:last-child {
  border-top-right-radius: 5px !important;
}

/********************************! Filtres *********************************/
.table-controls {
  display: flex;
  align-items: center;
  padding: 0 0 1.5rem 1.5rem;
  gap: 1rem;
}

/* Formulaire des filtres */
.product-filters-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Inputs et Selects */
.filter-group input,
.filter-group select {
  width: 100% !important;
  padding: 0.75rem 1rem !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 0.375rem !important;
  background-color: white !important;
  font-size: 0.875rem !important;
  color: #1a202c !important;
  transition: all 0.2s ease-in-out !important;
  margin: 0 !important;
}

.filter-group input:focus,
.filter-group select:focus {
  border-color: #3182ce !important;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1) !important;
  outline: none !important;
}

.filter-group input::placeholder {
  color: #a0aec0 !important;
}

/* Style personnalisé pour les select */
.filter-group select {
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 1rem center !important;
  padding-right: 2.5rem !important;
}

.open-filters-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: var(--color-secondary);
  color: var(--color-primary);
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none !important;
}

.open-filters-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Overlay */
.filters-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 998;
}

.filters-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

/* Sidebar */
.filters-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  max-width: 100%;
  width: 100%;
  height: 100vh !important;
  padding-top: 80px !important;
  background-color: #fff;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
  transition: right 0.3s ease;
  z-index: 999;
  overflow-y: auto;
}

body.admin-bar .filters-sidebar {
  padding-top: calc(80px + 46px) !important;
}

@media (min-width: 768px) {
  .filters-sidebar {
    max-width: 400px;
    padding-top: 64px !important;
  }

  body.admin-bar .filters-sidebar {
    padding-top: calc(64px + 32px) !important;
  }
}

.filters-sidebar.is-open {
  right: 0;
}

/* En-tête de la sidebar */
.filters-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #dee2e6;
}

.filters-sidebar-header h2 {
  margin: 0;
  font-size: 1.25rem;
  text-transform: capitalize !important;
}

.close-filters-button {
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: #6c757d;
  transition: color 0.2s ease;
}

.close-filters-button:hover {
  color: #343a40;
}

.close-filters-button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Formulaire et groupes de filtres */
.product-filters-form {
  padding: 16px;
  width: 100%;
}

.filters-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 100%;
}

/* Actions des filtres */
.filter-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  width: 100%;
}

.filter-actions button {
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  text-align: center;
  box-sizing: border-box;
  background-color: var(--background-tertiary) !important;
  color: var(--color-primary) !important;
  flex: 1;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

/* Filtres actifs */
.active-filters-container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.active-filters-header {
  color: white !important;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.filter-chip,
.reset-filters-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background-color: #e9ecef;
  border-radius: 5px;
  font-size: 14px;
}

.filter-chip .filter-label {
  color: #6c757d;
}

.filter-chip .filter-value {
  font-weight: 900;
}

.filter-chip .remove-filter {
  padding: 2px;
  background: none;
  border: none;
  cursor: pointer;
  color: #6c757d;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
}

.filter-chip .remove-filter svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.filter-chip .remove-filter:hover {
  color: #dc3545;
}

.reset-filters-button {
  background-color: var(--background-tertiary) !important;
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  color: var(--color-primary) !important;
}

.reset-filters-button:hover {
  background-color: var(--background-tertiary-hover) !important;
  font-weight: 900 !important;
}

/********************************! Sélection par page *********************************/
.per-page-form {
  width: 160px !important;
  margin: 0 !important;
}

.per-page-filter {
  margin: 0 !important;
  border: 2px solid var(--color-border) !important;
  border-radius: 4px !important;
  font-size: 12px !important;
  color: var(--color-semi-border) !important;
}

/********************************! Filtres Historique des achats *********************************/
#orders-history-by-sku-filters form.orders-history-by-sku-filters-form {
  background-color: var(--background-secondary) !important;
  padding: 1rem !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 10px !important;
}

#orders-history-by-sku-filters .intro-message {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 30px;
  color: white !important;
}

#orders-history-by-sku-filters.intro-icon {
  flex-shrink: 0;
  color: white !important;
}

#orders-history-by-sku-filters .filter-group,
#orders-history-by-sku-filters .date-filters-group {
  color: white !important;
  display: flex !important;
}

#orders-history-by-sku-filters .filter-group input {
  max-width: 350px !important;
}

#orders-history-by-sku-filters.orders-history-by-sku-filters
  .date-filters-group,
#orders-history-by-sku-filters.orders-history-by-sku-filters .filter-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0px !important;
}

#orders-history-by-sku-filters.orders-history-by-sku-filters
  .filter-group:first-child {
  margin-bottom: 20px !important;
}

#orders-history-by-sku-filters.orders-history-by-sku-filters
  .date-filters-group {
  margin-bottom: 15px !important;
}

#orders-history-by-sku-filters.orders-history-by-sku-filters
  .filter-group
  label {
  width: 150px !important;
  margin-right: 12px;
}

.orders-history-by-sku-filters .date-filters-group .filter-group {
  min-width: auto !important;
  width: auto !important;
}

#orders-history-by-sku-filters .date-filters-group p {
  width: 150px !important;
  margin-right: 12px;
}

#orders-history-by-sku-filters .date-filters-group #start_date {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

#orders-history-by-sku-filters .date-filters-group #end_date {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

#orders-history-by-sku-filters .date-separator {
  background-color: var(--color-border-dark);
  color: black;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 43px;
  width: 43px;
}

#orders-history-by-sku-filters .filter-input-wrapper {
  position: relative;
}

#orders-history-by-sku-filters .helper-text {
  position: absolute;
  color: var(--color-gray-400);
}

#orders-history-by-sku-filters .filter-group .helper-text,
#orders-history-by-sku-filters .date-filters-group .helper-text {
  top: 43px;
  left: 0;
  white-space: nowrap;
}

#orders-history-by-sku-filters .filter-actions {
  margin-left: 162px;
  max-width: 150px !important;
}

/********************************! Page Mon compte *********************************/

.account-tabs-nav {
  display: flex;
  gap: 0.5rem;
  padding-right: 2rem;
}

.account-tabs-content {
  width: 100% !important;
}

.account-tabs-content .product-table-container {
  max-width: 100% !important;
}

.account-tabs-content .column-actions {
  display: flex;
  gap: 1rem;
  height: 70px !important;
}

.custom-account-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.tab-link:not(.active):hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.tab-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  text-decoration: none;
  background-color: transparent;
  color: white !important;
  border-radius: 4px;
  transition: all 0.2s;
}

.tab-link.active {
  background-color: var(--background-tertiary);
  color: var(--color-primary) !important;
  font-weight: bold;
}

/* Boutons */
.account-tabs-content .column-actions .button {
  background-color: var(--background-tertiary);
  color: var(--color-primary);
  border-radius: 5px;
  cursor: pointer;
  max-width: 125px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.account-tabs-content .column-actions .button:hover {
  background-color: var(--background-tertiary-hover) !important;
}

.account-tabs-content .button.view.disabled {
  background-color: transparent !important;
  border: 1px solid var(--color-border-dark) !important;
  cursor: not-allowed;
}

.account-tabs-content .button .invoice-icon {
  height: 16px !important;
  width: 16px !important;
}

/* Facture en attente - Table - Footer */
.totals-wrapper {
  margin-top: 2rem;
  overflow-x: auto;
}

.totals-table {
  width: 100%;
  border-collapse: collapse;
  color: white;
}

.totals-table th,
.totals-table td {
  padding: 0.75rem;
  text-align: center;
  border: 1px solid var(--color-border);
}

.totals-table th {
  font-weight: 600;
}

.totals-table td.total-all {
  font-weight: bold;
}

/* Responsive pour mobile */
@media screen and (max-width: 1023px) {
  .totals-table thead.desktop-only {
      display: none;
  }

  .totals-table, 
  .totals-table tbody, 
  .totals-table tr, 
  .totals-table td {
      display: block;
      width: 100%;
  }

  .totals-table tr {
      margin-bottom: 1rem;
  }

  .totals-table td {
      text-align: right;
      padding: 0.75rem 1rem;
      border: 1px solid var(--color-border);
  }

  .totals-table td::before {
      content: attr(data-label);
      float: left;
      font-weight: 600;
      color: var(--color-gray-400);
  }
}

/* Desktop */
@media screen and (min-width: 1024px) {
  .totals-table {
      table-layout: fixed;
  }

  .totals-table td::before {
      display: none !important;
  }
}

@media (min-width: 1024px) {
  .account-tabs-nav {
    position: fixed !important;
    flex-direction: column;
    gap: 0.5rem;
    padding-right: 16px !important;
    margin-right: 16px !important;
    border-right: 1px solid var(--color-border) !important;
    min-height: 100vh;
  }

  .account-tabs-content {
    margin-left: 200px !important;
    width: calc(100% - 200px) !important;
  }

  .account-tabs-content .product-row {
    height: 70px !important;
  }

  .account-tabs-content .column-order_number {
    text-align: center !important;
  }
}

@media (max-width: 1024px) {
  .custom-account-container {
    flex-direction: column;
  }

  .account-tabs-nav {
    flex: 0 0 auto;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid #eee;
    padding-right: 0;
    padding-bottom: 1rem;
  }

  .tab-link {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
  }
}

@media (max-width: 450px) {
}

/********************************! Tableau *********************************/
.product-table-container {
  background-color: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  border-top-left-radius: 5px !important;
  border-top-right-radius: 5px !important;
}

.product-table-container.single-page {
  border-bottom-right-radius: 5px !important;
  border-bottom-left-radius: 5px !important;
  padding-bottom: 18px !important;
}

.product-table {
  width: 100%;
  background-color: white !important;
  margin: 0 !important;
  border-radius: 5px !important;
}

/* Cas sans données */
.empty-state-message {
  color: white !important;
  text-align: center;
  margin: 20px 20px 60px 20px;
  font-size: 18px;
  margin-top: 70px !important;
}

.empty-state-message button {
  background-color: var(--background-tertiary) !important;
  color: var(--color-primary) !important;
  border: none !important;
  border-radius: 5px !important;
  padding: 10px 20px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
}

/* Réinitialisation des styles de lignes */
.product-table tbody tr:nth-child(even),
.product-table tbody tr:nth-child(odd) {
  color: inherit !important;
}

/* Cache l'en-tête */
.desktop-only {
  display: none;
}

/* Style des cartes produits */
.product-row {
  display: grid;
  grid-template-columns: 1fr;
  margin: 1rem;
  border-radius: 15px;
  background-color: white !important;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
  position: relative;
  border: 1px solid var(--color-border-dark);
}

.product-row td {
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
}

/* Labels pour chaque cellule */
td[data-label]::before {
  content: attr(data-label);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  padding: 3px 0;
}

/* Image du produit */
.column-image {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border) !important;
}

.column-image img {
  aspect-ratio: 1;
  width: 100%;
  height: 100%;
  max-width: 200px;
  max-height: 200px;
  object-fit: contain;
  padding: 1rem;
}

/* Boutons actions */
.column-actions .icon-button {
  height: 40px !important;
  width: 40px !important;
  padding: 5px !important;
  border: 1px solid var(--color-border-dark) !important;
  border-radius: 5px !important;
}

.column-actions .icon-button svg {
  width: auto;
  height: 100%;
}

.column-actions .icon-button:not(:last-child) {
  margin-right: 10px;
}

.column-actions {
  text-align: center !important;
  border: none !important;
}

/* Version desktop */
@media screen and (min-width: 1024px) {
  .product-table-container {
    overflow-x: auto !important;
  }

  .product-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100%;
  }

  /* Réactive l'en-tête */
  .desktop-only {
    display: table-header-group;
  }

  /* Retour au format tableau */
  .product-row {
    display: table-row;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  /* Style de l'en-tête */
  .product-table thead th {
    background-color: white !important;
    color: var(--color-gray-400) !important;
    font-size: 12px;
    text-transform: lowercase;
    white-space: nowrap;
    line-height: 1.2;
    vertical-align: middle;
    width: auto !important;
    height: 48px !important;
    box-sizing: border-box !important;
    border-bottom: 1px solid var(--color-border-dark) !important;
  }

  .product-table thead th::first-letter {
    text-transform: uppercase !important;
  }

  .product-table tr:first-child td,
  .product-table tr:first-child th {
    border-top: none !important;
  }

  /* Style des cellules */
  .product-table td,
  .product-table th {
    border: none;
    border-bottom: 1px solid var(--color-semi-border) !important;
    vertical-align: middle !important;
  }

  /* Colonne image */
  .column-image {
    display: table-cell !important;
    width: auto !important;
    border: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    vertical-align: middle !important;
    border-bottom: 1px solid var(--color-semi-border) !important;
  }

  thead tr .column-image {
    border-top: 1px solid var(--color-semi-border) !important;
  }

  .product-table .column-image img {
    display: block !important;
    height: 50px;
    width: 50px;
    aspect-ratio: 1/1;
    object-fit: contain;
    padding: 0 !important;
    margin: 0 auto !important;
  }

  /* Colonne actions */
  .column-actions {
    padding-right: 32px !important;
    min-width: 180px;
    text-align: right !important;
  }

  /* Supprime les labels */
  .product-table td::before {
    display: none !important;
  }
}

/********************************! Pagination *********************************/
/* Container de navigation */
.dz-table-container .woocommerce-pagination {
  display: flex !important;
  align-items: center !important;
  padding: 8px 16px !important;
  background-color: white !important;
  border-radius: 5px !important;
  width: fit-content !important;
  margin: 30px auto !important;
}

.dz-table-container ul.page-numbers {
  margin: 0 !important;
  padding: 35px 0 !important;
  background-color: white !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  border-bottom-left-radius: 5px !important;
  border-bottom-right-radius: 5px !important;
}

.dz-table-container .page-numbers {
  display: flex;
  align-items: center !important;
  gap: 1.25em;
  justify-content: center;
}

/* Container de pagination */
.dz-table-container .page-numbers {
  display: flex;
  gap: 1.25em;
  justify-content: center;
}

/* Style de base pour les items */
.dz-table-container .page-numbers li {
  list-style: none;
  font-size: 12px;
  margin-left: 0px !important;
  font-weight: 100 !important;
}

/* Style spécifique pour les numéros de page */
.dz-table-container .page-numbers li:not(:has(.dots)) {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  width: 30px;
  border-radius: 10px;
}

/* Style pour les points de suspension */
.dz-table-container .page-numbers li:has(.dots) {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
}

.dz-table-container .page-numbers .dots {
  display: flex;
}

/* Style du SVG */
.dz-table-container .page-numbers .dots svg {
  display: block;
  margin: 0;
  width: 20px;
  height: 4px;
}

/* Style des liens de pagination */
.dz-table-container .page-numbers li:not(:has(.dots)) a {
  color: var(--color-primary) !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Style pour le numéro actif */
.dz-table-container .page-numbers li:has(a.current) {
  background-color: var(--color-secondary) !important;
  border: none !important;
}

.dz-table-container .page-numbers li:has(a.current) a {
  color: var(--color-primary) !important;
}

/* Effet hover uniquement sur les numéros non-actifs */
.dz-table-container
  .page-numbers
  li:not(:has(a.current)):not(:has(.dots)):hover {
  background-color: #f5f5f5 !important;
}
