/* Showcase store — cart / checkout / result (PROMPT #114–#116) */
:root {
  --site-header-offset: 10rem;
  --store-ink: #122033;
  --store-muted: #5b6b7c;
  --store-line: rgba(18, 32, 51, 0.1);
  --store-surface: #fff;
  --store-soft: #f6f8fb;
  --store-accent: #1a6fd4;
  --store-danger: #b42318;
  --store-ok: #146133;
  --store-radius: 0.85rem;
  --store-shadow: 0 10px 28px rgba(18, 32, 51, 0.08);
}

.store-main {
  padding: calc(var(--site-header-offset) + 1.75rem) 0 4rem;
  color: var(--store-ink);
  scroll-margin-top: calc(var(--site-header-offset) + 0.75rem);
}
.store-wrap { max-width: 1100px; }
.store-title { font-size: clamp(1.45rem, 2.2vw, 1.85rem); margin: 0 0 1rem; letter-spacing: -0.02em; }
.store-empty,
.store-alert {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  background: #fff3f0;
  border: 1px solid #f0c2b8;
  border-radius: 0.65rem;
}
.store-ok {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  background: #eefaf1;
  border: 1px solid #b7e0c2;
  border-radius: 0.65rem;
}

.store-steps {
  display: flex;
  gap: 0.55rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.35rem;
  flex-wrap: wrap;
}
.store-steps li {
  opacity: 0.5;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--store-soft);
}
.store-steps li.is-active {
  opacity: 1;
  color: #fff;
  background: var(--store-ink);
}

/* Cart layout */
.store-cart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.75fr);
  gap: 1.35rem;
  align-items: start;
}

.store-lines {
  display: grid;
  gap: 0;
  background: var(--store-surface);
  border: 1px solid var(--store-line);
  border-radius: var(--store-radius);
  padding: 0.25rem 1rem;
  box-shadow: var(--store-shadow);
}

.store-line {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--store-line);
  align-items: start;
}
.store-line:last-child { border-bottom: 0; }

.store-line-media {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 0.55rem;
  overflow: hidden;
  background: var(--store-soft);
}
.store-line-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.store-line-body { min-width: 0; }
.store-line-body > a {
  color: inherit;
  text-decoration: none;
}
.store-line-body > a:hover strong,
.store-line-body > a:focus-visible strong {
  text-decoration: underline;
  color: var(--store-accent);
}

.store-opts {
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--store-muted);
  font-size: 0.88rem;
  display: grid;
  gap: 0.15rem;
}

.store-line-side {
  display: grid;
  justify-items: end;
  gap: 0.55rem;
  min-width: 7.5rem;
}

.store-line-price {
  font-size: 0.86rem;
  color: var(--store-muted);
}
.store-line-total {
  font-weight: 800;
  font-size: 1rem;
}

.store-qty {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--store-line);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
  width: max-content;
}
.store-qty form { display: contents; }
.store-qty button {
  min-width: 2.15rem;
  height: 2.15rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--store-ink);
}
.store-qty button:hover,
.store-qty button:focus-visible {
  background: var(--store-soft);
}
.store-qty__value {
  min-width: 1.75rem;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
}

.store-remove {
  border: 0;
  background: transparent;
  color: var(--store-danger);
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  padding: 0.15rem 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.store-summary-card {
  position: sticky;
  top: calc(var(--site-header-offset) + 0.75rem);
  background: var(--store-surface);
  border: 1px solid var(--store-line);
  border-radius: var(--store-radius);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--store-shadow);
  display: grid;
  gap: 0.85rem;
}
.store-summary-card h2 {
  margin: 0;
  font-size: 1.05rem;
}
.store-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.95rem;
}
.store-summary-row.is-total {
  font-size: 1.1rem;
  font-weight: 800;
  padding-top: 0.55rem;
  border-top: 1px solid var(--store-line);
}
.store-mini-line {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--store-muted);
  padding: 0.25rem 0;
}

/* legacy sticky summary used on older markup */
.store-summary {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  background: #fff;
  padding: 1rem 0;
}

/* Checkout */
.store-checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
  gap: 1.5rem;
  align-items: start;
}

.store-form {
  display: grid;
  gap: 1rem;
}

.store-form fieldset {
  border: 1px solid var(--store-line);
  margin: 0;
  padding: 1rem 1.1rem 1.15rem;
  border-radius: var(--store-radius);
  background: var(--store-surface);
  box-shadow: var(--store-shadow);
}

.store-form legend {
  font-weight: 800;
  padding: 0 0.35rem;
  font-size: 0.98rem;
}

.store-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 0.9rem;
}

.store-form label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--store-muted);
  min-width: 0;
}

.store-form label > span { color: var(--store-ink); }

.store-form input,
.store-form textarea,
.store-form select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  border: 1px solid #c9d3df;
  border-radius: 0.5rem;
  font: inherit;
  color: var(--store-ink);
  background: #fff;
}

.store-form textarea { min-height: 5.5rem; resize: vertical; }

.store-field--span2 { grid-column: 1 / -1; }

.store-check {
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600 !important;
  color: var(--store-ink) !important;
  grid-template-columns: none !important;
}
.store-check input { width: auto !important; }

.is-hidden { display: none !important; }

.store-phone {
  display: grid;
  grid-template-columns: minmax(7.5rem, 11rem) minmax(0, 1fr);
  gap: 0.5rem;
  align-items: stretch;
  position: relative;
}
.store-phone select,
.store-phone input[type="tel"],
.store-phone__dial-btn {
  height: 2.65rem;
}
.store-phone__picker { position: relative; min-width: 0; }
.store-phone__dial-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid #c9d3df;
  border-radius: 0.5rem;
  background: #fff;
  font: inherit;
  color: var(--store-ink);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  text-align: left;
}
.store-phone__menu {
  position: absolute;
  z-index: 40;
  left: 0;
  right: auto;
  top: calc(100% + 0.25rem);
  width: min(22rem, 85vw);
  max-height: 16rem;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--store-line);
  border-radius: 0.55rem;
  box-shadow: var(--store-shadow);
  overflow: hidden;
}
.store-phone__search {
  border: 0;
  border-bottom: 1px solid var(--store-line);
  border-radius: 0;
  padding: 0.65rem 0.75rem;
}
.store-phone__list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  overflow: auto;
  max-height: 12.5rem;
}
.store-phone__list li {
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-size: 0.86rem;
}
.store-phone__list li:hover,
.store-phone__list li.is-selected {
  background: var(--store-soft);
}
.store-tr-address,
.store-intl-address {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 0.9rem;
  grid-column: 1 / -1;
}
.store-field-msg {
  color: var(--store-danger);
  font-size: 0.78rem;
  font-weight: 600;
}
.store-form .is-invalid,
.store-form input.is-invalid,
.store-form select.is-invalid,
.store-form textarea.is-invalid {
  border-color: var(--store-danger) !important;
  box-shadow: 0 0 0 1px rgba(180, 35, 24, 0.15);
}
.store-ship-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--store-muted);
}
.store-consent { align-items: flex-start !important; }
.store-consent a { color: var(--store-accent); }

.store-legal {
  font-size: 0.86rem;
  color: var(--store-muted);
  margin: 0.25rem 0 0;
}
.store-legal a { color: var(--store-accent); }

.store-pay-hint {
  font-size: 0.9rem;
  color: var(--store-muted);
  margin: 0 0 0.85rem;
}

.store-pay-summary {
  margin-bottom: 1rem;
  position: static;
  max-width: 420px;
}

.store-pos-frame {
  width: 100%;
  min-height: 640px;
  border: 0;
  background: #f7f7f7;
  border-radius: var(--store-radius);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.store-cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  margin-left: 0.5rem;
  color: #f6f8f2;
  text-decoration: none;
}
.store-cart-link:link,
.store-cart-link:visited { color: #f6f8f2; }
.store-cart-link:hover,
.store-cart-link:hover:visited { color: #85ee00; }
.store-cart-icon {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  pointer-events: none;
}
.store-cart-badge {
  position: absolute;
  top: 0.1rem;
  inset-inline-end: 0.05rem;
  display: inline-flex;
  min-width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  background: #85ee00;
  color: #1e1e1e;
  padding: 0 0.28rem;
  pointer-events: none;
}
html[dir="rtl"] .store-cart-link { margin-left: 0; margin-right: 0.5rem; }

/* Result */
.store-result {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding: 2rem 1.25rem;
  border: 1px solid var(--store-line);
  border-radius: calc(var(--store-radius) + 0.15rem);
  background: linear-gradient(180deg, #fff 0%, var(--store-soft) 100%);
  box-shadow: var(--store-shadow);
}
.store-result--ok { border-color: #b7e0c2; }
.store-result--fail { border-color: #f0c2b8; }
.store-result__icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.55rem;
  font-weight: 800;
}
.store-result--ok .store-result__icon {
  background: #e6f6ed;
  color: var(--store-ok);
}
.store-result--fail .store-result__icon {
  background: #fff1f0;
  color: var(--store-danger);
}
.store-result__meta {
  display: grid;
  gap: 0.45rem;
  margin: 1.1rem 0;
  text-align: left;
  background: #fff;
  border: 1px solid var(--store-line);
  border-radius: 0.65rem;
  padding: 0.85rem 1rem;
}
.store-result__meta div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.92rem;
}
.store-result__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 1.15rem;
}
.store-result-lines {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  text-align: left;
  font-size: 0.9rem;
  color: var(--store-muted);
}
.store-result-lines li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--store-line);
}
.store-result-lines li:last-child { border-bottom: 0; }

/* Admin leftovers kept for TempData boxes on admin pages that reuse store-alert */
.admin-kpis { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1rem 0; }
.admin-filters { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th,
.admin-table td {
  border-bottom: 1px solid #ddd;
  padding: 0.5rem;
  text-align: left;
  font-size: 0.9rem;
}

@media (max-width: 960px) {
  .store-cart-grid,
  .store-checkout-grid {
    grid-template-columns: 1fr;
  }
  .store-summary-card {
    position: static;
  }
}

@media (max-width: 700px) {
  .store-line {
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-areas:
      "media body"
      "side side";
  }
  .store-line-media { grid-area: media; width: 72px; height: 72px; }
  .store-line-body { grid-area: body; }
  .store-line-side {
    grid-area: side;
    justify-items: start;
    grid-template-columns: 1fr auto;
    align-items: center;
    width: 100%;
    min-width: 0;
  }
  .store-form-grid { grid-template-columns: 1fr; }
  .store-phone { grid-template-columns: minmax(6.5rem, 8rem) minmax(0, 1fr); }
  .store-pos-frame { min-height: 480px; }
}

@media (max-width: 420px) {
  .store-phone {
    grid-template-columns: 1fr;
  }
}
