/* ============================================================
   QuickOrder Module — Styles
   Compatible PrestaShop 8 (Classic / Hummingbird)
   ============================================================ */

/* ---- Bouton ---- */
.quickorder-wrapper {
  margin-top: 10px;
}

.quickorder-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .3px;
  cursor: pointer;
  transition: filter .15s, transform .1s;
  width: 100%;
  justify-content: center;
}
.quickorder-btn:hover  { filter: brightness(1.1); }
.quickorder-btn:active { transform: scale(.98); }
.quickorder-btn svg    { flex-shrink: 0; }

/* ---- Overlay ---- */
.qo-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.qo-modal-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* ---- Boîte ---- */
.qo-modal-box {
  position: relative;
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 32px 32px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  transform: translateY(18px) scale(.97);
  transition: transform .25s ease;
}
.qo-modal-overlay.is-open .qo-modal-box {
  transform: translateY(0) scale(1);
}

/* ---- Fermer ---- */
.qo-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: #888;
  border-radius: 50%;
  line-height: 1;
  transition: background .15s, color .15s;
}
.qo-modal-close:hover { background: #f2f2f2; color: #333; }

/* ---- Header modal ---- */
.qo-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.qo-modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qo-modal-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 2px;
  color: #1a1a1a;
}
.qo-modal-product-name {
  font-size: 13px;
  color: #666;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

/* ---- Sections ---- */
.qo-section {
  margin-bottom: 20px;
}
.qo-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #888;
  margin: 0 0 12px;
}

/* ---- Grid ---- */
.qo-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 480px) {
  .qo-grid-2 { grid-template-columns: 1fr; }
  .qo-modal-box { padding: 22px 18px 20px; }
}

/* ---- Champs ---- */
.qo-field { display: flex; flex-direction: column; gap: 5px; }
.qo-label { font-size: 13px; font-weight: 600; color: #333; }
.qo-required { color: #e03; }

.qo-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
  color: #333;
  background: #fafafa;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
  font-family: inherit;
}
.qo-input:focus {
  outline: none;
  border-color: currentColor;
  box-shadow: 0 0 0 3px rgba(100,100,200,.1);
  background: #fff;
}
.qo-textarea {
  resize: vertical;
  min-height: 64px;
}

/* ---- Quantité ---- */
.qo-qty-wrapper {
  display: flex;
  align-items: stretch;
  border: 1.5px solid #ddd;
  border-radius: 5px;
  overflow: hidden;
  background: #fafafa;
}
.qo-qty-btn {
  background: #f0f0f0;
  border: none;
  width: 36px;
  font-size: 18px;
  cursor: pointer;
  color: #444;
  transition: background .12s;
  flex-shrink: 0;
  padding: 0;
}
.qo-qty-btn:hover { background: #e0e0e0; }
.qo-qty-input {
  border: none !important;
  border-radius: 0 !important;
  text-align: center;
  box-shadow: none !important;
  background: transparent !important;
  flex: 1;
  min-width: 0;
}
.qo-qty-input::-webkit-inner-spin-button,
.qo-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.qo-qty-input { -moz-appearance: textfield; }

/* ---- Attributs ---- */
.qo-attributes { display: flex; flex-direction: column; gap: 12px; }
.qo-attribute-group { display: flex; flex-direction: column; gap: 6px; }
.qo-attribute-values { display: flex; flex-wrap: wrap; gap: 7px; }

.qo-attr-chip {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.qo-attr-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.qo-attr-chip span {
  padding: 5px 13px;
  border: 1.5px solid #ddd;
  border-radius: 20px;
  font-size: 13px;
  color: #444;
  background: #f8f8f8;
  transition: border-color .15s, background .15s, color .15s;
  user-select: none;
}
.qo-attr-chip input:checked + span {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #fff;
}
.qo-attr-chip:hover span { border-color: #aaa; }

/* ---- Feedback ---- */
.qo-feedback {
  padding: 10px 14px;
  border-radius: 5px;
  font-size: 13px;
  margin-bottom: 14px;
}
.qo-feedback--error   { background: #fff0f0; color: #c00; border: 1px solid #fcc; }
.qo-feedback--success { background: #f0fff4; color: #186a36; border: 1px solid #b7f5d0; }

/* ---- Bouton soumettre ---- */
.qo-actions { margin-top: 8px; }
.qo-submit-btn {
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: 5px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: filter .15s;
}
.qo-submit-btn:hover    { filter: brightness(1.1); }
.qo-submit-btn:disabled { opacity: .7; cursor: not-allowed; }
.qo-submit-label { display: inline-flex; align-items: center; gap: 8px; }
.qo-submit-loading { display: inline-flex; align-items: center; }

/* ---- Spinner ---- */
.qo-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: qo-spin .7s linear infinite;
  display: inline-block;
}
@keyframes qo-spin { to { transform: rotate(360deg); } }

/* ---- Écran succès ---- */
.qo-success-screen {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 0 10px;
  gap: 14px;
}
.qo-success-icon svg { display: block; }
.qo-success-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}
.qo-success-msg {
  font-size: 14px;
  color: #555;
  max-width: 380px;
  margin: 0;
  line-height: 1.6;
}
.qo-close-success {
  margin-top: 8px;
  padding: 10px 28px;
  border: none;
  border-radius: 5px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
