@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
html, body {
  height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Roboto', Arial, sans-serif;
  background: #f7f8fa;
  margin: 0;
  padding: 0;
  color: #222;
}

main {
  flex: 1;
  padding: 32px 24px;
}

h1, h3 {
  color: #2a5d9f;
  margin-bottom: 0.5em;
}

form {
  background: #fff;
  padding: 1.5em;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  margin-bottom: 1.5em;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

input, select {
  font-size: 1em;
  margin: 0.5em 0;
  padding: 0.7em;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  width: 100%;
  box-sizing: border-box;
}

button {
    font-size: 1em;
    margin: 0.5em 0;
    padding: 0.7em;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    box-sizing: border-box;
  }


input:focus, select:focus {
  outline: none;
  border-color: #2a5d9f;
  box-shadow: 0 0 0 2px #2a5d9f22;
}

button {
  background: #2a5d9f;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}


#result {
  margin-top: 2em;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.alert {
  padding: 1em;
  border-radius: 6px;
  margin-bottom: 1em;
  color: #fff;
  background: #2a5d9f;
  text-align: center;
  font-weight: bold;
  display: none;
}

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1em 2em 0.5em 2em;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border-bottom: 1px solid #e5e7eb;
  position: relative;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.7em;
  margin-left: 1em;
}

.logo {
  height: 80px !important;
  width: auto;
  object-fit: contain;
  border-radius: 8px;
}

.brand {
  font-size: 1.4em;
  font-weight: bold;
  color: #2a5d9f;
  letter-spacing: 1px;
}

.main-nav {
  display: flex;
  gap: 0;
  align-items: stretch;
  height: 100%;
}

.main-nav a {
  text-decoration: none;
  color: #2a5d9f;
  font-weight: 500;
  font-size: 1.1em;
  padding: 0 1.5em;
  border-radius: 0;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  height: 100%;
  border-right: 1px solid #e5e7eb;
}

.main-nav a:hover {
  background: #2a5d9f;
  color: #fff;
}

/* Style spécial pour le bouton de déconnexion */
.main-nav a[href="/logout"] {
  margin-left: auto;
  border-right: none;
}

/* Méga menu styles */
.mega-menu-container {
  position: relative;
  display: inline-block;
}

.mega-menu-trigger {
  text-decoration: none;
  color: #2a5d9f;
  font-weight: 500;
  font-size: 1.1em;
  padding: 0 1.5em;
  border-radius: 0;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
  display: flex;
  align-items: center;
  height: 100%;
  border-right: 1px solid #e5e7eb;
}

.mega-menu-trigger:hover {
  background: #2a5d9f;
  color: #fff;
}

.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  min-width: 250px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.mega-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega-menu-content {
  padding: 1.5em;
}

.mega-menu-section h3 {
  color: #2a5d9f;
  font-size: 1.1em;
  margin: 0 0 1em 0;
  font-weight: 600;
}

.mega-menu-section a {
  display: block;
  text-decoration: none;
  color: #374151;
  padding: 0.8em 0;
  border-bottom: 1px solid #f3f4f6;
  font-weight: 500;
  transition: color 0.2s;
}

.mega-menu-section a:last-child {
  border-bottom: none;
}

.mega-menu-section a:hover {
  color: #2a5d9f;
  background: none;
}

/* Mobile menu section styles */
.mobile-menu-section {
  border-bottom: 1px solid #f0f0f0;
}

.mobile-menu-header {
  padding: 1em 2em;
  color: #2a5d9f;
  font-weight: 600;
  font-size: 1.1em;
  background: #f8f9fa;
  border-bottom: 1px solid #e5e7eb;
}

.mobile-submenu-item {
  padding-left: 3em !important;
  font-size: 0.95em;
  color: #6b7280 !important;
}

.mobile-submenu-item:hover {
  color: #2a5d9f !important;
  background: #f8f9fa !important;
}

/* Burger menu button */
.burger-menu {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5em;
  background: none;
  border: none;
  gap: 4px;
}

.burger-menu span {
  width: 25px;
  height: 3px;
  background: #2a5d9f;
  transition: 0.3s;
  border-radius: 2px;
}

.burger-menu.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.burger-menu.active span:nth-child(2) {
  opacity: 0;
}

.burger-menu.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile menu */
.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border-top: 1px solid #e5e7eb;
  z-index: 1000;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-menu.active {
  max-height: 500px;
}

.mobile-menu a {
  display: block;
  padding: 1em 2em;
  text-decoration: none;
  color: #2a5d9f;
  font-weight: 500;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s;
}

.mobile-menu a:hover {
  background: #f8f9fa;
}

.mobile-menu a:last-child {
  border-bottom: none;
}

table {
  border-collapse: collapse;
  width: 100%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border-radius: 10px;
  overflow: hidden;
  margin: 1.5em 0;
}
th, td {
  padding: 0.8em 1em;
  border: 1px solid #e5e7eb;
  text-align: left;
}
th {
  background: #f0f4fa;
  color: #2a5d9f;
  font-weight: bold;
}
tr.low-stock {
  background-color: #ffe6e6;
}

/* Responsive design */
@media (max-width: 768px) {
  .main-nav {
    display: none;
  }
  
  .burger-menu {
    display: flex;
  }
  
  .mobile-menu {
    display: block;
  }
  
  .main-header {
    padding: 1em 1em 0.5em 1em;
  }
  
  .logo-area {
    margin-left: 0;
  }
  
  .logo {
    height: 60px !important;
  }
  
  .brand {
    font-size: 1.2em;
  }
}

@media (max-width: 600px) {
  table, th, td {
    font-size: 0.95em;
  }
  th, td {
    padding: 0.5em 0.4em;
  }
  
  .main-header {
    padding: 0.8em 0.8em 0.4em 0.8em;
  }
  
  .logo {
    height: 50px !important;
  }
  
  .brand {
    font-size: 1.1em;
  }
  
  .mobile-menu a {
    padding: 0.8em 1.5em;
    font-size: 1em;
  }
}


.btn-edit {
  display: inline-block;
  background: #fbbf24;
  color: #222;
  font-weight: 500;
  padding: 0.4em 1em;
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  border: none;
  cursor: pointer;
}
.btn-edit:hover {
  background: #f59e1a;
  color: #fff;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 0.6em 1.4em;
  font-weight: 600;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary:hover {
  background: #1746a0;
}

.btn-secondary {
  background: #e5e7eb;
  color: #222;
  border: none;
  border-radius: 5px;
  padding: 0.6em 1.4em;
  font-weight: 500;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s;
  margin-left: 0.5em;
}
.btn-secondary:hover {
  background: #cbd5e1;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-weight: 600;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-danger:hover {
  background: #b91c1c;
}

.radio-group {
  display: flex;
  gap: 1.5em;
  margin: 0.5em 0;
}
.radio-option {
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-size: 1em;
  font-weight: 500;
  color: #2a5d9f;
  cursor: pointer;
}
.radio-option input[type="radio"] {
  accent-color: #2a5d9f;
  width: 1.1em;
  height: 1.1em;
}
/* Fixe le bug de la croix qui se multiplie dans Choices.js */
.choices__button {
  background: none !important;
  border: none !important;
  color: inherit !important;
  font-size: 1em !important;
  padding: 0 !important;
  margin-left: 0.5em;
  cursor: pointer;
  line-height: 1;
}
.choices__item--selectable .choices__button:hover {
  background: none !important;
  color: #ef4444 !important;
} 


.choices__inner {
    width: 96% !important;
}

footer {
  text-align: center;
  background: #f3f4f6;
  padding: 12px 0;
}

.qty-btn {
  background: #e5e7eb;
  color: #222;
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 0.2em 0.7em;
  font-size: 1.1em;
  cursor: pointer;
  margin: 0 2px;
  transition: background 0.15s;
}
.qty-btn:hover {
  background: #d1d5db;
}

/* Styles pour la page des réglages WooCommerce */
.woocommerce-section {
  background: #fff;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  margin-bottom: 1.5rem;
}

.woocommerce-section h2 {
  color: #2a5d9f;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #374151;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #2a5d9f;
  box-shadow: 0 0 0 3px rgba(42, 93, 159, 0.1);
}

.sync-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.sync-status {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 500;
}

.sync-status.loading {
  background: #fef3c7;
  color: #92400e;
}

.sync-status.success {
  background: #d1fae5;
  color: #065f46;
}

.sync-status.error {
  background: #fee2e2;
  color: #991b1b;
}

.last-sync-info {
  background: #f3f4f6;
  padding: 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.auto-sync-info {
  background: #f3f4f6;
  padding: 1rem;
  border-radius: 6px;
  margin-top: 1rem;
}

.auto-sync-info p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.stat-card {
  background: #f8fafc;
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #e2e8f0;
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: #2a5d9f;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: #6b7280;
  font-size: 0.9rem;
}

.orders-list {
  margin-top: 1rem;
}

.order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  background: #f9fafb;
}

.order-info {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.order-number {
  font-weight: bold;
  color: #2a5d9f;
}

.order-date {
  color: #6b7280;
  font-size: 0.9rem;
}

.order-total {
  font-weight: bold;
  color: #059669;
}

.order-status {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-completed { background: #d1fae5; color: #065f46; }
.status-processing { background: #fef3c7; color: #92400e; }
.status-pending { background: #fee2e2; color: #991b1b; }
.status-cancelled { background: #fecaca; color: #7f1d1d; }
.status-refunded { background: #dbeafe; color: #1e40af; }
.status-default { background: #f3f4f6; color: #374151; }

.order-customer {
  text-align: right;
  font-size: 0.9rem;
}