/*
 * PowerPragya — Cart Checkout
 * Dedicated responsive stylesheet. Loaded after the site-wide and header styles.
 * This stylesheet only targets the multi-product checkout route (?cart=1).
 */
body:has(.cart-order-grid) {
  --checkout-purple: #642bb0;
  --checkout-purple-dark: #35104f;
  --checkout-ink: #21172d;
  --checkout-muted: #777084;
  --checkout-line: #ece5f3;
  --checkout-soft: #faf7fd;
  background: #f8f6fb;
}

body:has(.cart-order-grid) .order-section {
  padding: 42px 0 76px !important;
  background:
    radial-gradient(ellipse at 12% 8%, rgba(111, 54, 184, .075), transparent 32%),
    linear-gradient(180deg, #fbf9fd 0%, #f6f2fa 100%) !important;
}

body:has(.cart-order-grid) .order-section > .cart-order-grid {
  box-sizing: border-box;
  display: grid !important;
  grid-template-columns: minmax(285px, 350px) minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 26px !important;
  width: min(1180px, calc(100% - 48px)) !important;
  max-width: 1180px !important;
  margin-inline: auto !important;
}

/* The two cards must be siblings in the grid. */
body:has(.cart-order-grid) .cart-order-grid > .order-summary {
  grid-column: 1;
  grid-row: 1;
  position: sticky !important;
  top: 112px !important;
  align-self: start;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  box-sizing: border-box;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid rgba(91, 43, 145, .13) !important;
  border-radius: 22px !important;
  background: #fff !important;
  box-shadow: 0 16px 42px rgba(42, 19, 65, .075) !important;
}

body:has(.cart-order-grid) .cart-checkout-summary {
  box-sizing: border-box;
  width: 100%;
  padding: 25px 24px 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
}

body:has(.cart-order-grid) .cart-checkout-summary > .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #8b36c6;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.8px;
}

body:has(.cart-order-grid) .cart-checkout-summary h2 {
  margin: 3px 0 12px !important;
  color: var(--checkout-ink);
  font-size: 21px !important;
  font-weight: 800;
  letter-spacing: -.55px;
}

body:has(.cart-order-grid) #ppCheckoutItems > div {
  display: flex !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 15px 0 !important;
  border-bottom: 1px solid var(--checkout-line) !important;
}

body:has(.cart-order-grid) #ppCheckoutItems > div > div {
  min-width: 0;
}

body:has(.cart-order-grid) #ppCheckoutItems > div > div > strong {
  display: block;
  color: var(--checkout-ink);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

body:has(.cart-order-grid) #ppCheckoutItems > div > strong {
  flex: 0 0 auto;
  color: var(--checkout-purple);
  font-size: 12px;
  white-space: nowrap;
}

body:has(.cart-order-grid) #ppCheckoutItems .pp-cart-qty,
body:has(.cart-order-grid) #ppCheckoutItems .pp-cart-remove {
  min-width: 29px;
  height: 29px;
  padding: 0 8px;
  border: 1px solid #e8def1;
  border-radius: 8px;
  background: #faf7fd;
  color: var(--checkout-purple);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

body:has(.cart-order-grid) #ppCheckoutItems .pp-cart-qty:hover {
  border-color: #cdb4e4;
  background: #f2eafa;
}

body:has(.cart-order-grid) #ppCheckoutItems .pp-cart-remove {
  padding-inline: 10px;
  border-color: #f1dada;
  background: #fff8f8;
  color: #b42335;
  font-size: 10px;
}

body:has(.cart-order-grid) .cart-checkout-summary .summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 -24px;
  padding: 19px 24px 22px;
  border-top: 1px solid var(--checkout-line);
  background: #faf7fd;
}

body:has(.cart-order-grid) .cart-checkout-summary .summary-row span {
  color: #6c6277;
  font-size: 12px;
  font-weight: 700;
}

body:has(.cart-order-grid) .cart-checkout-summary .summary-row strong {
  color: var(--checkout-purple);
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -.7px;
}

/* Main checkout form */
body:has(.cart-order-grid) .cart-order-grid > #orderForm.form-card {
  grid-column: 2;
  grid-row: 1;
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 32px 34px !important;
  box-sizing: border-box;
  border: 1px solid rgba(91, 43, 145, .12) !important;
  border-radius: 22px !important;
  background: #fff !important;
  box-shadow: 0 16px 42px rgba(42, 19, 65, .065) !important;
}

body:has(.cart-order-grid) #orderForm .form-section {
  min-width: 0;
  margin: 0 0 25px !important;
  padding: 2px 0 25px !important;
  border-bottom: 1px solid var(--checkout-line) !important;
}

body:has(.cart-order-grid) #orderForm .form-section:last-of-type {
  margin-bottom: 18px !important;
}

body:has(.cart-order-grid) #orderForm .form-head {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 20px !important;
}

body:has(.cart-order-grid) #orderForm .form-head > span {
  display: inline-flex;
  flex: 0 0 35px;
  width: 35px;
  height: 35px;
  align-items: center;
  justify-content: center;
  border: 1px solid #eadcf6;
  border-radius: 11px;
  background: linear-gradient(145deg, #f5eafd, #eee2f8);
  color: var(--checkout-purple);
  font-size: 11px;
  font-weight: 900;
}

body:has(.cart-order-grid) #orderForm .form-head h3 {
  margin: 1px 0 4px;
  color: var(--checkout-ink);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -.4px;
}

body:has(.cart-order-grid) #orderForm .form-head p {
  margin: 0;
  color: var(--checkout-muted);
  font-size: 11px;
  line-height: 1.6;
}

body:has(.cart-order-grid) #orderForm .inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

body:has(.cart-order-grid) #orderForm .form-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 17px 18px !important;
  margin-bottom: 18px;
}

body:has(.cart-order-grid) #orderForm .form-grid > label {
  display: block;
  min-width: 0;
  color: #554b60;
  font-size: 11px;
  font-weight: 750;
}

body:has(.cart-order-grid) #orderForm .form-grid > label > span {
  display: block;
  margin-bottom: 7px;
  line-height: 1.55;
}

body:has(.cart-order-grid) #orderForm .form-grid label small {
  color: #887d91;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
}

body:has(.cart-order-grid) #orderForm .form-grid .full {
  grid-column: 1 / -1 !important;
}

body:has(.cart-order-grid) #orderForm input:not([type="hidden"]),
body:has(.cart-order-grid) #orderForm textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 47px;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid #e4dbea;
  border-radius: 11px;
  outline: none;
  background: #fdfcff;
  color: var(--checkout-ink);
  font: inherit;
  font-size: 13px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

body:has(.cart-order-grid) #orderForm textarea {
  min-height: 112px;
  resize: vertical;
}

body:has(.cart-order-grid) #orderForm input:focus,
body:has(.cart-order-grid) #orderForm textarea:focus {
  border-color: #9b6ac8;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(100, 43, 176, .09);
}

body:has(.cart-order-grid) #orderForm .btn {
  min-height: 45px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 800;
}

body:has(.cart-order-grid) #orderForm .submit-order {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
  border-radius: 13px;
  font-size: 14px;
  letter-spacing: .1px;
}

body:has(.cart-order-grid) #orderForm .submit-order:disabled {
  opacity: .48;
  cursor: not-allowed;
  box-shadow: none;
}

body:has(.cart-order-grid) #orderForm .selected-vendor {
  min-height: 50px;
  padding: 15px 16px;
  border: 1px solid #e9def2;
  border-radius: 12px;
  background: #faf7fd;
  color: #6e6478;
  font-size: 12px;
}

body:has(.cart-order-grid) #orderForm .vendor-results {
  margin-top: 14px;
}

body:has(.cart-order-grid) #orderForm .field-status,
body:has(.cart-order-grid) #orderForm .alert {
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.55;
}

/* Tablet: summary becomes a full-width top card, form below */
@media (max-width: 1020px) {
  body:has(.cart-order-grid) .order-section > .cart-order-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    width: min(760px, calc(100% - 40px)) !important;
    gap: 18px !important;
  }
  body:has(.cart-order-grid) .cart-order-grid > .order-summary {
    position: static !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
  }
  body:has(.cart-order-grid) .cart-order-grid > #orderForm.form-card {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }
}

/* Mobile: compact, readable cards and single-column fields */
@media (max-width: 640px) {
  body:has(.cart-order-grid) .order-section {
    padding: 20px 0 42px !important;
  }
  body:has(.cart-order-grid) .order-section > .cart-order-grid {
    width: calc(100% - 24px) !important;
    gap: 14px !important;
  }
  body:has(.cart-order-grid) .cart-checkout-summary {
    padding: 19px 17px 0 !important;
  }
  body:has(.cart-order-grid) .cart-checkout-summary h2 {
    font-size: 19px !important;
  }
  body:has(.cart-order-grid) .cart-checkout-summary .summary-row {
    margin-inline: -17px;
    padding: 16px 17px 18px;
  }
  body:has(.cart-order-grid) .cart-checkout-summary .summary-row strong {
    font-size: 21px;
  }
  body:has(.cart-order-grid) .cart-order-grid > #orderForm.form-card {
    padding: 22px 18px !important;
    border-radius: 18px !important;
  }
  body:has(.cart-order-grid) #orderForm .form-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
  }
  body:has(.cart-order-grid) #orderForm .form-grid .full {
    grid-column: 1 !important;
  }
  body:has(.cart-order-grid) #orderForm .form-head {
    gap: 10px;
    margin-bottom: 16px !important;
  }
  body:has(.cart-order-grid) #orderForm .form-head h3 {
    font-size: 16px;
  }
  body:has(.cart-order-grid) #orderForm .inline-field {
    grid-template-columns: minmax(0, 1fr);
  }
  body:has(.cart-order-grid) #orderForm .inline-field .btn {
    width: 100%;
  }
  body:has(.cart-order-grid) #orderForm .submit-order {
    min-height: 52px;
  }
}

/* Very narrow phones */
@media (max-width: 380px) {
  body:has(.cart-order-grid) .order-section > .cart-order-grid {
    width: calc(100% - 18px) !important;
  }
  body:has(.cart-order-grid) .cart-order-grid > #orderForm.form-card {
    padding: 18px 14px !important;
  }
  body:has(.cart-order-grid) #ppCheckoutItems > div {
    gap: 8px !important;
  }
}
