/* === STRUCTURE DE BASE === */
.opi-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.opi-col {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.opi-summary {
  width: 100%;
  direction: rtl;
  text-align: center;
  margin-top: 20px;
  font-size: 20px !important;
  line-height: 2;
}

/* === FORMULAIRES === */
input[name="shipping_address"] {
  text-align: right;
  direction: rtl;
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
}

#opi-form select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 12px 16px 12px 38px;
  border: 1.5px solid #eee;
  border-radius: 10px;
  font-size: 17px;
  background: #faf9fa;
  color: #444;
  font-family: "Tajawal", "Cairo", sans-serif !important;
  appearance: none;
  outline: none;
  margin-bottom: 15px;
  direction: rtl;
  text-align: right;
  line-height: 1.8 !important;
  height: 48px;
  transition: border 0.2s, background 0.2s;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,<svg width='20' height='20' fill='gray' xmlns='http://www.w3.org/2000/svg'><polygon points='6,8 14,8 10,14' /></svg>");
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 18px 18px;
}

/* === LIVRAISON === */
.opi-livraison {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
}

.opi-livraison label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid #eee;
  border-radius: 8px;
  font-size: 17px;
  background: #faf9fa;
  color: #7c7c7c;
  cursor: pointer;
  transition: border 0.2s, background 0.2s;
  width: 100%;
  font-weight: 500;
  white-space: nowrap;
}

.opi-livraison input[type="radio"] {
  accent-color: #b3004b;
  width: 20px;
  height: 20px;
  margin-left: 8px;
  margin-right: 0;
  cursor: pointer;
}

.opi-livraison label:has(input[type="radio"]:checked) {
  border: 2px solid #b3004b;
  background: #ffe9f3;
  color: #222;
}

/* === BOUTON SUBMIT === */
.opi-submit {
  display: block !important;
  margin: 20px auto 0 !important;
  background-color: #b3004b !important;
  color: white !important;
  padding: 14px 28px !important;
  font-size: 16px !important;
  font-weight: bold !important;
  border: none !important;
  border-radius: 8px !important;
  width: 100% !important;
  max-width: 680px !important;
  cursor: pointer !important;
  transition: 0.3s ease-in-out !important;
}

.opi-submit:hover {
  background-color: #a00044 !important;
  transform: scale(1.03);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.opi-submit.vibrate {
  animation: opi-vibrate 0.6s ease-in-out infinite;
}

/* === ANIMATION BOUTON === */
@keyframes opi-vibrate {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  75% { transform: translateX(-1px); }
}

/* === QUANTITÉ === */
.opi-qty-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  background: #fff;
  border: none;
  box-shadow: none;
  overflow: hidden;
  width: fit-content;
  margin: 40px auto 0 auto; /* ajusté pour alignement vertical */
  font-family: 'Tajawal', 'Cairo', sans-serif;
}

.opi-qty-btn,
.opi-qty-display {
  height: 45px;
  width: 50px;
  font-size: 20px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  box-sizing: border-box;
}

.opi-qty-btn {
  background: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
  border: 1px solid #ccc;
  font-size: 26px;
  color: #000;
  padding: 0;
  line-height: 1;
}

.opi-qty-btn:hover {
  background: #f0f0f0;
}

/* Espacements personnalisés entre les boutons et le chiffre */
.opi-qty-btn#opi-minus {
  margin-left: 0;
  margin-right: 0;
}

.opi-qty-btn#opi-plus {
  margin-right: 4px;
  margin-left: 0;
}

.opi-qty-display {
  height: 45px;
  width: 50px;
  font-size: 20px;
  font-weight: bold;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none !important;
  box-shadow: none;
  user-select: none;
  padding: 0;
  margin: 0;
}

.opi-qty-display span#opi-quantity {
  display: inline-block;
  font-size: 20px;
  font-weight: bold;
  line-height: 1;
  text-align: center;
  height: 100%;
  vertical-align: middle;
  direction: ltr;
  padding: 0 6px;
}

#opi-quantity {
  user-select: none;
}

.opi-qty-wrapper .opi-qty-btn:first-child {
  border-right: none;
}

.opi-qty-wrapper .opi-qty-btn:last-child {
  border-left: none;
}