* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  touch-action: manipulation;
  overscroll-behavior: none;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
}

/* ── Écrans ── */
.screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  background: #f2f2f7;
}

.screen.active {
  display: block;
}

/* ── Header shop ── */
.shop-header {
  padding: 20px 16px 8px;
}

.shop-header p:first-child {
  font-size: 11px;
  font-weight: 600;
  color: #8e8e93;
  letter-spacing: 1.2px;
  margin: 0 0 4px;
}

.shop-header p:last-child {
  font-size: 22px;
  font-weight: 700;
  color: #1c1c1e;
  margin: 0;
}

/* ── Écran 1 : produits ── */
#shopView {
  padding-bottom: calc(90px + env(safe-area-inset-bottom));
}

#shop {
  padding: 8px 16px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.product {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

.product img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
}

.product-info {
  padding: 10px 12px 12px;
}

.product-info h3 {
  font-size: 14px;
  font-weight: 600;
  color: #1c1c1e;
  margin: 0 0 2px;
}

.product-info p {
  font-size: 13px;
  color: #8e8e93;
  margin: 0 0 10px;
}

/* ── Contrôles +/− ── */
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f2f2f7;
  border-radius: 10px;
  padding: 4px;
  margin: 0;
  gap: 0;
}

.controls button {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.controls button:first-child {
  background: white;
  color: #1c1c1e;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.controls button:last-child {
  background: #0088cc;
  color: white;
}

.controls .qty-display {
  font-size: 14px;
  font-weight: 600;
  color: #1c1c1e;
  min-width: 20px;
  text-align: center;
}

/* ── Badge quantité ── */
.quantity {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #0088cc;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  display: none;
}

/* ── Bouton Commander ── */
#checkout {
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  background: white;
  padding: 10px 16px;
  border-top: 0.5px solid #e5e5ea;
  z-index: 10;
}

#orderBtn {
  width: 100%;
  height: 52px;
  font-size: 19px;
  /*font-weight: 600;*/
  letter-spacing: 0.3px;
  background: #0088cc;
  color: white;
  border: none;
  border-radius: 14px;
  cursor: pointer;
}

#orderBtn:disabled {
  background: #c7c7cc;
  cursor: default;
}

/* ── Écran 2 : commande ── */
.screen-inner {
  padding: 16px;
  padding-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#orderSummary {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  font-size: 15px;
}

.summary-total {
  display: block;
  margin-top: 8px;
  border-top: 1px solid #f0f0f0;
  padding-top: 8px;
  font-weight: bold;
}

/* ── Formulaire ── */
.form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 15px;
  background: white;
  outline: none;
  transition: border-color 0.2s;
}

.form input:focus {
  border-color: #0088cc;
}

.form input.error-input {
  border-color: #e53935;
}

.field-error {
  font-size: 12px;
  color: #e53935;
  min-height: 16px;
  padding-left: 4px;
}

/* ── Bouton Confirmer ── */
#confirmOrder {
  width: 100%;
  height: 52px;
  font-size: 17px;
  font-weight: 600;
  background: #0088cc;
  color: white;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  margin-top: 8px;
}

#confirmOrder:disabled {
  background: #c7c7cc;
  cursor: default;
}

/* ── Erreur plein écran ── */
.error {
  background: red;
  color: white;
  padding: 10px;
  text-align: center;
  display: none;
}

/* ── Labels section ── */
.section-label {
  font-size: 11px;
  font-weight: 600;
  color: #8e8e93;
  letter-spacing: 1.2px;
  margin: 0 0 8px 4px;
}

/* ── Summary card ── */
.summary-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 0.5px solid #f0f0f0;
  font-size: 15px;
  color: #111;
}

.summary-line:last-child {
  border-bottom: none;
}

.summary-line .qty {
  font-size: 13px;
  color: #aaa;
  margin-left: 8px;
}

.summary-total-line {
  display: flex;
  justify-content: space-between;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #111;
}

.summary-total-line span:last-child {
  color: #0088cc;
}

/* ── Formulaire field-row ── */
.field-row {
  padding: 13px 16px;
  border-bottom: 0.5px solid #f0f0f0;
}

.field-row label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #aaa;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.field-row input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 15px;
  color: #111;
  background: transparent;
  padding: 0;
}

.field-row input::placeholder {
  color: #ccc;
}

.field-row input.error-input {
  color: #e53935;
}

/* ── Time picker ── */
.time-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-picker select {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #eee;
  border-radius: 8px;
  font-size: 15px;
  background: white;
  color: #111;
  text-align: center;
}

.time-sep {
  font-size: 20px;
  color: #8e8e93;
}

/* ── Loader ── */
.loader {
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-left-color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin89345 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
}

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