/* Premium checkout — AL-AQSA BORKHA HOUSE
   Scoped under .aq-co so legacy .cartlist rules cannot break the summary.
*/
.aq-co {
  --ink: #0b1f3a;
  --ink-soft: #132a4a;
  --accent: #c4a35a;
  --muted: #64748b;
  --line: #e6eaf0;
  --bg: #f7f5f1;
  --card: #ffffff;
  --radius: 14px;
  padding: 28px 0 96px;
  background: var(--bg);
}
.aq-co *,
.aq-co *::before,
.aq-co *::after {
  box-sizing: border-box;
}
.aq-co .container {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}
.aq-co-title {
  font-size: clamp(1.5rem, 2.2vw, 1.85rem);
  color: var(--ink);
  margin: 0 0 6px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.aq-co-sub {
  color: var(--muted);
  margin: 0 0 22px;
  font-size: 0.95rem;
}
.aq-co-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: start;
}
.aq-co-main,
.aq-co-aside {
  min-width: 0;
}
.aq-co-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: 0 1px 2px rgba(11, 31, 58, 0.04);
}
.aq-co-card + .aq-co-card {
  margin-top: 16px;
}
.aq-co-card h3 {
  margin: 0 0 16px;
  font-size: 0.8rem;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.aq-co-field {
  margin-bottom: 14px;
}
.aq-co-field:last-child {
  margin-bottom: 0;
}
.aq-co-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
  line-height: 1.3;
}
.aq-co-field input,
.aq-co-field select,
.aq-co-field textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px; /* avoid iOS zoom */
  line-height: 1.4;
  background: #fff;
  min-height: 48px;
  color: var(--ink);
}
.aq-co-field textarea {
  min-height: 96px;
  resize: vertical;
}
.aq-co-field input:focus,
.aq-co-field select:focus,
.aq-co-field textarea:focus {
  outline: 2px solid rgba(11, 31, 58, 0.2);
  border-color: var(--ink);
}

/* Payment */
.aq-pay-list {
  display: grid;
  gap: 10px;
}
.aq-pay-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  background: #fafafa;
  min-height: 52px;
  margin: 0;
}
.aq-pay-opt span {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  /* NEVER inherit legacy .cartlist span sizing */
  width: auto !important;
  height: auto !important;
  border-radius: 0 !important;
}
.aq-pay-opt.active {
  border-color: var(--accent);
  background: #fffdf8;
  box-shadow: inset 0 0 0 1px rgba(196, 163, 90, 0.35);
}
.aq-pay-opt input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
}
.aq-pay-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
  display: none;
  line-height: 1.4;
}
.aq-pay-hint.show {
  display: block;
}

/* Order summary — sticky on desktop */
.aq-co-summary {
  position: sticky;
  top: 88px;
}
.aq-co-summary .aq-co-card {
  padding: 18px 16px 16px;
}

/* Product rows: image | details | line total — no overlap */
.aq-sum-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 0 8px;
}
.aq-sum-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px 14px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.aq-sum-item:first-child {
  padding-top: 6px;
}
.aq-sum-item:last-of-type {
  border-bottom: 0;
  margin-bottom: 6px;
  padding-bottom: 16px;
}
.aq-sum-item img,
.aq-sum-thumb {
  width: 72px;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f1f5f9;
  display: block;
}
.aq-sum-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}
.aq-sum-meta strong,
.aq-sum-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  margin: 0;
  /* clamp long names instead of overlapping */
  overflow-wrap: anywhere;
  word-break: break-word;
}
.aq-sum-meta span,
.aq-sum-var,
.aq-sum-qty {
  display: block;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  border-radius: 0 !important;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  margin: 0;
  white-space: normal;
}
.aq-sum-line {
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  white-space: nowrap;
  padding-top: 1px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.aq-sum-unit {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 0;
  white-space: nowrap;
}

.aq-sum-rows {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.aq-sum-rows > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 7px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}
.aq-sum-rows > div span:last-child {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  width: auto !important;
  height: auto !important;
  border-radius: 0 !important;
}
.aq-sum-rows .grand {
  color: var(--ink);
  font-weight: 700;
  font-size: 1.125rem;
  border-top: 2px solid var(--ink);
  margin-top: 6px;
  padding-top: 12px;
}

.aq-place {
  width: 100%;
  border: 0;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 15px 18px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-top: 16px;
  cursor: pointer;
  min-height: 52px;
}
.aq-place:hover {
  background: var(--ink-soft);
}
.aq-co-empty {
  padding: 18px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.aq-sticky-bar {
  display: none;
}

/* Delivery picker spacing inside checkout */
.aq-co .aq-loc {
  margin: 4px 0 8px;
}
.aq-co .aq-loc-trigger {
  min-height: 48px;
}

@media (max-width: 1024px) {
  .aq-co-grid {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr);
    gap: 18px;
  }
}

@media (max-width: 900px) {
  .aq-co-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .aq-co-summary {
    position: static;
    top: auto;
  }
  /* On mobile: show order summary first for clarity */
  .aq-co-aside {
    order: -1;
  }
  .aq-sticky-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: 0 -8px 24px rgba(11, 31, 58, 0.1);
  }
  .aq-sticky-bar > div {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.3;
    min-width: 0;
    flex: 1 1 auto;
  }
  .aq-sticky-bar strong {
    display: block;
    color: var(--ink);
    font-size: 1.05rem;
  }
  .aq-sticky-bar .aq-place {
    margin: 0;
    width: auto;
    flex: 0 0 auto;
    padding: 12px 16px;
    min-height: 48px;
    white-space: nowrap;
    font-size: 15px;
    max-width: 55%;
  }
  .aq-co {
    padding-bottom: 110px;
  }
  .aq-co .d-md-block {
    display: none !important;
  }
}

@media (max-width: 414px) {
  .aq-sum-item {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px 0;
  }
  .aq-sum-item img,
  .aq-sum-thumb {
    width: 64px;
    height: 78px;
  }
  .aq-sum-name {
    font-size: 13px;
  }
  .aq-co-card {
    padding: 16px 14px;
  }
}

@media (max-width: 360px) {
  .aq-sum-item {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
  }
  .aq-sum-line {
    grid-column: 2;
    text-align: left;
    padding-top: 0;
    align-items: flex-start;
  }
  .aq-sum-item img,
  .aq-sum-thumb {
    width: 56px;
    height: 70px;
  }
  .aq-sticky-bar .aq-place {
    padding: 12px 12px;
    font-size: 14px;
    max-width: 48%;
  }
}

/* Kill any leaked legacy cartlist rules if class is still present */
.aq-co .cartlist span,
.aq-co-summary span,
.aq-sum-item span {
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  border-radius: 0 !important;
}
.aq-co .cartlist img,
.aq-sum-item img {
  width: 72px !important;
  height: 88px !important;
  max-width: none;
}
@media (max-width: 414px) {
  .aq-co .cartlist img,
  .aq-sum-item img {
    width: 64px !important;
    height: 78px !important;
  }
}
