/* Cart, checkout and payment pages */

.section-tight {
  padding-top: 2rem;
}

.center {
  text-align: center;
}

.empty-cart {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

.empty-cart img {
  margin: 0 auto 1rem;
  transform: rotate(-8deg);
}

.empty-cart .hero-actions {
  justify-content: center;
}

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .cart-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.cart-items {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: grid;
  gap: 1rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  background: var(--white);
  border: var(--outline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
}

.cart-item .thumb {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-sm);
  background: #eef3f8;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.cart-item .thumb img {
  max-width: 88%;
  max-height: 88%;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}

.cart-item .thumb img.photo {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none;
}

.cart-item h3 {
  font-size: 1.2rem;
  margin: 0 0 0.2rem;
}

.cart-item .details {
  margin: 0 0 0.6rem;
  font-size: 0.93rem;
  color: var(--ink-soft);
}

.cart-item .details .file {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.colour-dot {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  vertical-align: -0.1em;
}

.cart-item .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}

.cart-item .qty {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cart-item .qty input {
  width: 4.5rem;
  text-align: center;
  padding: 0.3rem;
}

.cart-item .qty button {
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 1.1rem;
}

.cart-item .price {
  text-align: right;
  white-space: nowrap;
}

.cart-item .price strong {
  display: block;
  font-size: 1.15rem;
}

.cart-item .price span {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

@media (max-width: 560px) {
  .cart-item {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .cart-item .thumb {
    width: 72px;
    height: 72px;
  }

  .cart-item .price {
    grid-column: 2;
    text-align: left;
  }
}

.checkout {
  position: sticky;
  top: 84px;
}

@media (max-width: 900px) {
  .checkout {
    position: static;
  }
}

.checkout h2 {
  font-size: 1.7rem;
}

.checkout fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
}

.checkout legend {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.delivery-options {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.delivery-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: start;
  border: var(--outline);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  cursor: pointer;
}

.delivery-option:has(input:checked) {
  background: var(--blue);
}

.delivery-option input {
  margin-top: 0.3rem;
  accent-color: var(--ink);
}

.delivery-option strong {
  display: block;
}

.delivery-option small {
  color: var(--ink-soft);
}

.totals {
  margin: 1.25rem 0;
  border-top: 2px dashed rgba(27, 20, 73, 0.2);
  padding-top: 0.75rem;
}

.totals div {
  display: flex;
  justify-content: space-between;
  padding: 0.15rem 0;
}

.totals dd {
  margin: 0;
  font-weight: 700;
}

.totals .grand {
  font-family: var(--font-display);
  font-size: 1.6rem;
}

.checkout .checkbox {
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.checkout-submit {
  width: 100%;
  margin-top: 0.5rem;
}

#checkout-progress {
  margin: 0.75rem 0 0;
}

/* ---------- Payment page ---------- */

.pay-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

@media (max-width: 800px) {
  .pay-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.pay-card {
  text-align: center;
}

.qr {
  width: min(100%, 300px);
  height: auto;
  margin: 0 auto 1rem;
  display: block;
  border-radius: var(--radius-sm);
}

.pay-steps,
.next-steps {
  text-align: left;
  padding-left: 1.25rem;
  margin: 1.25rem 0;
}

.pay-steps li,
.next-steps li {
  margin-bottom: 0.5rem;
}

.manual-pay {
  text-align: left;
  border: var(--outline);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
}

.manual-pay summary {
  cursor: pointer;
  font-weight: 800;
}

.manual-pay dl {
  margin: 0.75rem 0 0;
}

.manual-pay dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.2rem 0;
}

.manual-pay dt {
  font-weight: 700;
}

.manual-pay dd {
  margin: 0;
}

code {
  font-size: 1em;
  background: var(--cream);
  border-radius: 6px;
  padding: 0.05rem 0.35rem;
}

.order-summary {
  padding-left: 1.25rem;
}

/* ---------- Payment step ---------- */

.payment-step {
  text-align: center;
}

.payment-step h3 {
  margin-top: 1.5rem;
}

.payment-ref {
  margin-bottom: 0.75rem;
}

.timer {
  display: inline-block;
  background: var(--cream);
  border: var(--outline);
  border-radius: 999px;
  padding: 0.25rem 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.timer strong {
  font-variant-numeric: tabular-nums;
  font-size: 1.15rem;
}

.payment-step .pay-steps,
.payment-step .manual-pay,
.payment-step .notice {
  text-align: left;
}

.upload {
  display: grid;
  place-items: center;
  gap: 0.75rem;
  border: 3px dashed var(--ink);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  cursor: pointer;
  background: var(--cream-soft);
  margin-bottom: 1rem;
}

.upload:hover,
.upload:focus-within {
  background: var(--blue);
}

.upload img {
  max-height: 260px;
  width: auto;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}

.paying .cart-item .actions,
.paying .add-another {
  display: none;
}

.google-account {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0.6rem 0.8rem;
  border: var(--outline);
  border-radius: var(--radius-sm);
  background: var(--blue);
}

#google-signin {
  display: grid;
  gap: 0.4rem;
}

#google-button {
  min-height: 44px;
}

/* ---------- Order status ---------- */

.order-status {
  font-weight: 800;
  font-size: 1.15rem;
  border: var(--outline);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  background: var(--warn-soft);
}

.order-status[data-status='paid'] {
  background: #dcf5e3;
}

.order-status[data-status='payment_rejected'] {
  background: var(--danger-soft);
}

.signin {
  margin-bottom: 1.25rem;
}

.signin #google-signin p {
  margin-bottom: 0.75rem;
}

#signin-error .notice {
  margin: 0.75rem 0 0;
}

/* ---------- My orders ---------- */

.signin-card {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 0.75rem;
}

.signin-card p {
  margin: 0;
}

.account-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1.5rem;
}

.order-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.25rem;
}

.order-card header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.order-card h2 {
  font-size: 1.3rem;
  margin: 0;
}

.order-meta {
  margin: 0.25rem 0 1rem;
}

.status-pill {
  font-size: 0.85rem;
  font-weight: 800;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.1rem 0.7rem;
  background: var(--warn-soft);
}

.status-pill[data-status='paid'] {
  background: var(--blue);
}

.status-pill[data-status='completed'] {
  background: #dcf5e3;
}

.status-pill[data-status='payment_rejected'] {
  background: var(--danger-soft);
}

.order-items {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: grid;
  gap: 0.75rem;
}

.order-items li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.order-items .thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  background: #eef3f8;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.order-items .thumb img {
  max-width: 88%;
  max-height: 88%;
  object-fit: contain;
}

.order-items .thumb img.photo {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
}

.order-items .thumb img:not([src]) {
  display: none;
}

@media (max-width: 560px) {
  .order-items li {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .order-items li .button {
    grid-column: 2;
    justify-self: start;
  }
}

.files-note {
  margin: 0 0 0.5rem;
}
