:root {
  --bg: #F4F2ED;
  --white: #FFFFFF;
  --text-main: #1A1A1A;
  --text-muted: #8A8A8A;
  --border: #E6E6E6;
}

/* RESET */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  font-family: 'Inter', sans-serif;
  color: var(--text-main);
}

/* HEADER */
.header {
  padding: 24px;
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
}

.header-left {
  display: flex;
  justify-content: flex-start;
  margin-top: 160px;
}

.header-center {
  display: flex;
  justify-content: center;
}

.logo {
  height: 195px;
  margin-top: -30%;
  margin-left: -85px;
  object-fit: contain;
}

.orders-btn {
  background: #000;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.container {
  padding-left: 24px;
  padding-right: 24px;
}

.card,
.delivery-card {
  background: var(--white);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
}

/* ACCORDION */
.accordion-header {
  all: unset;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  cursor: pointer;
}

.accordion-header span {
  font-size: 17px;
  font-weight: 600;
}

.arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.25s ease;
}

.accordion-header.active .arrow {
  transform: rotate(180deg);
}

.accordion-content {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.accordion-content.open {
  max-height: 800px;
  margin-top: 16px;
}

/* INPUTS */
input,
select {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 15px;
  outline: none;
}

input::placeholder {
  color: var(--text-muted);
}

input:focus,
select:focus {
  border-color: #000;
}

/* Field with icon */
.field {
  position: relative;
}

.field input {
  width: 100%;
  height: 46px;
  padding-right: 42px;
}

.field .icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #999;
  font-size: 16px;
}

/* Select wrapper */
.select-wrapper {
  position: relative;
}

.select-wrapper .arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Card icons */
.cards-accepted {
  margin: 16px 0;
}

.cards-accepted span {
  font-size: 14px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
}

.card-icons {
  display: flex;
  gap: 15px;
  align-items: center;
}

.card-icons img {
  height: 24px;
}

/* Confirm button */
.confirm-button {
  width: 100%;
  height: 54px;
  border-radius: 12px;
  border: none;
  background: #000;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.confirm-button:disabled {
  background: #8A8A8A;
  cursor: not-allowed;
}

.card {
  max-width: 420px;
  margin: 24px auto;
}

.input-euro {
  position: relative;
}

.input-euro input {
  padding-right: 40px;
}

.euro {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #6E6E6E;
}

/* Summary lines */
.line {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 400;
  color: #5F5F5F;
}

.line span:last-child {
  color: #2A2A2A;
}

.line.total {
  margin-top: 16px;
  font-size: 15px;
  font-weight: 600;
  color: #1A1A1A;
}

/* Delivery section */
.delivery-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.delivery-option input[type="radio"] {
  width: 15px;
  height: 18px;
  margin-top: 2px;
}

.delivery-content {
  flex: 1;
}

.delivery-main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 4px;
}

.delivery-name {
  color: var(--text-main);
}

.delivery-price {
  color: var(--text-main);
  font-weight: 500;
  white-space: nowrap;
}

.delivery-sub {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.delivery-note {
  font-size: 13px;
  font-weight: 400;
  color: #6E6E6E;
  line-height: 1.4;
}

/* Payment section */
.payment-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 18px;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 14px;
  opacity: 1;
}

.payment-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 2px solid #000;
  border-radius: 50%;
  background-color: #fff;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.payment-option input[type="radio"]:checked::after {
  content: "";
  width: 6px;
  height: 6px;
  background-color: #000;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.payment-option input[type="radio"]:disabled {
  opacity: 1;
}

.cards-accepted {
  margin-top: 6px;
  margin-bottom: 18px;
}

.cards-accepted span {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.card-icons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.card-form input {
  margin-bottom: 14px;
  font-size: 15px;
}

.card-form input::placeholder {
  color: #9A9A9A;
}

.card-form {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 75%;
  margin-left: 0;
}

.input-group {
  position: relative;
  margin-bottom: 14px;
}

.input-group input {
  width: 100%;
  height: 48px;
  padding: 0 68px 0 14px;
  font-size: 14px;
  border: 1px solid #bfbfbf;
  border-radius: 3px;
  outline: none;
  background: #fff;
  color: #333;
  margin-bottom: 0;
}

.input-group input::placeholder {
  color: #8c8c8c;
}

.input-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  opacity: 1;
  pointer-events: none;
  object-fit: contain;
  display: block;
}

.cards-box {
  border: 1px solid #bfbfbf;
  padding: 10px;
  margin-bottom: 14px;
  background: #fff;
  width: 75%;
}

.cards-title {
  font-size: 13px;
  color: #555;
  margin-bottom: 6px;
  display: block;
}

.cards-logos {
  display: flex;
  gap: 8px;
}

.cards-logos img {
  height: 22px;
}

.payment-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

.payment-radio input {
  display: none;
}

.custom-radio {
  width: 16px;
  height: 16px;
  border: 2px solid #000;
  border-radius: 50%;
  position: relative;
}

.payment-radio input:checked + .custom-radio::after {
  content: "";
  width: 8px;
  height: 8px;
  background: #000;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.terms-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.terms-checkbox input {
  display: none;
}

.custom-checkbox {
  width: 14px;
  height: 14px;
  border: 1px solid #555;
}

.terms-checkbox input:checked + .custom-checkbox {
  background: #555;
}

.delivery-section {
  border-radius: 0;
  border: 1px solid #bfbfbf;
  padding: 12px;
  background: #fff;
  margin-bottom: 24px;
}

.delivery-box {
  border: 1px solid #bfbfbf;
  border-radius: 0;
  padding: 16px;
  background: #fff;
}

.delivery-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.delivery-option input {
  display: none;
}

.custom-radio {
  width: 16px;
  height: 16px;
  border: 2px solid #000;
  border-radius: 50%;
  margin-top: 4px;
  position: relative;
}

.delivery-option input:checked + .custom-radio::after {
  content: "";
  width: 8px;
  height: 8px;
  background: #000;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.delivery-line {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.delivery-info {
  font-size: 12px;
  color: #444;
  margin-top: 6px;
}

.relay-btn {
  margin-top: 14px;
  background: #000;
  color: #fff;
  border: none;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-left: 4px;
}

.terms-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #333;
  margin-top: 16px;
}

.terms-checkbox input {
  display: none;
}

.custom-checkbox {
  width: 14px;
  height: 14px;
  border: 1px solid #555;
  margin-top: 2px;
}

.terms-checkbox input:checked + .custom-checkbox {
  background: #555;
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  max-width: 900px;
  width: 95%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-large {
  max-width: 1100px;
}

.modal-confirmation .order-summary p {
  margin: 6px 0;
}

.modal-close-btn,
.modal-close-x {
  background: #f1f1f1;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.order-card {
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.status-badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
}

.status-en-attente-de-confirmation-de-paiement {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

.status-paiement-confirmé {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-en-préparation {
  background: #cce5ff;
  color: #004085;
  border: 1px solid #b8daff;
}

.status-expédié {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.status-livré {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-annulé {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Loading screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.loading-screen.hidden {
  display: none;
}

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  color: white;
  margin-top: 10px;
  font-size: 14px;
}

/* Utility */
.hidden {
  display: none !important;
}
