:root {
  /* default theme – admin panel থেকে inline variables দিয়ে override হবে */
  --ghb-bg: #fdf5eb;
  --ghb-card: #fbf1e4;
  --ghb-border: #f0ddc7;
  --ghb-primary: #f59e32;
  --ghb-primary-dark: #ea8c12;
  --ghb-text: #3a2715;
  --ghb-muted: #8f7053;
  --ghb-radius-lg: 22px;
  --ghb-radius-md: 16px;
  --ghb-shadow: 0 24px 60px rgba(62, 35, 13, 0.35);
  --ghb-font: "Hind Siliguri", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.ghb-cod-popup-open {
  overflow: hidden;
}

/* Overlay সব স্ক্রিনে ফুল-কভার, ছোট ডিভাইসে প্যাডিং কমানো */
.ghb-cod-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 20, 0.55);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Popup box – এখন scrollable + responsive */
.ghb-cod-popup {
  position: relative;
  background: var(--ghb-bg);
  border-radius: 32px 32px 26px 26px;
  box-shadow: var(--ghb-shadow);
  max-width: 480px;
  width: 100%;
  padding: 1.75rem 1.3rem 1.6rem;
  font-family: var(--ghb-font);
  color: var(--ghb-text);

  /* স্ক্রলেবল করার জন্য */
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ghb-cod-popup-close {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  background: transparent;
  border: 0;
  font-size: 1.4rem;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.4);
}

/* ✅ Product header: small image + text on the right */
.ghb-cod-popup-header {
  text-align: left; /* আগে center ছিল, এখন বামে */
  margin-bottom: 0.9rem;
}

.ghb-cod-product-summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
  text-align: left;
}

.ghb-cod-product-media {
  flex-shrink: 0;
}

.ghb-cod-product-media .ghb-cod-product-image,
.ghb-cod-product-media img {
  width: 52px;  /* ছোট thumbnail */
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}

.ghb-cod-product-info {
  flex: 1;
  border-radius: 14px;
  border: 1px solid rgba(245, 158, 66, 0.35);
  background: #fff3e0;
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
  margin-top: 0; /* আগের margin-top override */
}

.ghb-cod-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: var(--ghb-muted);
  margin: 0;
}

.ghb-cod-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0.15rem 0 0.25rem;
}

.ghb-cod-subtitle {
  font-size: 0.85rem;
  color: var(--ghb-muted);
  margin: 0;
}

.ghb-cod-subtitle span {
  font-weight: 600;
  color: var(--ghb-primary-dark);
}

/* Qty + unit price row কে compact রাখা */
.ghb-cod-qty-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.ghb-cod-qty-control {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #fffaf4;
  border: 1px solid rgba(240, 221, 199, 0.9);
  overflow: hidden;
}

.ghb-cod-qty-btn {
  border: none;
  background: transparent;
  padding: 0.15rem 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--ghb-text);
}

.ghb-cod-qty-input {
  width: 2.1rem;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 0.85rem;
}

.ghb-cod-unit-price {
  font-size: 0.78rem;
  color: var(--ghb-muted);
}

.ghb-cod-unit-price-label {
  margin-right: 0.15rem;
}

.ghb-cod-unit-price-value {
  font-weight: 600;
  color: var(--ghb-primary-dark);
}

.ghb-cod-card {
  border-radius: var(--ghb-radius-lg);
  background: var(--ghb-card);
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.7rem;
}

.ghb-cod-card--fields {
  padding: 0.9rem 1rem;
}

.ghb-cod-card--shipping {
  margin-top: 0.4rem;
}

.ghb-cod-field {
  margin-bottom: 0.6rem;
}

.ghb-cod-label {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.ghb-required {
  color: #dc2626;
}

.ghb-cod-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  background: #fffaf4;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(240, 221, 199, 0.9);
}

.ghb-cod-input-wrap--textarea {
  align-items: flex-start;
  border-radius: 18px;
}

.ghb-cod-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fce5c8;
  border: 1px solid rgba(234, 148, 39, 0.3);
}

.ghb-icon {
  width: 14px;
  height: 14px;
  stroke: none;
  fill: #8b5b2b;
}

.ghb-cod-input-wrap input,
.ghb-cod-input-wrap textarea {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--ghb-text);
  resize: none;
}

.ghb-cod-section-heading {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ghb-muted);
}

.ghb-cod-section-icon {
  font-size: 0.9rem;
}

.ghb-cod-radio-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ghb-cod-radio-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: #fffaf4;
  border: 1px solid rgba(240, 221, 199, 0.9);
  cursor: pointer;
}

.ghb-cod-radio-item.is-active {
  border-color: rgba(245, 158, 66, 0.9);
  box-shadow: 0 0 0 1px rgba(245, 158, 66, 0.4);
}

.ghb-cod-radio-main {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.83rem;
}

.ghb-cod-radio-circle {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 66, 0.6);
  background: #fff5e6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ghb-cod-radio-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--ghb-primary);
}

.ghb-cod-radio-price {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ghb-text);
}

.ghb-cod-radio-item input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.ghb-cod-note-box textarea {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(240, 221, 199, 0.9);
  background: #fffaf4;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-family: inherit;
}

.ghb-cod-card--summary {
  font-size: 0.82rem;
}

.ghb-cod-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.15rem;
}

.ghb-cod-summary-row--total span:last-child {
  font-weight: 700;
  color: var(--ghb-primary-dark);
}

.ghb-cod-summary-divider {
  margin: 0.25rem 0 0.35rem;
  border-top: 1px dashed rgba(160, 128, 100, 0.45);
}

.ghb-cod-product-title {
  color: var(--ghb-primary-dark);
  font-weight: 600;
  margin: 0 0 0.2rem;
}

.ghb-cod-product-desc {
  color: var(--ghb-muted);
  margin: 0;
}

.ghb-cod-actions {
  margin-top: 0.9rem;
  text-align: center;
}

.ghb-cod-submit {
  width: 100%;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background-image: linear-gradient(90deg, var(--ghb-primary), var(--ghb-primary-dark));
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 12px 26px rgba(245, 158, 66, 0.65);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.ghb-cod-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(245, 158, 66, 0.8);
}

.ghb-cod-submit.loading {
  opacity: 0.8;
  cursor: wait;
}

.ghb-cod-safe-text {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--ghb-muted);
}

.ghb-cod-status {
  margin-top: 0.6rem;
  font-size: 0.78rem;
}

.ghb-cod-status.error {
  color: #dc2626;
}

.ghb-cod-status.success {
  color: #16a34a;
}

/* Trigger button */
.ghb-cod-popup-trigger {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.7rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background-image: linear-gradient(90deg, var(--ghb-primary), var(--ghb-primary-dark));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 12px 28px rgba(245, 158, 66, 0.7);
}

/* ✅ ফর্ম inputs সবসময় flexibly পূর্ণ width নেবে */
.ghb-cod-input-wrap input,
.ghb-cod-input-wrap textarea,
.ghb-cod-note-box textarea {
  width: 100%;
}

/* মোবাইল (<=480px) */
@media (max-width: 480px) {
  .ghb-cod-popup-overlay {
    padding: 0.5rem;
    align-items: flex-start;
  }

  .ghb-cod-popup {
    margin-top: 1.25rem;
    padding: 1.35rem 1rem 1.25rem;
    border-radius: 24px;
    max-width: 100%;
  }

  /* মোবাইলে ইমেজ একটু ছোট */
  .ghb-cod-product-media .ghb-cod-product-image,
  .ghb-cod-product-media img {
    width: 48px;
    height: 48px;
  }

  /* iOS zoom fix: input/textarea font-size >= 16px */
  .ghb-cod-input-wrap input,
  .ghb-cod-input-wrap textarea,
  .ghb-cod-note-box textarea {
    font-size: 16px;
  }

  .ghb-cod-label {
    font-size: 0.8rem;
  }
}

/* ট্যাবলেট (481px–1024px) */
@media (min-width: 481px) and (max-width: 1024px) {
  .ghb-cod-popup-overlay {
    padding: 1.5rem;
  }

  .ghb-cod-popup {
    max-width: 520px;
  }
}

/* বড় ডেস্কটপ (>=1200px) – একটু কম্প্যাক্ট */
@media (min-width: 1200px) {
  .ghb-cod-popup {
    max-width: 500px;
  }
}
