/* Zinu Deals: Day / Weekly homepage sections, deal cards, listing badges, deal admin bits.
   Green stays the dominant brand colour; coral is reserved for the Day flame, the
   validated discount badge and the countdown. */
:root {
  --zd-coral: #e5533d;
  --zd-coral-strong: #c8402c;
  --zd-coral-soft: #fdeeea;
  --zd-coral-line: #f6d3cb;
  --zd-ink: var(--zr-text, #1d2723);
  --zd-muted: var(--zr-muted, #69746f);
  --zd-line: var(--zr-line, #e6e9e7);
  --zd-tile: var(--zr-tile, #f3f4f5);
  --zd-green: var(--zr-green, #56b868);
  --zd-green-text: var(--zr-green-text, #2f8f4e);
  --zd-green-soft: var(--zr-green-soft, #eaf6ec);
}

.zd-section { margin-top: 26px; }
.zd-panel { position: relative; padding: 16px 16px 14px; border: 1px solid var(--zd-coral-line); border-radius: 14px; background: linear-gradient(180deg, #fff8f6 0%, #fff 46%); }
.zd-section--weekly .zd-panel { border-color: #d6ecda; background: linear-gradient(180deg, #f4faf5 0%, #fff 46%); }

.zd-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.zd-head__icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; background: var(--zd-coral-soft); color: var(--zd-coral); }
.zd-head__icon svg { width: 24px; height: 24px; fill: currentColor; }
.zd-section--weekly .zd-head__icon { background: var(--zd-green-soft); color: var(--zd-green-text); }
.zd-section--weekly .zd-head__icon svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; }
.zd-head__copy { min-width: 0; }
.zd-head__copy h2 { margin: 0; color: var(--zd-ink); font-size: 21px; font-weight: 800; line-height: 1.25; }
.zd-head__copy p { margin: 2px 0 0; color: var(--zd-muted); font-size: 13px; line-height: 1.4; }

.zd-countdown { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.zd-countdown__label { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; color: var(--zd-coral-strong); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.zd-countdown__label svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.zd-countdown__unit { display: grid; place-items: center; min-width: 50px; padding: 5px 6px 4px; border: 1px solid var(--zd-coral-line); border-radius: 9px; background: #fff; }
.zd-countdown__unit b { color: var(--zd-coral-strong); font-size: 17px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.zd-countdown__unit small { color: var(--zd-muted); font-size: 10px; line-height: 1.2; }
.zd-week-left { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 6px 11px; border-radius: 999px; background: var(--zd-green-soft); color: var(--zd-green-text); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.zd-week-left svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; }

.zd-strip-wrap { position: relative; }
.zd-strip { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 60px) / 6); gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; padding: 2px 1px 4px; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.zd-strip::-webkit-scrollbar { display: none; }
.zd-nav { position: absolute; z-index: 2; top: 34%; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--zd-line); border-radius: 50%; background: #fff; color: var(--zd-ink); box-shadow: 0 4px 14px rgba(22, 56, 43, .14); cursor: pointer; }
.zd-nav[hidden] { display: none; }
.zd-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.zd-nav--prev { left: -12px; }
.zd-nav--next { right: -12px; }

.zd-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--zd-line); border-radius: 10px; background: #fff; scroll-snap-align: start; transition: border-color .15s ease, box-shadow .15s ease; }
.zd-card:hover { border-color: #cfe3d4; box-shadow: 0 6px 18px rgba(22, 56, 43, .08); }
.zd-card__media { position: relative; display: block; flex: 0 0 auto; min-height: 0; aspect-ratio: 4 / 3; overflow: hidden; background: var(--zd-tile); }
.zd-card__media img { position: absolute; top: 8px; left: 8px; width: calc(100% - 16px); height: calc(100% - 16px); object-fit: contain; }
.zd-badge { position: absolute; top: 7px; left: 7px; padding: 3px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 800; line-height: 1.25; }
.zd-badge--discount { background: var(--zd-coral); color: #fff; }
.zd-badge--wholesale { background: #dcf1e1; color: #23703f; }
.zd-card__body { display: flex; flex: 1; flex-direction: column; gap: 3px; padding: 9px 10px 10px; }
.zd-card__title { display: -webkit-box; overflow: hidden; color: var(--zd-ink); font-size: 13.5px; font-weight: 700; line-height: 1.32; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.zd-card__title:hover { color: var(--zd-green-text); }
.zd-card__supplier { display: inline-flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; color: var(--zd-muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.zd-verified { width: 13px; height: 13px; flex: 0 0 auto; fill: var(--zd-green); }
.zd-card__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 7px; margin-top: 2px; }
.zd-card__price strong { color: var(--zd-ink); font-size: 17px; font-weight: 800; line-height: 1.2; }
.zd-card__price s { color: #98a19c; font-size: 12px; }
.zd-card__tier { color: var(--zd-green-text); font-size: 11.5px; font-weight: 600; }
.zd-card__tier b { font-weight: 800; }
.zd-card__meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 8px; margin-top: auto; padding-top: 4px; color: var(--zd-muted); font-size: 11.5px; line-height: 1.35; }
.zd-card__meta > span { white-space: nowrap; }
.zd-card__stock { display: inline-flex; align-items: center; gap: 4px; color: var(--zd-green-text); font-weight: 600; }
.zd-card__stock svg { width: 14px; height: 14px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.zd-card__rfq { margin-top: 4px; color: var(--zd-green-text); font-size: 11.5px; font-weight: 700; }

/* Listing badges (search / category / supplier cards) and cart markers. */
.z-product-card__deal { position: absolute; top: 8px; right: 8px; padding: 3px 8px; border-radius: 6px; background: var(--zd-coral); color: #fff; font-size: 11px; font-weight: 800; line-height: 1.3; }
.z-product-card__deal--weekly { background: var(--zd-green); }
.z-product-card__was { margin-left: 6px; color: #98a19c; font-size: 12px; font-weight: 500; }
.deal-inline-badge { display: inline-block; padding: 1px 6px; border-radius: 5px; background: var(--zd-coral-soft); color: var(--zd-coral-strong); font-size: 11px; font-style: normal; font-weight: 700; }
.deal-inline-note { display: block; margin-top: 2px; color: var(--zd-coral-strong); font-size: 11.5px; }

/* Product detail deal state. */
.z-offer-card > .zd-offer-deal { grid-column: 1 / -1; grid-row: 1; }
.z-offer-card--deal > .z-offer-form { grid-row: 2 / span 2; }
.zd-offer-deal { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 10px; padding: 9px 12px; border: 1px solid var(--zd-coral-line); border-radius: 10px; background: #fff8f6; color: var(--zd-ink); font-size: 13px; }
.zd-offer-deal--weekly { border-color: #d6ecda; background: #f4faf5; }
.zd-offer-deal__type { padding: 2px 8px; border-radius: 6px; background: var(--zd-coral); color: #fff; font-size: 11.5px; font-weight: 800; }
.zd-offer-deal--weekly .zd-offer-deal__type { background: var(--zd-green); }
.zd-offer-deal strong { font-size: 16px; }
.zd-offer-deal s { color: #98a19c; }
.zd-offer-deal small { color: var(--zd-muted); }

/* Deal status pills (supplier + Control Center). */
.deal-status { display: inline-block; padding: 3px 9px; border-radius: 999px; background: #eef1ef; color: #44514b; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.deal-status--active { background: #dcf1e1; color: #23703f; }
.deal-status--scheduled { background: #e6eefb; color: #2b5394; }
.deal-status--pending { background: #fff3d9; color: #8a5a00; }
.deal-status--paused { background: #f1ece3; color: #6c5a3a; }
.deal-status--rejected, .deal-status--cancelled { background: #fbe7e4; color: #a33a2a; }
.deal-type-pill { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--zd-coral-soft); color: var(--zd-coral-strong); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.deal-type-pill--weekly { background: var(--zd-green-soft); color: var(--zd-green-text); }
.deal-score-bar { position: relative; display: inline-block; width: 70px; height: 7px; overflow: hidden; border-radius: 999px; background: #e9eeea; vertical-align: middle; }
.deal-score-bar > i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--zd-green); }
.deal-component-table td.num, .deal-component-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.deal-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 13px; }
.deal-kv dt { color: var(--zd-muted); }
.deal-kv dd { margin: 0; font-weight: 600; }
.deal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.deal-actions form { margin: 0; }
.deal-warning { margin: 0 0 10px; padding: 9px 12px; border-radius: 9px; background: #fff3d9; color: #6d4b00; font-size: 13px; }
.deal-error { margin: 0 0 10px; padding: 9px 12px; border-radius: 9px; background: #fbe7e4; color: #8f2f22; font-size: 13px; }
.deal-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.deal-form-grid .full { grid-column: 1 / -1; }
.deal-form-grid label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; }
.deal-form-grid .helptext, .deal-form-grid small { color: var(--zd-muted); font-size: 11.5px; font-weight: 400; }
.deal-radio-row { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.deal-radio-row > div { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; }
.deal-radio-row > div > div { display: block; }
.deal-form-grid .deal-radio-row label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.deal-form-grid .deal-radio-row input[type="radio"] { width: 18px; height: 18px; min-height: 0; margin: 0; flex: 0 0 auto; }
.deal-radio-row small { color: var(--zd-muted); font-size: 11.5px; font-weight: 400; line-height: 1.45; }
.control-table td small { line-height: 1.4; }
.deal-td { min-width: 0; }
@media (max-width: 760px) { .deal-td { flex: 1; text-align: right; overflow-wrap: anywhere; } .deal-td small { display: inline; } }
.control-body .control-table td > span.deal-type-pill,
.control-body .control-table td > span.deal-status,
.control-body .control-table td > span.deal-inline-badge { display: inline-block; margin: 0 2px 3px 0; }
.deal-weights { width: 100%; }
.deal-weights input { width: 84px; }
.deal-settings-fieldset { margin: 0 0 14px; padding: 0; border: 0; }
.deal-settings-fieldset legend { margin-bottom: 8px; font-size: 15px; font-weight: 800; }
.deal-settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 14px; }
.deal-settings-grid label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; }
.deal-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 12px; padding-bottom: 2px; scrollbar-width: none; }
.deal-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--zd-line); border-radius: 999px; background: #fff; color: #3c4943; font-size: 13px; font-weight: 700; white-space: nowrap; }
.deal-tabs a.active { border-color: var(--zd-green); background: var(--zd-green-soft); color: var(--zd-green-text); }
.deal-tabs a b { padding: 0 6px; border-radius: 999px; background: #eef1ef; font-size: 11px; }
.deal-offer-thumb { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 8px; background: var(--zd-tile); object-fit: contain; }
.deal-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.deal-cell span { display: grid; min-width: 0; }
.deal-cell small { color: var(--zd-muted); }

@media (max-width: 1023px) {
  .z-offer-card--deal > .z-offer-form { grid-row: auto; }
  .zd-strip { grid-auto-columns: calc((100% - 36px) / 4.3); }
}

@media (max-width: 760px) {
  .zd-section { margin-top: 20px; }
  .zd-panel { padding: 12px 10px 10px; border-radius: 12px; }
  .zd-head { flex-wrap: wrap; gap: 8px 10px; margin-bottom: 10px; }
  .zd-head__icon { width: 34px; height: 34px; border-radius: 10px; }
  .zd-head__icon svg { width: 20px; height: 20px; }
  .zd-head__copy { flex: 1 1 calc(100% - 50px); }
  .zd-head__copy h2 { font-size: 17px; }
  .zd-head__copy p { font-size: 12px; }
  .zd-countdown { width: 100%; margin-left: 0; gap: 5px; }
  .zd-countdown__label { margin-right: auto; font-size: 12px; }
  .zd-countdown__unit { min-width: 44px; padding: 4px 5px 3px; }
  .zd-countdown__unit b { font-size: 15px; }
  .zd-week-left { margin-left: 44px; padding: 5px 10px; font-size: 12px; }
  .zd-strip { grid-auto-columns: minmax(148px, 46%); gap: 8px; }
  .zd-nav { display: none; }
  .zd-card__title { font-size: 13px; }
  .zd-card__price strong { font-size: 16px; }
  .zd-card__body { padding: 8px 9px 9px; }
  .deal-form-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 360px) {
  .zd-head__copy h2 { font-size: 16px; }
  .zd-head__copy p { display: none; }
  .zd-countdown__unit { min-width: 40px; }
  .zd-strip { grid-auto-columns: minmax(140px, 48%); }
}
