/* =====================================================================
   Shop flow styles — Cart, Checkout, Order Complete
   Scoped under .zc-shop so nothing leaks into the rest of the site.
   ===================================================================== */

.zc-shop {
  /* Logo colours: blue #171C8F, red #E40D0D */
  --zc-brand: #171c8f;
  --zc-brand-dark: #10136b;
  --zc-brand-soft: #eceefb;
  --zc-accent: #e40d0d;
  --zc-accent-dark: #c10b0b;
  --zc-accent-soft: #fdecec;
  --zc-ink: #16202a;
  --zc-muted: #64707d;
  --zc-line: #e4e8ec;
  --zc-bg: #f5f7f8;
  --zc-card: #ffffff;
  --zc-danger: #c62828;
  --zc-success: #1b8a4b;
  --zc-radius: 14px;
  --zc-radius-sm: 10px;
  --zc-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);

  background: var(--zc-bg);
  color: var(--zc-ink);
  font-family: "Poppins", sans-serif;
  padding: 120px 0 80px;
  min-height: 70vh;
}

.zc-shop *,
.zc-shop *::before,
.zc-shop *::after { box-sizing: border-box; }

.zc-shop a { color: var(--zc-brand); text-decoration: none; }
.zc-shop a:hover { color: var(--zc-brand-dark); }

/* ---------- Page title (site standard style) ---------- */
.zc-shop .page-title-area { margin-bottom: 30px; }
.zc-shop .page-title-content h1 { margin: 0; font-size: 25px; font-weight: 700; }
.zc-shop .page-title-content ul li a { color: inherit; }

/* ---------- Layout ---------- */
.zc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  align-items: start;
}
.zc-sticky { position: sticky; top: 110px; }

/* ---------- Cards ---------- */
.zc-card {
  background: var(--zc-card);
  border: 1px solid var(--zc-line);
  border-radius: var(--zc-radius);
  box-shadow: var(--zc-shadow);
}
.zc-card-pad { padding: 24px; }
.zc-card-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 600; margin: 0 0 18px;
}
.zc-card-title .zc-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--zc-brand-soft); color: var(--zc-brand);
  font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Buttons ---------- */
.zc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; border-radius: var(--zc-radius-sm);
  font-weight: 600; font-size: 15px; line-height: 1;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .1s;
}
.zc-btn:active { transform: translateY(1px); }
.zc-btn-primary { background: var(--zc-accent); color: #fff !important; }
.zc-btn-primary:hover { background: var(--zc-accent-dark); }
.zc-btn-primary:disabled { opacity: .7; cursor: wait; }
.zc-btn-ghost { background: #fff; color: var(--zc-ink) !important; border-color: var(--zc-line); }
.zc-btn-ghost:hover { border-color: var(--zc-brand); color: var(--zc-brand) !important; }
.zc-btn-block { width: 100%; }

/* ---------- Cart items ---------- */
.zc-cart-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px; border-bottom: 1px solid var(--zc-line);
}
.zc-cart-head h2 { font-size: 17px; font-weight: 600; margin: 0; }
.zc-cart-head span { color: var(--zc-muted); font-size: 14px; }

.zc-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto auto;
  gap: 20px;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--zc-line);
}
.zc-item:last-child { border-bottom: 0; }
.zc-item-img {
  width: 96px; height: 96px; border-radius: var(--zc-radius-sm);
  background: var(--zc-bg); border: 1px solid var(--zc-line);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.zc-item-img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.zc-item-name { font-weight: 600; font-size: 16px; color: var(--zc-ink) !important; display: block; margin-bottom: 4px; }
.zc-item-name:hover { color: var(--zc-brand) !important; }
.zc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.zc-tag {
  font-size: 12px; font-weight: 500; color: var(--zc-brand);
  background: var(--zc-brand-soft); border-radius: 999px; padding: 3px 10px;
}
.zc-item-unit { font-size: 13px; color: var(--zc-muted); }
.zc-item-total { font-weight: 700; font-size: 16px; text-align: right; min-width: 110px; }
.zc-remove {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--zc-muted) !important; margin-top: 8px;
}
.zc-remove:hover { color: var(--zc-danger) !important; }

/* Quantity stepper */
.zc-qty {
  display: inline-flex; align-items: center;
  border: 1px solid var(--zc-line); border-radius: 999px; background: #fff;
  height: 40px;
}
.zc-qty form { margin: 0; display: flex; }
.zc-qty a,
.zc-qty button {
  width: 40px; height: 38px; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--zc-ink) !important; font-size: 13px; cursor: pointer; border-radius: 999px;
}
.zc-qty a:hover,
.zc-qty button:hover { background: var(--zc-brand-soft); color: var(--zc-brand) !important; }
.zc-qty-val { min-width: 32px; text-align: center; font-weight: 600; font-size: 15px; }

/* ---------- Summary ---------- */
.zc-summary-rows { list-style: none; padding: 0; margin: 0; }
.zc-summary-rows li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; font-size: 15px; color: var(--zc-muted);
}
.zc-summary-rows li span:last-child { color: var(--zc-ink); font-weight: 500; }
.zc-summary-rows li.is-discount span:last-child { color: var(--zc-success); }
.zc-summary-rows li.is-total {
  border-top: 1px dashed var(--zc-line); margin-top: 8px; padding-top: 16px;
  font-size: 18px; color: var(--zc-ink); font-weight: 700;
}
.zc-summary-rows li.is-total span:last-child { font-weight: 700; }
.zc-free { color: var(--zc-success) !important; font-weight: 600 !important; }

.zc-ship-bar {
  background: var(--zc-brand-soft); border-radius: var(--zc-radius-sm);
  padding: 12px 14px; margin-bottom: 18px; font-size: 13px; color: var(--zc-brand-dark);
}
.zc-ship-bar .zc-track { height: 6px; background: rgba(23, 28, 143, .15); border-radius: 999px; margin-top: 8px; overflow: hidden; }
.zc-ship-bar .zc-fill { height: 100%; background: var(--zc-accent); border-radius: 999px; }

.zc-trust {
  display: grid; gap: 10px; margin-top: 18px; padding-top: 18px;
  border-top: 1px solid var(--zc-line);
  list-style: none; padding-left: 0;
}
.zc-trust li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--zc-muted); }
.zc-trust i { color: var(--zc-brand); font-size: 16px; width: 18px; text-align: center; }

/* ---------- Empty state ---------- */
.zc-empty { text-align: center; padding: 64px 24px; }
.zc-empty-icon {
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--zc-brand-soft); color: var(--zc-brand);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 34px; margin-bottom: 20px;
}
.zc-empty h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.zc-empty p { color: var(--zc-muted); margin-bottom: 24px; }

/* ---------- Forms ---------- */
.zc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.zc-grid .zc-full { grid-column: 1 / -1; }
.zc-field label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--zc-ink); margin-bottom: 6px;
}
.zc-field label .req { color: var(--zc-danger); }
.zc-field input,
.zc-field select,
.zc-field textarea {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1px solid #d3d9df; border-radius: var(--zc-radius-sm);
  background: #fff; color: var(--zc-ink); font-size: 15px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.zc-field 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='none' stroke='%2364707d' stroke-width='1.6' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
.zc-field textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.zc-field input:focus,
.zc-field select:focus,
.zc-field textarea:focus {
  outline: none; border-color: var(--zc-brand);
  box-shadow: 0 0 0 3px rgba(23, 28, 143, .15);
}
.zc-field input.is-invalid { border-color: var(--zc-danger); }
.zc-field input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(198, 40, 40, .12); }
.zc-err { display: none; color: var(--zc-danger); font-size: 12px; margin-top: 5px; }
.zc-input-icon { position: relative; }
.zc-input-icon input { padding-right: 44px; }
.zc-input-icon i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--zc-muted); }

.zc-stack > * + * { margin-top: 20px; }

/* Payment tiles */
.zc-pay-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.zc-pay-option { position: relative; margin: 0; cursor: pointer; }
.zc-pay-option input { position: absolute; opacity: 0; pointer-events: none; }
.zc-pay-option .zc-pay-box {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--zc-line); border-radius: var(--zc-radius-sm);
  padding: 14px 16px; background: #fff; transition: border-color .15s, background-color .15s;
  font-weight: 500; font-size: 15px;
}
.zc-pay-option .zc-radio {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid #c4ccd4; flex-shrink: 0;
  position: relative;
}
.zc-pay-option .zc-pay-icons { margin-left: auto; display: flex; gap: 6px; font-size: 22px; color: var(--zc-muted); }
.zc-pay-option input:checked + .zc-pay-box { border-color: var(--zc-accent); background: var(--zc-accent-soft); }
.zc-pay-option input:checked + .zc-pay-box .zc-radio { border-color: var(--zc-accent); }
.zc-pay-option input:checked + .zc-pay-box .zc-radio::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--zc-accent);
}
.zc-pay-option input:focus-visible + .zc-pay-box { box-shadow: 0 0 0 3px rgba(23, 28, 143, .2); }
.zc-pay-panel { background: var(--zc-bg); border-radius: var(--zc-radius-sm); padding: 18px; }


.zc-alert {
  background: #fdecea; color: #8e1c1c; border: 1px solid #f5c2c0;
  border-radius: var(--zc-radius-sm); padding: 14px 18px; margin-bottom: 20px; font-size: 14px;
  display: flex; gap: 10px; align-items: flex-start;
}

.zc-secure-note {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 12px; color: var(--zc-muted); margin-top: 12px;
}

/* Checkout summary items */
.zc-mini-items { list-style: none; padding: 0; margin: 0 0 18px; }
.zc-mini-item { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--zc-line); }
.zc-mini-item:first-child { padding-top: 0; }
.zc-mini-img {
  position: relative; width: 60px; height: 60px; flex-shrink: 0;
  border-radius: var(--zc-radius-sm); background: var(--zc-bg); border: 1px solid var(--zc-line);
}
.zc-mini-img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; border-radius: inherit; }
.zc-mini-badge {
  position: absolute; top: -8px; right: -8px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--zc-ink); color: #fff;
  font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}
.zc-mini-info { flex: 1; min-width: 0; }
.zc-mini-info a { color: var(--zc-ink) !important; font-weight: 600; font-size: 14px; display: block; }
.zc-mini-info small { color: var(--zc-muted); font-size: 12px; }
.zc-mini-price { font-weight: 600; font-size: 14px; white-space: nowrap; }

.zc-promo { display: flex; gap: 8px; }
.zc-promo input { flex: 1; min-width: 0; text-transform: uppercase; }
.zc-promo input::placeholder { text-transform: none; }
.zc-promo .zc-btn { padding: 0 18px; height: 48px; }
.zc-promo-msg { display: none; font-size: 13px; margin-top: 8px; }
.zc-promo-msg.is-ok { color: var(--zc-success); }
.zc-promo-msg.is-bad { color: var(--zc-danger); }
.zc-link-btn { background: none; border: 0; padding: 0; margin-top: 6px; font-size: 13px; color: var(--zc-danger); cursor: pointer; text-decoration: underline; }
.zc-divider { height: 1px; background: var(--zc-line); margin: 18px 0; }

/* Mobile summary toggle (checkout) */
.zc-summary-toggle {
  display: none; width: 100%; background: #fff; border: 0; padding: 16px 20px;
  align-items: center; justify-content: space-between; font-size: 15px; font-weight: 500;
  color: var(--zc-brand); cursor: pointer; border-radius: var(--zc-radius);
}
.zc-summary-toggle .zc-chev { transition: transform .2s; margin-left: 6px; }
.zc-summary-toggle[aria-expanded="true"] .zc-chev { transform: rotate(180deg); }
.zc-summary-toggle strong { color: var(--zc-ink); font-size: 16px; white-space: nowrap; }
.zc-summary-toggle > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* Order loader */
#order-loader {
  position: fixed; inset: 0; z-index: 999999;
  background: rgba(255, 255, 255, .97);
  display: none; align-items: center; justify-content: center; text-align: center; padding: 24px;
}
#order-loader .zc-spinner {
  width: 64px; height: 64px; margin: 0 auto 22px;
  border: 5px solid #eceefb; border-top-color: #e40d0d;
  border-radius: 50%; animation: zc-spin .8s linear infinite;
}
#order-loader h3 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
#order-loader p { color: #64707d; margin: 0 0 4px; font-size: 14px; }
@keyframes zc-spin { to { transform: rotate(360deg); } }

/* ---------- Order complete ---------- */
.zc-success-hero { text-align: center; padding: 40px 24px 32px; }
.zc-check {
  width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 20px;
  background: var(--zc-success); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 38px;
  box-shadow: 0 0 0 10px rgba(27, 138, 75, .12);
  animation: zc-pop .5s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes zc-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.zc-success-hero h1 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 700; margin-bottom: 8px; }
.zc-success-hero p { color: var(--zc-muted); max-width: 560px; margin: 0 auto; font-size: 15px; line-height: 1.6; }
.zc-success-hero p strong { color: var(--zc-ink); }

.zc-meta {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--zc-line);
}
.zc-meta > div { padding: 18px 20px; border-right: 1px solid var(--zc-line); }
.zc-meta > div:last-child { border-right: 0; }
.zc-meta small { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--zc-muted); margin-bottom: 4px; }
.zc-meta strong { font-size: 15px; word-break: break-word; }
.zc-status {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff4e0; color: #9a5b00; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 600;
}
.zc-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #e59400; }

.zc-timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.zc-timeline li { position: relative; padding: 0 0 22px 40px; }
.zc-timeline li:last-child { padding-bottom: 0; }
.zc-timeline li::before {
  content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--zc-line);
}
.zc-timeline li:last-child::before { display: none; }
.zc-timeline .zc-tl-dot {
  position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 2px solid var(--zc-line); color: var(--zc-muted);
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.zc-timeline li.is-done .zc-tl-dot { background: var(--zc-success); border-color: var(--zc-success); color: #fff; }
.zc-timeline li.is-now .zc-tl-dot { border-color: #e59400; color: #e59400; }
.zc-timeline h4 { font-size: 15px; font-weight: 600; margin: 3px 0 2px; }
.zc-timeline p { font-size: 13px; color: var(--zc-muted); margin: 0; }

.zc-account-note {
  display: inline-flex; align-items: flex-start; gap: 10px; text-align: left;
  margin-top: 18px; padding: 12px 16px; border-radius: var(--zc-radius-sm);
  background: var(--zc-brand-soft); color: var(--zc-brand-dark); font-size: 14px; max-width: 560px;
}
.zc-account-note i { margin-top: 3px; }

.zc-address { font-style: normal; font-size: 14px; line-height: 1.7; color: var(--zc-muted); margin: 0; }
.zc-address strong { color: var(--zc-ink); }
.zc-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .zc-shop { padding: 100px 0 60px; }
  .zc-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .zc-sticky { position: static; }
  .zc-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zc-meta > div:nth-child(2) { border-right: 0; }
  .zc-meta > div:nth-child(-n+2) { border-bottom: 1px solid var(--zc-line); }

  /* checkout: summary first + collapsible */
  .zc-checkout .zc-col-summary { order: -1; }
  .zc-summary-toggle { display: flex; }
  .zc-checkout .zc-summary-card { overflow: hidden; }
  .zc-checkout .zc-summary-body { display: none; border-top: 1px solid var(--zc-line); }
  .zc-checkout .zc-summary-body.is-open { display: block; }
  .zc-checkout .zc-summary-heading { display: none; }
}

@media (max-width: 767.98px) {
  .zc-card-pad { padding: 18px; }
  .zc-cart-head { padding: 16px 18px; }
  .zc-item {
    grid-template-columns: 76px minmax(0, 1fr);
    grid-template-areas: "img info" "img qty";
    gap: 10px 14px;
    padding: 16px 18px;
    align-items: start;
  }
  .zc-item-img { grid-area: img; width: 76px; height: 76px; }
  .zc-item-info { grid-area: info; }
  .zc-item-qty { grid-area: qty; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .zc-item-total { min-width: 0; font-size: 15px; }
  .zc-item-total-desktop { display: none; }
  .zc-shop .page-title-area { padding-top: 22px; padding-bottom: 20px; margin-bottom: 20px; }
  .zc-shop .page-title-content h1 { font-size: 22px; }
  .zc-shop .page-title-content ul { position: static; transform: none; text-align: left; margin-top: 6px; font-size: 14px; }
}

@media (min-width: 768px) {
  .zc-item-total-mobile { display: none; }
}

@media (max-width: 575.98px) {
  .zc-shop { padding: 90px 0 48px; }
  .zc-shop .container { padding-left: 16px; padding-right: 16px; }
  .zc-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .zc-grid .zc-half-sm { grid-column: auto; }
  .zc-grid-2sm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zc-pay-options { grid-template-columns: minmax(0, 1fr); }
  .zc-meta > div { padding: 14px 16px; }
  .zc-meta strong { font-size: 14px; }
  .zc-actions .zc-btn { width: 100%; }
  .zc-success-hero { padding: 32px 18px 24px; }
  .zc-field input, .zc-field select, .zc-field textarea { font-size: 16px; } /* prevent iOS zoom */
}

/* ---------- Print (order complete) ---------- */
@media print {
  header, footer, .header, .footer, .zc-actions, .page-title-area, #order-loader { display: none !important; }
  .zc-shop { padding: 0; background: #fff; }
  .zc-card { box-shadow: none; }
  .zc-layout { grid-template-columns: 1fr; }
}
