/**
 * Horex RMA - Styles Front-end optimisés
 */

/* Variables globales */
:root {
  --horex-primary: #D02E26;
  --horex-primary-hover: #B82821;
  --horex-text-dark: #191919;
  --horex-text-light: #FFFFFF;
  --horex-bg-light: #FFFFFF;
  --horex-bg-grey: #F7F7F7;
  --horex-border: #ccc;
  --horex-radius: 10px;
  --horex-spacing: 10px;
  --horex-transition: 0.2s ease;
}

/* Autocomplétion */
.ui-autocomplete {
  max-height: 200px;
  overflow-y: auto;
  background: var(--horex-bg-light);
  border: 1px solid var(--horex-border);
  border-radius: var(--horex-radius);
  margin-top: 8px !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  z-index: 9999;
  scrollbar-color: var(--horex-primary) #eee;
  scrollbar-width: thin;
  will-change: transform;
  list-style: none;
  padding: 0;
}

.ui-autocomplete::-webkit-scrollbar {
  width: 8px;
  background-color: #eee;
}

.ui-autocomplete::-webkit-scrollbar-thumb {
  background-color: var(--horex-primary);
  border-radius: 4px;
  border: 2px solid #eee;
}

.ui-menu-item {
  padding: 8px 12px;
  transition: background-color var(--horex-transition);
}

.ui-menu-item:hover,
.ui-menu-item.ui-state-focus {
  background-color: #f5f5f5;
}

/* Boutons */
.woocommerce-account .button.horex-rma-button,
.woocommerce-account .creer-retour-btn {
  background: var(--horex-primary) !important;
  border-radius: var(--horex-radius) !important;
  color: var(--horex-text-light) !important;
  transition: background-color var(--horex-transition);
  font-weight: 600;
  padding: 8px 15px;
  margin-top: 20px !important;
}

.creer-retour-btn {
  float: right;
  margin-top: -30px;
}

.creer-retour-btn:hover,
.woocommerce-account .woocommerce .button.horex-rma-button:hover {
  background-color: var(--horex-primary-hover);
}

/* Tableaux */
.woocommerce table.shop_table,
.woocommerce table.shop_table tr, 
.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
  border-collapse: collapse;
  border: none;
  border-block-start: none !important;
  padding: var(--horex-spacing);
}

.horex-rma-list-header,
.horex-rma-list-header * {
  background: var(--horex-bg-light);
  color: var(--horex-text-dark);
  padding: var(--horex-spacing);
  font-size: 16px;
  font-weight: 600;
}

.woocommerce-account .woocommerce table tbody > tr:nth-child(odd) > td,
.woocommerce-account .woocommerce table tbody > tr:nth-child(odd) > th {
  background-color: transparent;
}

.woocommerce-account .woocommerce table.my_account_orders tbody tr:hover,
.woocommerce-account .woocommerce table.my_account_orders tbody tr:hover > td {
  background-color: transparent;
  box-shadow: none;
}

.woocommerce-account .woocommerce table.my_account_orders td a {
  text-decoration: none;
  color: var(--horex-text-dark);
  font-weight: 600;
  transition: all var(--horex-transition);
}

.woocommerce-account .woocommerce table.my_account_orders td a:hover {
  text-decoration: underline;
  color: var(--horex-primary);
}

.woocommerce-account .woocommerce table.my_account_orders thead tr,
.woocommerce-account .woocommerce table.my_account_orders thead th {
  background-color: var(--horex-bg-grey);
  color: var(--horex-text-dark);
  font-weight: 600;
}

.woocommerce-account .woocommerce table.my_account_orders tbody tr,
.woocommerce-account .woocommerce table.my_account_orders tbody td {
  background-color: var(--horex-bg-light);
  color: var(--horex-text-dark);
  border-bottom: 1px solid var(--horex-border);
  transition: background-color var(--horex-transition);
}

.woocommerce-account .woocommerce table.my_account_orders tbody tr:hover td {
  background-color: #f9f9f9;
}

.woocommerce-account .woocommerce table.my_account_orders thead tr th:first-child,
.shop_table thead tr th:first-child {
  border-top-left-radius: 15px;
}

.woocommerce-account .woocommerce table.my_account_orders thead tr th:last-child,
.shop_table thead tr th:last-child {
  border-top-right-radius: 15px;
}

.shop_table thead tr {
  background: var(--horex-bg-grey);
}

.horex-rma-list-details-header {
  font-size: 16px;
  color: var(--horex-text-light);
}

/* Mise en page */
.horex-rma-header {
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.horex-rma-details-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 15px;
  justify-content: space-between;
}

/* Contrôles quantité */
.quantity-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100px;
}

.qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #00336629;
  color: #003366;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  user-select: none;
  transition: background-color var(--horex-transition);
  padding: 15px;
}

.qty-btn:hover,
.qty-btn:focus {
  background-color: #003366;
  color: #FFFFFF;
}

.qty-btn:active {
  transform: scale(0.95);
}

input.horex-retqty {
  margin: 0 3px;
  text-align: center;
  -moz-appearance: textfield;
  padding: 2px 10px;
  border-radius: var(--horex-radius);
}

.horex-retqty::-webkit-outer-spin-button,
.horex-retqty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Champs de formulaire */
input#horex_product_search_front {
  border-radius: 15px;
  margin-top: 10px;
  width: 50%;
}

.reason-select {
  border-radius: var(--horex-radius);
  padding: 5px;
}

.horex-rma-comment-field {
  border-radius: var(--horex-radius);
  padding: 5px;
}

/* Notifications d'erreur */
.error-notification {
  position: relative;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.close-error:hover {
  color: #d32f2f;
}

.order-select.invalid {
  border-color: #f44336;
  box-shadow: 0 0 0 2px rgba(244,67,54,0.2);
}

/* Actions RMA */
.rma-actions {
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.rma-actions .button {
  margin-bottom: 3px;
  margin-right: 5px;
  font-size: 12px;
  padding: 6px 10px;
  line-height: 1.2;
  text-decoration: none;
  border-radius: 4px;
  transition: all var(--horex-transition);
  border: none;
  cursor: pointer;
  font-weight: 600;
  min-width: 70px;
  text-align: center;
}

.rma-actions .button:last-child {
  margin-right: 0;
}

.rma-actions .button.horex-rma-button,
.rma-actions .button.horex-rma-avoir {
  background-color: #00336629 !important;
  color: #003366 !important;
  padding: 6px !important;
}

.rma-actions .button.horex-rma-button:hover,
.rma-actions .button.horex-rma-avoir:hover {
  background-color: #003366 !important;
  color: #FFFFFF !important;
  text-decoration: none;
}

.rma-actions .button.horex-rma-delete {
  background-color: #00336629 !important;
  color: #003366 !important;
  padding: 6px !important;
}

.rma-actions .button.horex-rma-delete:hover {
  background-color: #003366 !important;
  color: #FFFFFF !important;
}

.rma-actions .button.horex-rma-delete:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Pagination */
.page-numbers {
  display: flex;
  justify-content: center;
  gap: 5px;
  border-radius: var(--horex-radius);
  color: var(--horex-text-dark) !important;
  padding: 5px 7px;
}

.woocommerce-MyAccount-content .woocommerce-pagination a.page-numbers:hover,
a.page-numbers:active {
  background-color: var(--horex-primary);
  color: var(--horex-text-light) !important;
  border-radius: var(--horex-radius);
  text-decoration: none;
}

span.page-numbers.current {
  background-color: var(--horex-primary);
  color: var(--horex-text-light) !important;
  border-radius: var(--horex-radius);
  text-decoration: none;
}

.woocommerce-pagination {
  text-align: center;
  font-family: "Lato", Sans-serif;
  font-size: 16px;
  font-weight: 600;
}

/* Messages RMA */
.horex-rma-message {
  padding: 12px 15px;
  margin: 15px 0;
  border-radius: 6px;
  font-weight: 500;
  position: relative;
  animation: slideInDown 0.3s ease-out;
  border-width: 1px;
  border-style: solid;
}

.horex-rma-message--success {
  background-color: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

.horex-rma-message--error {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

.horex-rma-message--warning {
  background-color: #fff3cd;
  border-color: #ffeaa7;
  color: #856404;
}

.horex-rma-message__close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  font-weight: bold;
  color: inherit;
  transition: opacity var(--horex-transition);
}

.horex-rma-message__close:hover {
  opacity: 0.7;
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Autres styles */
.horex-create-rma {
  background-color: var(--horex-primary) !important;
  color: var(--horex-bg-light) !important;
}

.woocommerce .woocommerce-MyAccount-content .woocommerce-MyAccount-content-wrapper .horex-rma-header .horex-create-rma:hover {
  background-color: var(--horex-primary-hover) !important;
  color: var(--horex-bg-light) !important;
  text-decoration: none;
}

.horex-return-button {
  color: var(--horex-bg-light) !important;
}

.woocommerce .woocommerce-MyAccount-content a.button.horex-return-button:hover {
  color: var(--horex-bg-light) !important;
  background-color: var(--horex-primary-hover) !important;
  text-decoration: none !important;
}

.woocommerce .woocommerce-MyAccount-content .horex-bon-retour,
.woocommerce .woocommerce-MyAccount-content .horex-rma-avoir {
  background-color: #00336629 !important;
  color: #003366 !important;
  margin-top: 0 !important;
}

.woocommerce .woocommerce-MyAccount-content a.button.horex-bon-retour:hover,
.woocommerce .woocommerce-MyAccount-content a.button.horex-rma-avoir:hover {
  background-color: #003366 !important;
  color: #FFFFFF !important;
  text-decoration: none !important;
}

p.horex-rma-stat {
  text-align: center;
}

.horex-status-badge {
  margin-top: 7px;
}

.woocommerce-MyAccount-content {
  display: inline-grid;
}

.horex-remove-btn {
  background: #00336629;
  border: none;
  cursor: pointer;
  color: #003366;
}

.horex-remove-btn:hover,
.horex-remove-btn:focus {
  background: #003366;
  color: #FFFFFF;
}

.horex-remove-btn svg {
  display: block;
}

.loading-item {
  pointer-events: none !important;
  background-color: #FFFFFF !important;
}

.no-results-item:hover,
.no-results-item.ui-state-focus {
  background-color: #FFFFFF !important;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
  .horex-rma-header {
    align-items: flex-start;
    gap: 15px;
  }
  
  .creer-retour-btn {
    float: none;
    margin-top: 0;
    display: block;
    width: 100%;
    text-align: center;
  }
  
  .woocommerce table.shop_table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  .horex-rma-details-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .rma-actions {
    white-space: normal;
    text-align: left;
  }
  
  .rma-actions .button {
    font-size: 10px;
    padding: 4px 6px;
    margin-right: 3px;
    margin-bottom: 2px;
    min-width: 55px;
  }
  
  .shop_table.my_account_orders {
    font-size: 14px;
  }
  
  .shop_table.my_account_orders td.rma-actions {
    min-width: 180px;
    padding: 8px 5px;
  }
  
  .horex-rma-message {
    font-size: 14px;
    padding: 10px 12px;
    margin: 10px 0;
  }
  input#horex_product_search_front {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .rma-actions .button {
    font-size: 9px;
    padding: 3px 5px;
    margin-right: 2px;
    min-width: 45px;
  }
  
  .shop_table.my_account_orders td.rma-actions {
    min-width: 140px;
  }
}

/* Optimisations performance */
.horex-rma-button,
.ui-autocomplete,
.rma-actions {
  will-change: transform;
  contain: layout style paint;
}

/* États de chargement */
.rma-actions .button.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.rma-actions .button.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}

/* Impression */
@media print {
  .horex-rma-button,
  .creer-retour-btn,
  .woocommerce-MyAccount-navigation {
    display: none !important;
  }
  
  .woocommerce table.shop_table {
    border: 1px solid #000 !important;
    border-collapse: collapse !important;
  }
  
  .woocommerce table.shop_table th,
  .woocommerce table.shop_table td {
    border: 1px solid #000 !important;
  }
}
.horex-rma-download-buttons {
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

.horex-rma-message {
  padding: 8px 10px; 
  margin: 20px 0; 
  border-radius: 10px;
  font-weight: 500;
  position: relative;
  animation: slideInDown 0.4s ease-out;
  font-size: 16px;
  line-height: 1.5;
}

.horex-rma-message--success {
  background-color: #d4edda;
  color: #155724;
}

.horex-rma-message--error {
  background-color: #f8d7da;
  color: #721c24;
}

.horex-rma-message--warning {
  background-color: #fff3cd;
  color: #856404;
}

.horex-rma-message__close {
  position: absolute;
  top: 12px;
  right: 15px;
  background: none;
  border: none;
  font-size: 20px; /* Plus gros pour être plus cliquable */
  cursor: pointer;
  font-weight: bold;
  color: inherit;
  transition: opacity var(--horex-transition);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.horex-rma-message__close:hover {
  opacity: 0.7;
  background-color: rgba(0,0,0,0.1);
  border-radius: 50%;
}

/* Animation plus visible */
@keyframes slideInDown {
  from { 
    opacity: 0; 
    transform: translateY(-30px) scale(0.95); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

/* Effet de pulsation pour attirer l'attention (optionnel) */
.horex-rma-message--success {
  animation: slideInDown 0.4s ease-out, pulse 2s ease-in-out;
}

/* ===== CARDS MOBILES RMA ===== */

/* Container principal pour les cards mobiles */
.horex-rma-mobile-cards {
  display: none; /* Masqué par défaut, affiché via JS sur mobile */
}

/* Card individuelle pour chaque produit */
.horex-rma-product-card {
  background: white;
  border-radius: 12px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
  border: 1px solid #e9ecef;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.horex-rma-product-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Header de la card (image + info produit) */
.horex-rma-card-header {
  display: flex;
  padding: 15px;
  border-bottom: 1px solid #e9ecef;
  align-items: center;
  gap: 10px;
}

.horex-rma-product-image {
  width: 60px;
  height: 60px;
  background: #f8f9fa;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #dee2e6;
  overflow: hidden;
}

.horex-rma-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.horex-rma-product-info {
  flex: 1;
  min-width: 0;
}

.horex-rma-product-name {
  font-weight: 600;
  font-size: 14px;
  color: #212529;
  margin-bottom: 4px;
  line-height: 1.3;
  word-wrap: break-word;
}

.horex-rma-product-sku {
  font-size: 12px;
  color: #6c757d;
  background: #f8f9fa;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

/* Body de la card (formulaire) */
.horex-rma-card-body {
  padding: 15px;
}

.horex-rma-form-row {
  margin-bottom: 15px;
}

.horex-rma-form-row:last-child {
  margin-bottom: 0;
}

.horex-rma-form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #495057;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.horex-rma-form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.horex-rma-form-control:focus {
  outline: none;
  border-color: var(--horex-primary);
  box-shadow: 0 0 0 2px rgba(208, 46, 38, 0.1);
}

/* Contrôles de quantité */
.horex-rma-quantity-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8f9fa;
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.horex-rma-qty-btn {
  width: 32px;
  height: 32px;
  background: var(--horex-primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-size: 16px;
  user-select: none;
}

.horex-rma-qty-btn:hover {
  background: var(--horex-primary-hover);
}

.horex-rma-qty-btn:active {
  transform: scale(0.95);
}

.horex-rma-qty-btn:focus {
  background: var(--horex-primary);
}

.horex-rma-qty-input {
  flex: 1;
  text-align: center;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 6px;
  font-weight: 600;
  background: white;
  min-width: 60px;
  -moz-appearance: textfield;
}

.horex-rma-qty-input::-webkit-outer-spin-button,
.horex-rma-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.horex-rma-available-qty {
  font-size: 12px;
  color: #28a745;
  font-weight: 600;
}

/* Information commande */
.horex-rma-order-info {
  background: #00336629;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  color: #003366;
  font-weight: 500;
}

/* Bouton suppression */
.horex-rma-remove-btn {
  background: #D02E26;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.horex-rma-remove-btn:hover {
  background: #D02E26;
}

.horex-rma-remove-btn:focus {
  background: #D02E26;
}

/* Section total mobile */
.horex-rma-total-mobile {
  background: var(--horex-primary);
  color: white;
  padding: 20px;
  border-radius: 12px;
  margin-top: 20px;
  display: none; /* Affiché via JS quand il y a des produits */
}

.horex-rma-total-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
}

.horex-rma-total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 14px;
}

.horex-rma-total-final {
  border-top: 1px solid rgba(255,255,255,0.3);
  padding-top: 10px;
  margin-top: 10px;
  font-weight: 700;
  font-size: 16px;
}

/* Animation de suppression */
.horex-rma-card-removing {
  animation: slideOutLeft 0.3s ease-out forwards;
}

@keyframes slideOutLeft {
  from { 
    opacity: 1; 
    transform: translateX(0); 
  }
  to { 
    opacity: 0; 
    transform: translateX(-100%); 
  }
}

/* Media queries pour le responsive */
@media (max-width: 768px) {
  /* Masquer le tableau desktop sur mobile */
  .shop_table.horex-rma-products-table {
    display: none !important;
  }
  
  /* Afficher les cards mobiles */
  .horex-rma-mobile-cards {
    display: block !important;
  }
  
  /* Ajustements du total desktop pour mobile */
  #horex-rma-total-recap {
    display: none !important;
  }
}

/* Améliorations générales mobile */
@media (max-width: 480px) {
  .horex-rma-product-card {
    margin-bottom: 12px;
  }
  
  .horex-rma-card-header {
    padding: 12px;
  }
  
  .horex-rma-card-body {
    padding: 12px;
  }
  
  .horex-rma-form-row {
    margin-bottom: 12px;
  }
  
  .horex-rma-product-image {
    width: 50px;
    height: 50px;
  }
  
  .horex-rma-product-name {
    font-size: 13px;
  }
}

/* ===== RMA MOBILE CARDS - DESIGN 1 ===== */

/* Cards avec statuts visuels pour la liste des retours */
.horex-rma-mobile-list {
    display: none; /* Affiché via JS sur mobile */
}

.horex-rma-status-card {
    background: white;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    border-left: 4px solid #D02E26;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.horex-rma-status-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Couleurs de statut */
.horex-rma-status-card.status-en_attente,
.horex-rma-status-card.status-pending,
.horex-rma-status-card.status-brouillon {
    border-left-color: #ff9800;
}

.horex-rma-status-card.status-accepte,
.horex-rma-status-card.status-accepted,
.horex-rma-status-card.status-termine {
    border-left-color: #4CAF50;
}

.horex-rma-status-card.status-refuse,
.horex-rma-status-card.status-rejected,
.horex-rma-status-card.status-annule {
    border-left-color: #f44336;
}

.horex-rma-status-card.status-en_traitement,
.horex-rma-status-card.status-processing {
    border-left-color: #2196F3;
}

.horex-rma-status-card.status-attente_avoir {
    border-left-color: #9C27B0;
}

/* Header de la card */
.horex-rma-card-header {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.horex-rma-card-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #212529;
    text-decoration: none;
}

.horex-rma-card-title:hover {
    color: #D02E26;
}

.horex-rma-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #666;
    gap: 10px;
}

.horex-rma-card-date {
    color: #666;
}

/* Actions de la card */
.horex-rma-card-actions {
    padding: 12px 15px;
    display: flex;
    gap: 8px;
    background: #fafafa;
}

.horex-rma-card-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    color: #666;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
}

.horex-rma-card-btn:hover {
    background: #f5f5f5;
    text-decoration: none;
    color: #333;
}

.horex-rma-card-btn.primary {
    background: #D02E26;
    color: #FFFFFF !important;
    border-color: #D02E26;
}

.horex-rma-card-btn.primary:hover {
    background: #B82821;
    border-color: #B82821;
    color: white;
}

.horex-rma-card-btn.danger {
    color: #f44336;
    border-color: #f44336;
}

.horex-rma-card-btn.danger:hover {
    background: #f44336;
    color: white;
}

.horex-rma-card-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* État vide */
.horex-rma-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.horex-rma-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
    color: #ccc;
}

.horex-rma-empty-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.horex-rma-empty-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

/* Loading state */
.horex-rma-card-loading {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.horex-rma-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #D02E26;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animation de suppression */
.horex-rma-status-card.removing {
    animation: slideOutRight 0.3s ease-out forwards;
}

@keyframes slideOutRight {
    from { 
        opacity: 1; 
        transform: translateX(0); 
    }
    to { 
        opacity: 0; 
        transform: translateX(100%); 
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Masquer le tableau desktop */
    .shop_table.my_account_orders {
        display: none !important;
    }
    
    /* Afficher les cards mobiles */
    .horex-rma-mobile-list {
        display: block !important;
    }
    
    /* Ajustements pour très petits écrans */
    @media (max-width: 480px) {
        
        .horex-rma-status-card {
            margin-bottom: 10px;
        }
        
        .horex-rma-card-header {
            padding: 12px;
        }
        
        .horex-rma-card-actions {
            padding: 10px 12px;
            gap: 6px;
        }
        
        .horex-rma-card-btn {
            font-size: 11px;
            padding: 6px 8px;
        }
		.woocommerce-account .button.horex-rma-button, .woocommerce-account .creer-retour-btn {
			margin-bottom: 0 !important;
		}
    }
	h2.title-rma {
			font-size: 25px;
			margin: 0 !important;
	}
	.woocommerce-account .button.horex-rma-button, .woocommerce-account .creer-retour-btn {
			margin-top: 0 !important;
	}
}

/* Intégration avec la pagination existante */
.horex-rma-mobile-list + .woocommerce-pagination {
    margin-top: 20px;
}

/* ===== RMA MOBILE DETAILS - CARDS DÉTAILLÉES ===== */

/* Gestion responsive : masquer mobile par défaut */
.horex-rma-details-mobile {
  display: none;
}

@media (max-width: 768px) {
  /* Sur mobile : masquer desktop, afficher mobile */
  .horex-rma-details-header,
  .shop_table.shop_table_responsive {
    display: none !important;
  }
  
  .horex-rma-details-mobile {
    display: block !important;
  }
}

/* === BOUTON RETOUR EN HAUT MOBILE === */
.horex-rma-mobile-back-header {
  background: white;
  padding: 15px;
  border-bottom: 1px solid #e9ecef;
}

.horex-rma-mobile-back-btn {
  color: var(--horex-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
}

.horex-rma-mobile-back-btn:hover {
  color: var(--horex-primary-hover);
  text-decoration: none;
}

/* === HEADER ACCORDÉON MOBILE === */
.horex-rma-mobile-accordion-header {
  background: white;
  padding: 20px 15px;
  border-bottom: 1px solid #e9ecef;
  text-align: center;
}

.horex-rma-mobile-accordion-header h1 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #212529;
  font-weight: 600;
}

.horex-rma-mobile-date-info {
  color: #6c757d;
  font-size: 14px;
  margin-bottom: 12px;
}

.horex-rma-mobile-status-container {
  margin-top: 12px;
}

.horex-rma-mobile-status-badge.accepted { 
  background: #28a745; 
  color: white;
}

.horex-rma-mobile-status-badge.pending { 
  background: #ffc107; 
  color: #212529; 
}

.horex-rma-mobile-status-badge.processing { 
  background: #17a2b8; 
  color: white;
}

.horex-rma-mobile-status-badge.rejected { 
  background: #dc3545; 
  color: white;
}

/* === CARDS MOBILE === */
.horex-rma-mobile-info-card {
  background: white;
  margin: 15px 0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
}

.horex-rma-mobile-card-header {
  background: #f8f9fa;
  padding: 12px 15px;
  border-bottom: 1px solid #e9ecef;
  font-weight: 600;
  color: #495057;
  display: flex;
  align-items: center;
  gap: 8px;
}

.horex-rma-mobile-card-content {
  padding: 15px;
}

/* === PRODUITS DÉTAILLÉS MOBILE === */
.horex-rma-mobile-product-detailed {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
}

.horex-rma-mobile-product-detailed:last-child {
  margin-bottom: 0;
}

.horex-rma-mobile-product-header {
  display: flex;
  gap: 12px;
  padding: 15px;
  background: white;
  border-bottom: 1px solid #f0f2f5;
}

.horex-rma-mobile-product-thumb {
  width: 60px;
  height: 60px;
  background: #e9ecef;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.horex-rma-mobile-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.horex-rma-mobile-product-thumb-placeholder {
  font-size: 20px;
  color: #6c757d;
}

.horex-rma-mobile-product-info {
  flex: 1;
  min-width: 0;
}

.horex-rma-mobile-product-name {
  font-weight: 600;
  font-size: 14px;
  color: #212529;
  margin-bottom: 4px;
  line-height: 1.3;
  word-wrap: break-word;
}

.horex-rma-mobile-product-meta {
  font-size: 12px;
  color: #6c757d;
  margin-bottom: 6px;
}

.horex-rma-mobile-product-status {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.horex-rma-mobile-product-status.accepted { 
  background: #d4edda; 
  color: #155724; 
}

.horex-rma-mobile-product-status.pending { 
  background: #fff3cd; 
  color: #856404; 
}

.horex-rma-mobile-product-status.processing { 
  background: #d1ecf1; 
  color: #0c5460; 
}

.horex-rma-mobile-product-status.rejected { 
  background: #D02E2629; 
  color: #D02E26; 
}

.horex-rma-mobile-product-details {
  padding: 12px 15px;
  background: #f8f9fa;
  font-size: 13px;
}

.horex-rma-mobile-detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  align-items: flex-start;
}

.horex-rma-mobile-detail-row:last-child {
  margin-bottom: 0;
}

.horex-rma-mobile-detail-label {
  font-weight: 600;
  color: #6c757d;
  min-width: 70px;
  font-size: 12px;
}

.horex-rma-mobile-detail-value {
  color: #495057;
  text-align: right;
  flex: 1;
  margin-left: 10px;
  line-height: 1.3;
}

.horex-rma-mobile-product-comment {
  background: #e9ecef;
  padding: 10px;
  border-radius: 6px;
  margin-top: 8px;
  font-style: italic;
  color: #495057;
  font-size: 12px;
  line-height: 1.4;
}

/* === ACTIONS MOBILE === */
.horex-rma-mobile-actions-grid {
  display: flex;
  gap: 12px;
}

.horex-rma-mobile-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.horex-rma-mobile-btn-primary {
  background: #00336629;
  color: #003366 !important;
  border-radius: 10px;
}

.woocommerce-MyAccount-content-wrapper .horex-rma-details-mobile .horex-rma-mobile-card-content .horex-rma-mobile-actions-grid .horex-rma-mobile-btn-primary:hover {
  background: #003366;
  text-decoration: none !important;
  color: #FFFFFF !important;
}

.horex-rma-mobile-btn-secondary {
  background: #f8f9fa;
  color: #495057;
  border: 1px solid #dee2e6;
}

.horex-rma-mobile-btn-secondary:hover {
  background: #e9ecef;
  text-decoration: none;
  color: #495057;
}

/* === OPTIMISATIONS RESPONSIVE MOBILE === */
@media (max-width: 480px) {
  
  .horex-rma-mobile-card-header {
    padding: 10px 12px;
    font-size: 14px;
  }
  
  .horex-rma-mobile-card-content {
    padding: 12px;
  }
  
  .horex-rma-mobile-product-header {
    padding: 12px;
  }
  
  .horex-rma-mobile-product-thumb {
    width: 50px;
    height: 50px;
  }
  
  .horex-rma-mobile-product-name {
    font-size: 13px;
  }
  
  .horex-rma-mobile-actions-grid {
    flex-direction: column;
    gap: 8px;
  }
  
  .horex-rma-mobile-btn {
    font-size: 13px;
    padding: 10px 14px;
  }
}

/* === PERFORMANCE OPTIMIZATIONS === */
.horex-rma-mobile-info-card,
.horex-rma-mobile-product-detailed,
.horex-rma-mobile-btn {
  will-change: transform;
  contain: layout style paint;
}

/* === ANIMATIONS === */
.horex-rma-mobile-product-detailed {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.horex-rma-mobile-product-detailed:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* === ÉTATS DE CHARGEMENT === */
.horex-rma-mobile-btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.horex-rma-mobile-btn.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}

h2.title-rma {
	margin: 0 !important;
}