/* Algeria COD Checkout — Frontend (lightweight, no Bootstrap) */

.acod-wrap {
  --acod-primary: #7e3af2;
  --acod-secondary: #111;
  --acod-button: #7e3af2;
  --acod-text: #111;
  --acod-border: #c4b5fd;
  --acod-bg: #fff;
  --acod-header-bg: #000;
  --acod-header-text: #fff;
  --acod-radius: 12px;
  --acod-btn-radius: 999px;
  --acod-font: 16px;
  --acod-form-width: 480px;
  --acod-muted: #6b7280;
  --acod-soft: #f3e8ff;
  box-sizing: border-box;
  max-width: var(--acod-form-width);
  margin: 0 auto;
  padding: 0 0 96px;
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
  font-size: var(--acod-font);
  color: var(--acod-text);
  background: var(--acod-bg);
  line-height: 1.5;
}

.acod-wrap *,
.acod-wrap *::before,
.acod-wrap *::after {
  box-sizing: border-box;
}

.acod-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--acod-header-bg);
  color: var(--acod-header-text);
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.acod-brand {
  flex: 1;
  text-align: center;
}

.acod-store-name {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1.05em;
}

.acod-logo {
  max-height: 32px;
  width: auto;
}

.acod-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 56px;
  justify-content: flex-end;
}

.acod-icon-btn,
.acod-icon {
  background: none;
  border: 0;
  color: inherit;
  padding: 0;
  display: inline-flex;
  cursor: default;
}

.acod-menu-btn {
  width: 28px;
  flex-direction: column;
  gap: 5px;
  cursor: default;
}

.acod-menu-btn span {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 2px;
}

.acod-header-spacer {
  width: 28px;
}

.acod-product {
  padding: 18px 16px 8px;
}

.acod-product-media {
  margin-bottom: 12px;
  text-align: center;
}

.acod-product-img {
  max-width: 100%;
  height: auto;
  border-radius: var(--acod-radius);
}

.acod-vendor {
  margin: 0 0 4px;
  color: var(--acod-muted);
  font-size: 0.9em;
}

.acod-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.acod-price {
  color: var(--acod-primary);
  font-size: 1.55em;
  font-weight: 800;
}

.acod-price-regular {
  color: var(--acod-muted);
  text-decoration: line-through;
  font-size: 0.95em;
}

.acod-product-title {
  margin: 0;
  font-size: 1.15em;
  font-weight: 700;
  color: var(--acod-text);
}

.acod-card {
  margin: 12px 16px;
  padding: 16px;
  border: 1.5px solid var(--acod-border);
  border-radius: var(--acod-radius);
  background: #fff;
}

.acod-trust-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.acod-trust-title {
  margin: 0 0 4px;
  font-size: 1.05em;
}

.acod-trust-sub {
  margin: 0;
  color: var(--acod-muted);
  font-size: 0.88em;
}

.acod-star {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #facc15;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.acod-trust-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.acod-trust-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e9d5ff;
  border-radius: 10px;
}

.acod-trust-item strong {
  display: block;
  font-size: 0.95em;
}

.acod-trust-item span {
  display: block;
  color: var(--acod-muted);
  font-size: 0.82em;
}

.acod-trust-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--acod-primary);
  flex-shrink: 0;
  position: relative;
}

.acod-trust-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px;
}

.acod-icon-cod::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23fff' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect x='3' y='6' width='18' height='12' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3C/svg%3E");
}

.acod-icon-inspect::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23fff' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
}

.acod-icon-shipping::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23fff' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M3 7h11v10H3z'/%3E%3Cpath d='M14 10h4l3 3v4h-7'/%3E%3Ccircle cx='7' cy='18' r='1.5'/%3E%3Ccircle cx='17' cy='18' r='1.5'/%3E%3C/svg%3E");
}

.acod-icon-return::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23fff' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7'/%3E%3Cpath d='M3 4v5h5'/%3E%3C/svg%3E");
}

.acod-form-head {
  text-align: center;
  margin-bottom: 16px;
}

.acod-form-head h3 {
  margin: 0 0 6px;
  font-size: 1.1em;
}

.acod-form-head p {
  margin: 0;
  color: var(--acod-muted);
  font-size: 0.9em;
}

.acod-field {
  margin-bottom: 14px;
}

.acod-field label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

.acod-input,
.acod-select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: var(--acod-text);
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.acod-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 36px;
}

.acod-wrap[dir="ltr"] .acod-select {
  background-position: right 14px center;
  padding-left: 14px;
  padding-right: 36px;
}

.acod-input:focus,
.acod-select:focus {
  outline: 2px solid color-mix(in srgb, var(--acod-primary) 35%, white);
  border-color: var(--acod-primary);
}

.acod-input.is-invalid,
.acod-select.is-invalid {
  border-color: #ef4444;
}

.acod-help {
  margin: 6px 0 0;
  color: var(--acod-muted);
  font-size: 0.8em;
}

.acod-error,
.acod-form-error {
  margin: 6px 0 0;
  color: #dc2626;
  font-size: 0.85em;
}

.acod-qty {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  border: 1.5px solid #e9d5ff;
  border-radius: 12px;
  overflow: hidden;
  max-width: 220px;
}

.acod-qty-btn {
  height: 48px;
  border: 0;
  background: #efe7ff;
  color: var(--acod-primary);
  font-size: 1.4em;
  font-weight: 700;
  cursor: pointer;
}

.acod-qty-input {
  border: 0;
  text-align: center;
  font: inherit;
  font-weight: 700;
  height: 48px;
  background: #fff;
  color: var(--acod-text);
  -moz-appearance: textfield;
}

.acod-qty-input::-webkit-outer-spin-button,
.acod-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.acod-summary {
  margin-top: 8px;
  padding: 14px;
  border-radius: 12px;
  background: var(--acod-soft);
}

.acod-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  color: var(--acod-text);
}

.acod-summary-row + .acod-summary-row {
  border-top: 1px dashed #d8b4fe;
}

.acod-summary-total strong {
  color: var(--acod-primary);
  font-size: 1.05em;
}

.acod-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 22px;
  border: 0;
  border-radius: var(--acod-btn-radius);
  background: var(--acod-button);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(126, 58, 242, 0.28);
  animation: acod-wiggle 1.8s ease-in-out infinite;
}

@keyframes acod-wiggle {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(6px); }
  75% { transform: translateX(-6px); }
}

.acod-submit:hover {
  animation: none;
  transform: translateY(-1px);
}

.acod-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  animation: none;
  transform: none;
}

.acod-submit-inline {
  width: 100%;
  margin-top: 16px;
}

.acod-trust-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 16px 24px;
}

.acod-trust-grid-item {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
}

.acod-grid-label {
  display: block;
  color: var(--acod-primary);
  font-size: 0.72em;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.acod-grid-text {
  display: block;
  font-size: 0.9em;
  font-weight: 600;
}

.acod-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid #eee;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.08);
  max-width: var(--acod-form-width);
  margin: 0 auto;
}

.acod-sticky-price span {
  display: block;
  color: var(--acod-muted);
  font-size: 0.8em;
}

.acod-sticky-price strong {
  color: var(--acod-primary);
  font-size: 1.2em;
}

.acod-sticky-btn {
  flex: 1;
  max-width: 62%;
}

.acod-success {
  margin: 16px;
}

.acod-success-card {
  text-align: center;
  padding: 28px 18px;
  border: 1.5px solid var(--acod-border);
  border-radius: var(--acod-radius);
  background: #fff;
}

.acod-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #22c55e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
}

.acod-delivery-types {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.acod-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

@media (min-width: 768px) {
  .acod-wrap {
    border: 1px solid #f3f4f6;
    border-radius: 16px;
    overflow: hidden;
    margin-top: 16px;
    margin-bottom: 16px;
  }

  .acod-sticky {
    border-radius: 0 0 16px 16px;
    position: sticky;
  }
}
