/****************************! Grille ****************************/
.dashboard-card,
.dashboard-card-full-width {
  margin-bottom: 40px;
}
.dashboard-card {
  width: calc(50% - 20px);
}

.dashboard-card.full-width {
  width: 100%;
}

@media (max-width: 1024px) {
  .dashboard-grid .dashboard-card {
    width: 100%;
  }
}

@media (min-width: 580px) {
  .customer-dashboard {
    padding: 20px;
  }
}

/****************************! Styles généraux ****************************/
.dashboard-card,
.dashboard-card-full-width {
  background: #032541;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(217, 217, 217, 1);
}

.dashboard-card-header {
  padding: 20px 20px 0 20px;
}

.dashboard-card-body {
  padding: 0 20px;
}

.dashboard-card-footer {
  padding: 0px 20px 10px 20px;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  table-layout: fixed;
}

.dashboard-table th {
  width: 70%;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
  text-transform: none;
}

.dashboard-table td {
  width: 30%;
  text-align: left;
}

.dashboard-table tr {
  color: #fff !important;
}

.dashboard-table tr:nth-child(odd) {
  background-color: #0a3b69 !important;
}

/****************************! Carte : Compte ****************************/
.dashboard-card-full-width.account-name {
  padding: 10px 20px !important;
}

.customer-dashboard .account-name {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  font-size: 1.2em;
}

.account-name-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.account-name-icon svg {
  width: 16px;
  height: 16px;
  margin-right: 12px;
  fill: #fff;
  color: #fff;
}

.account-label {
  margin-right: 6px;
}

.account-value {
  font-weight: bold;
  text-transform: capitalize;
}

/****************************! Carte : Statistiques ****************************/
.dashboard-card-full-width.statistics-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  background-color: inherit;
  border: inherit;
}

.statistics-cards .stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 15px;
  margin-bottom: 0px;
}

.statistics-cards .stat-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.stat-card .dashboard-card-header {
  align-self: flex-start;
  padding: 0;
}

.stat-card .dashboard-card-footer {
  align-self: flex-end;
  text-align: right;
  padding: 0;
}

.stat-svg {
  width: 50px;
  height: 50px;
  fill: #fff;
  color: #fff;
}

.statistics-cards .stat-card:hover .stat-svg {
  color: #ffeb3b;
  fill: #ffeb3b;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: #fff;
  line-height: 1;
  margin-bottom: 5px;
  transition: color 0.3s ease;
}

.statistics-cards .stat-card:hover .stat-value {
  color: #ffeb3b;
}

.stat-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
}

.statistics-cards .stat-card:hover .stat-label {
  text-decoration: underline;
}

@media (min-width: 509px) and (max-width: 1023px) {
  .dashboard-card-full-width.statistics-cards {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (min-width: 1200px) {
  .dashboard-card-full-width.statistics-cards {
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr)) !important;
    gap: 40px;
    min-height: 180px;
  }
  .stat-svg {
    width: 70px;
    height: 70px;
  }
  .stat-value {
    font-size: 2.5rem;
  }
  .stat-label {
    font-size: 1.15rem;
  }
}

/****************************! Carte : Informations de crédit ****************************/
/* Chart */
.credit-chart {
  max-width: 600px;
  height: 170px;
  margin: 30px auto 50px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/****************************! Carte : Derniers produits ****************************/
.latest-products-slider {
  position: relative;
  margin: 20px 0;
  padding: 0 40px;
}

.latest-products-container {
  display: flex;
  gap: 20px;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.latest-products-container::-webkit-scrollbar {
  display: none;
}

.latest-product-item {
  flex: 0 0 200px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  overflow: hidden;
}

.product-image {
  position: relative;
  overflow: hidden;
  background-color: white;
}

.product-image a img {
  aspect-ratio: 1/1;
  object-fit: contain;
  transition: transform 0.3s ease;
  width: 100%;
  height: 100%;
}

.latest-product-item:hover .product-image a img {
  transform: scale(1.05);
}

.product-info {
  padding: 15px;
}

.product-title {
  margin: 0 0 10px 0;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}

.product-title a {
  color: #fff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.latest-product-item:hover .product-title {
  font-weight: bold;
}

.product-price {
  color: #ffeb3b;
  font-weight: bold;
  font-size: 1rem;
  margin: 0 0 10px 0;
}

/* Boutons */
.customer-dashboard .product-actions .woo-add-to-cart-button,
.customer-dashboard .product-actions .woo-favorites-button,
.customer-dashboard .product-actions .woo-add-range-to-cart-button {
  border: 1px solid var(--color-border) !important;
  border-radius: 5px !important;
}

.customer-dashboard .woo-add-to-cart-button a,
.customer-dashboard .woo-favorites-button,
.customer-dashboard .woo-add-range-to-cart-button {
  color: white;
  fill: white;
}

.customer-dashboard .product-actions .woo-add-to-cart-button a path,
.customer-dashboard .product-actions .woo-add-range-to-cart-button path,
.customer-dashboard
  .product-actions
  .woo-favorites-button:not(.is-favorite)
  path {
  color: white !important;
  fill: white !important;
}

.customer-dashboard .product-actions .woo-add-to-cart-button:hover a,
.customer-dashboard .product-actions .woo-add-to-cart-button:hover a path,
.customer-dashboard .product-actions .woo-add-range-to-cart-button:hover path {
  color: #032541 !important;
  fill: #032541 !important;
}
.customer-dashboard .product-actions {
  display: flex;
  gap: 6px;
}

.customer-dashboard .product-actions .button {
  height: 50px;
  width: 50px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border) !important;
  border-radius: 5px;
}

/* Slider*/
.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all 0.2s ease;
  z-index: 1;
}

.slider-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.slider-nav.prev {
  left: 0;
}

.slider-nav.next {
  right: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .latest-products-slider {
    padding: 0 30px;
  }

  .latest-product-item {
    flex: 0 0 200px;
  }

  .product-image {
    height: 150px;
  }

  .slider-nav {
    width: 30px;
    height: 30px;
  }
}

/****************************! Carte : Performance achats ****************************/
.performance-chart {
  height: 300px;
  margin: 20px auto;
  padding: 20px;
}

/****************************! Carte : Performance annuelle des achats ****************************/
.annual-performance-chart {
  height: 300px;
  margin: 20px auto;
  padding: 20px;
}

/****************************! Carte : Tableau d'affichage ****************************/
.dashboard-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 20px;
}

.board-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  text-decoration: none;
  color: #fff;
  transition: all 0.3s ease;
}

.board-item:hover {
  transform: translateY(-2px);
}

.board-item:not(.board-alert):hover {
  background: rgba(255, 255, 255, 0.1);
}

.board-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.board-icon svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.board-label {
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.2;
}

.board-alert {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
  cursor: pointer;
}

.board-alert .board-icon {
  color: #f44336;
}

.board-alert .board-label {
  color: #f44336;
}

/****************************! Carte : Informations du compte ****************************/
.account-info-card .dashboard-card-body {
  overflow-x: auto;
  margin: 20px 0;
}

.account-info-table {
  width: auto !important;
  margin: 0;
}

.account-info-table thead th,
.account-info-table tbody td {
  padding: 12px;
  white-space: nowrap;
}

.account-info-table thead th {
  background-color: rgba(255, 255, 255, 0.05);
  font-weight: 600;
  text-align: left;
}

/****************************! Tableau de bord : visiteur non connecté ****************************/
.guest-dashboard-intro {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  color: #fff;
  margin: 0 0 30px 0;
}

.guest-dashboard-intro .button {
  background-color: var(--background-tertiary);
  color: var(--color-primary);
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.guest-dashboard-intro .button:hover {
  background-color: var(--background-tertiary-hover);
}

.guest-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  padding: 20px;
}

.guest-category-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
  border-radius: 5px;
  text-decoration: none;
  color: #fff;
  text-align: center;
  transition: background-color 0.2s ease;
}

.guest-category-tile:hover {
  background: rgba(255, 255, 255, 0.1);
}

.guest-category-tile img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 5px;
}

.guest-category-name {
  font-weight: 600;
}
