/* =============================================================
   Toolsindo WhatsApp Order — Checkout Style (snackshop.id-inspired)
   Always-visible form · Product summary card · Order total
   ============================================================= */

/* ── Checkout Container ───────────────────────────────────────── */
.tiwa-checkout {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 28px 0 0;
  max-width: 640px;
}

/* ── Header ───────────────────────────────────────────────────── */
.tiwa-checkout__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 2px solid #f0f0f0;
  color: #25D366;
}

.tiwa-checkout__header h3 {
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
}

/* ── Product Summary Card ─────────────────────────────────────── */
.tiwa-summary-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  background: #f8f9fa;
  border: 1.5px solid #e9ecef;
  border-radius: 12px;
  margin-bottom: 20px;
}

.tiwa-summary-card__img-wrap {
  flex-shrink: 0;
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.tiwa-summary-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tiwa-summary-card__info {
  flex: 1;
  min-width: 0;
}

.tiwa-summary-card__name {
  font-size: .82rem;
  font-weight: 600;
  color: #2d2d2d;
  margin: 0 0 6px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tiwa-summary-card__price {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}

.tiwa-price-sale {
  font-weight: 700;
  font-size: 1rem;
  color: #FF6B35;
}

.tiwa-price-orig {
  font-size: .76rem;
  color: #9e9e9e;
  text-decoration: line-through;
}

.tiwa-price-disc {
  font-size: .7rem;
  font-weight: 700;
  background: #FF6B35;
  color: #fff;
  border-radius: 4px;
  padding: 1px 6px;
}

.tiwa-summary-card__meta {
  display: flex;
  gap: 10px;
  font-size: .72rem;
  color: #6c757d;
  flex-wrap: wrap;
}

/* ── Form ─────────────────────────────────────────────────────── */
.tiwa-checkout__form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tiwa-field {
  margin-bottom: 14px;
}

.tiwa-field label {
  display: block;
  font-family: inherit;
  font-size: .81rem;
  font-weight: 600;
  color: #2d2d2d;
  margin-bottom: 6px;
}

.tiwa-req {
  color: #e53935;
  margin-left: 2px;
}

.tiwa-opt {
  font-weight: 400;
  color: #9e9e9e;
  font-size: .74rem;
}

.tiwa-field input[type="text"],
.tiwa-field input[type="tel"],
.tiwa-field input[type="number"],
.tiwa-field textarea {
  width: 100%;
  font-family: inherit;
  font-size: .87rem;
  color: #2d2d2d;
  background: #fff;
  border: 1.5px solid #dde1e7;
  border-radius: 10px;
  padding: 11px 14px;
  transition: border-color .18s, box-shadow .18s;
  outline: none;
  box-sizing: border-box;
  resize: vertical;
}

.tiwa-field input:focus,
.tiwa-field textarea:focus {
  border-color: #25D366;
  box-shadow: 0 0 0 3px rgba(37,211,102,.12);
}

.tiwa-field input.tiwa-error,
.tiwa-field textarea.tiwa-error {
  border-color: #e53935;
  box-shadow: 0 0 0 3px rgba(229,57,53,.1);
}

.tiwa-error-msg {
  display: none;
  font-size: .74rem;
  color: #e53935;
  margin-top: 4px;
  font-family: inherit;
}

/* ── Quantity Stepper ─────────────────────────────────────────── */
.tiwa-qty-wrap {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid #dde1e7;
  border-radius: 10px;
  overflow: hidden;
}

.tiwa-qty-btn {
  width: 42px;
  height: 44px;
  background: #f5f5f5;
  border: none;
  font-size: 1.15rem;
  font-weight: 700;
  color: #2d2d2d;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  flex-shrink: 0;
  font-family: inherit;
}

.tiwa-qty-btn:hover {
  background: #25D366;
  color: #fff;
}

.tiwa-qty-wrap input[type="number"] {
  width: 58px;
  height: 44px;
  border: none;
  border-left: 1.5px solid #dde1e7;
  border-right: 1.5px solid #dde1e7;
  border-radius: 0;
  text-align: center;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 700;
  padding: 0;
  color: #2d2d2d;
  background: #fff;
  -moz-appearance: textfield;
  box-shadow: none;
}

.tiwa-qty-wrap input[type="number"]:focus {
  outline: none;
  box-shadow: none;
  border-color: #dde1e7;
}

.tiwa-qty-wrap input[type="number"]::-webkit-inner-spin-button,
.tiwa-qty-wrap input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

/* ── Order Summary ────────────────────────────────────────────── */
.tiwa-order-summary {
  background: #f8f9fa;
  border: 1.5px solid #e9ecef;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 18px 0 16px;
}

.tiwa-order-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: inherit;
  font-size: .84rem;
  color: #2d2d2d;
  padding: 4px 0;
}

.tiwa-order-summary__row--muted {
  font-size: .78rem;
  color: #9e9e9e;
}

.tiwa-order-summary__row--total {
  font-weight: 700;
  font-size: .96rem;
  color: #FF6B35;
}

.tiwa-order-summary__val {
  font-weight: 600;
}

.tiwa-order-summary__divider {
  height: 1px;
  background: #e9ecef;
  margin: 8px 0;
}

/* ── Submit Button ────────────────────────────────────────────── */
.tiwa-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .2px;
  transition: background .18s, transform .12s, box-shadow .18s;
  box-shadow: 0 4px 16px rgba(37,211,102,.35);
}

.tiwa-submit-btn:hover {
  background: #128C7E;
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(37,211,102,.45);
}

.tiwa-submit-btn:active {
  transform: translateY(0);
}

.tiwa-submit-btn--success {
  background: #1a1a2e;
  box-shadow: none;
}

/* ── No config warning ────────────────────────────────────────── */
.tiwa-no-config {
  background: #fff8e1;
  border: 1.5px solid #ffd54f;
  border-radius: 10px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: .84rem;
  color: #795548;
  margin: 0;
}

.tiwa-no-config a {
  color: #FF6B35;
  font-weight: 600;
  text-decoration: none;
}

/* ── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .tiwa-checkout {
    margin-top: 20px;
  }

  .tiwa-summary-card__img-wrap {
    width: 68px;
    height: 68px;
  }

  .tiwa-submit-btn {
    min-height: 52px;
    font-size: .95rem;
    /* Sticky di mobile */
    position: sticky;
    bottom: 12px;
    z-index: 100;
    box-shadow: 0 6px 24px rgba(37,211,102,.5);
  }

  .tiwa-order-summary {
    margin-bottom: 10px;
  }
}

/* ── Country select field ─────────────────────────────────── */
.tiwa-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--tiwa-border, #e0e0e0);
  border-radius: 10px;
  font-family: inherit;
  font-size: .9rem;
  color: var(--tiwa-text, #222);
  background: #fff;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  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 d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  transition: border-color .18s, box-shadow .18s;
}
.tiwa-select:focus {
  outline: none;
  border-color: #25d366;
  box-shadow: 0 0 0 3px rgba(37,211,102,.12);
}

/* ── Shipping note ────────────────────────────────────────── */
.tiwa-shipping-note {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .8rem;
  line-height: 1.5;
  margin-bottom: 16px;
}
.tiwa-ship-domestic {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}
.tiwa-ship-intl {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}
