/* Storefront cards and private purchase pages: complements styles.css and catalog.css. */
.store-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.store-product {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e9e0d9;
  border-radius: 17px;
  background: #fffdf8;
  box-shadow: 0 4px 0 #dfd5c650;
}

.store-cover {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #eee3f6;
  border-bottom: 1px solid #eadfd3;
}

.store-product-body {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  padding: 17px;
}

.store-product h3 {
  margin: 0;
  color: var(--purple);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.store-description {
  flex: 1 1 auto;
  margin: 8px 0 14px;
  color: #675d70;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.store-price {
  display: block;
  margin: 0 0 13px;
  color: #4a326d;
  font-size: 18px;
  font-weight: 900;
}

.purchase-button,
.order-refresh {
  display: inline-flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 11px 15px;
  background: var(--purple);
  color: #fff;
  box-shadow: 0 3px 0 #3c246d;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .25px;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.store-product .purchase-button {
  width: 100%;
}

.purchase-button:hover,
.order-refresh:hover {
  background: #6b46aa;
}

.purchase-button:active,
.order-refresh:active {
  box-shadow: 0 1px 0 #3c246d;
  transform: translateY(2px);
}

.purchase-button:disabled {
  cursor: not-allowed;
  background: #aa9eb4;
  box-shadow: 0 3px 0 #82748c;
}

.store-product small {
  display: block;
  margin-top: 13px;
  color: #887e8e;
  font-size: 10px;
  line-height: 1.4;
}

.purchase-button:focus-visible,
.order-refresh:focus-visible,
.checkout-close:focus-visible,
.checkout-submit:focus-visible,
.order-back:focus-visible,
.order-brand:focus-visible {
  outline: 3px solid #2f6fa7;
  outline-offset: 3px;
}

.checkout-dialog {
  width: min(calc(100% - 30px), 500px);
  max-height: min(760px, calc(100dvh - 30px));
  overflow: auto;
  border: 1px solid #ded2e7;
  border-radius: 22px;
  padding: 0;
  background: #fffdf8;
  color: var(--ink);
  box-shadow: 0 18px 55px #3427444d;
  font-family: inherit;
}

.checkout-dialog::backdrop { background: #34274494; }

.checkout-dialog-inner { padding: 26px; }

.checkout-dialog h2 {
  margin: 0;
  color: var(--purple);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.25;
}

.checkout-summary {
  margin: 17px 0;
  border: 1px solid #e6dbed;
  border-radius: 14px;
  padding: 14px;
  background: #f5eff9;
}

.checkout-product-title,
.checkout-product-price {
  display: block;
  overflow-wrap: anywhere;
}

.checkout-product-title { font-size: 15px; font-weight: 900; }
.checkout-product-price { margin-top: 4px; color: #5b3d87; font-size: 18px; font-weight: 900; }

.checkout-dialog-copy,
.checkout-consent,
.checkout-device-note {
  margin: 13px 0 0;
  color: #675d70;
  font-size: 13px;
  line-height: 1.55;
}

.checkout-device-note {
  border-left: 3px solid #d5bf72;
  padding-left: 10px;
  color: #655c6c;
  font-size: 12px;
}

.checkout-form { margin-top: 20px; }

.checkout-field {
  display: block;
  margin: 0 0 15px;
  color: #4c4055;
  font-size: 13px;
  font-weight: 800;
}

.checkout-field input {
  display: block;
  width: 100%;
  min-height: 45px;
  margin-top: 6px;
  border: 1px solid #cdbfda;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.checkout-field input:focus {
  border-color: var(--purple);
  outline: 3px solid #dcd0ec;
}

.checkout-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: #6c587f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.checkout-status.is-error { color: #9a3e50; }
.checkout-status.is-test { color: #765600; }
.checkout-status:empty { display: none; }

.checkout-actions {
  display: flex;
  flex-wrap: wrap-reverse;
  gap: 11px;
  justify-content: flex-end;
  margin-top: 21px;
}

.checkout-close,
.checkout-submit {
  min-height: 43px;
  border-radius: 12px;
  padding: 10px 16px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.checkout-close {
  border: 1px solid #cbbddb;
  background: #fffdf8;
  color: var(--purple);
}

.checkout-submit {
  border: 0;
  background: var(--purple);
  color: #fff;
  box-shadow: 0 3px 0 #3c246d;
}

.checkout-submit:disabled { cursor: wait; opacity: .72; }

/* /acquisto and /ordini intentionally use a calm, non-promotional shell. */
.order-shell {
  width: min(100% - 40px, 650px);
  padding-top: 31px;
  padding-bottom: 35px;
  text-align: left;
}

.order-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 31px;
}

.order-brand {
  color: var(--purple);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -.7px;
  text-decoration: none;
}

.order-back {
  color: #5c4871;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.order-back:hover,
.order-brand:hover { text-decoration: underline; }

.order-shell h1 {
  color: var(--purple);
  font-size: clamp(25px, 5vw, 34px);
  text-align: left;
}

.order-intro {
  max-width: 580px;
  margin: 10px 0 22px;
  color: #675d70;
  font-size: 14px;
  line-height: 1.6;
}

.order-feedback,
.order-notice {
  margin: 0 0 17px;
  border-radius: 13px;
  padding: 12px 14px;
  color: #554564;
  background: #eee7f5;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.order-feedback:empty,
.order-notice:empty { display: none; }
.order-feedback.is-error { color: #853749; background: #f9e4e8; }
.order-notice.is-cancelled { color: #7b5a18; background: #fff1cf; }

.orders-list {
  display: grid;
  gap: 14px;
}

.order-card {
  border: 1px solid #e3d9cd;
  border-radius: 18px;
  padding: 20px;
  background: #fffdf8;
  box-shadow: 0 4px 0 #dfd5c650;
}

.order-card-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 11px;
}

.order-card h2 {
  margin: 0;
  color: var(--purple);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.order-amount {
  color: #4b3470;
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
}

.order-state {
  margin: 14px 0 7px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.4;
}

.order-state.is-paid { color: #28724a; }
.order-state.is-pending { color: #806017; }
.order-state.is-failed { color: #a24456; }

.order-state-copy,
.order-date,
.order-recovery-note {
  margin: 0;
  color: #6c6172;
  font-size: 13px;
  line-height: 1.55;
}

.order-date { margin-top: 11px; color: #887e8e; font-size: 12px; }
.order-recovery-note { margin-top: 11px; }

.order-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 17px;
}

.order-refresh { background: #8261a5; box-shadow: 0 3px 0 #5f417c; }
.order-refresh:active { box-shadow: 0 1px 0 #5f417c; }
.order-refresh:disabled { cursor: wait; opacity: .7; }

.mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border: 1px solid #d2bc68;
  border-radius: 999px;
  padding: 3px 9px;
  background: #fff1c8;
  color: #6d5200;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .25px;
  line-height: 1.2;
  text-align: center;
}

.order-history {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #ded3c7;
}

.order-history h2 {
  margin: 0 0 14px;
  color: #5b4671;
  font-size: 18px;
  font-weight: 900;
}

.order-empty {
  margin: 0;
  border-radius: 15px;
  padding: 18px;
  background: #fffdf8;
  color: #6d6374;
  font-size: 14px;
  line-height: 1.55;
}

.order-privacy {
  margin: 26px 0 0;
  border-top: 1px solid #ded3c7;
  padding-top: 18px;
  color: #766d7d;
  font-size: 12px;
  line-height: 1.6;
}

.order-privacy a { color: var(--purple); font-weight: 800; }

@media (max-width: 640px) {
  .store-grid { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .store-product { flex-direction: row; }
  .store-cover { width: 37%; min-height: 175px; aspect-ratio: auto; border-right: 1px solid #eadfd3; border-bottom: 0; }
  .store-product-body { padding: 15px; }
  .store-product h3 { font-size: 15px; }
  .store-description { margin: 6px 0 10px; font-size: 12px; }
  .store-price { margin-bottom: 10px; font-size: 16px; }
  .store-product small { margin-top: 10px; }

  .checkout-dialog-inner { padding: 21px; }
  .checkout-dialog h2 { font-size: 20px; }
  .checkout-actions > * { flex: 1 1 150px; }

  .order-shell { width: min(100% - 34px, 650px); padding-top: 24px; }
  .order-header { margin-bottom: 26px; }
  .order-brand { font-size: 22px; }
  .order-back { font-size: 12px; }
  .order-card { padding: 17px; }
  .order-card h2 { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .purchase-button,
  .order-refresh { transition: none; }
}

.site-footer .text-link { color: var(--purple, #57328a); font-weight: 800; text-underline-offset: 4px; }
.site-footer .text-link:focus-visible { outline: 3px solid #2f6fa7; outline-offset: 5px; border-radius: 3px; }
