/* ottermedia.fi advertising shop (/mainosta, /advertise). Builds on otter-site.css. */

.om-ad-h3 {
  margin: 0 0 1.25rem;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--om-fg);
}

/* ---- Intro stats ------------------------------------------------------- */

.om-ad-intro {
  padding-bottom: clamp(3rem, 7vh, 4.5rem);
}

.om-ad-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--om-line);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--om-line);
}

.om-ad-stat {
  display: grid;
  align-content: start;
  gap: 0.4rem;
  padding: 1.25rem;
  background: var(--om-bg);
}

.om-ad-stat strong {
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.om-ad-stat span {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--om-fg-muted);
}

@media (min-width: 900px) {
  .om-ad-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---- Shop layout ------------------------------------------------------- */

.om-ad-shop {
  padding-bottom: clamp(4.5rem, 10vh, 7rem);
}

.om-ad-layout {
  display: grid;
  gap: 2.5rem;
}

.om-ad-steps {
  display: grid;
  gap: 2.5rem;
  min-width: 0;
}

@media (min-width: 1024px) {
  .om-ad-layout {
    grid-template-columns: minmax(0, 1fr) 20rem;
    align-items: start;
  }

  .om-ad-summary {
    position: sticky;
    top: calc(var(--om-nav-h) + 1.5rem);
  }
}

.om-ad-step {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.om-ad-step:focus {
  outline: none;
}

.om-ad-legend {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  margin: 0 0 1.25rem;
  padding: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.om-ad-num {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--om-fg-faint);
  font-variant-numeric: tabular-nums;
}

.om-ad-step.is-invalid .om-ad-legend {
  color: #ff9b8f;
}

.om-ad-help {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--om-fg-muted);
}

.om-ad-req {
  color: var(--om-fg-faint);
  font-weight: 400;
}

/* ---- Inputs: chips, choices, cards ------------------------------------ */

.om-ad-shop input[type="checkbox"],
.om-ad-shop input[type="radio"] {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  flex: none;
  accent-color: var(--om-accent);
}

.om-ad-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.om-ad-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--om-line);
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.om-ad-chip:hover,
.om-ad-chip:has(input:checked) {
  border-color: var(--om-line-strong);
}

.om-ad-chip:has(input:disabled) {
  opacity: 0.5;
  cursor: default;
}

.om-ad-chip__note {
  color: var(--om-fg-muted);
}

/* "Select all" needs JavaScript. */
.om-ad-chip--js {
  display: none;
}

.is-enhanced .om-ad-chip--js {
  display: inline-flex;
}

.om-ad-js-only {
  display: none;
}

.is-enhanced .om-ad-js-only {
  display: grid;
}

.om-ad-sites {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .om-ad-sites {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.om-ad-site {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--om-line);
  border-radius: 0.9rem;
  background: var(--om-bg-elev);
  transition: border-color 0.15s ease;
}

.om-ad-site:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.om-ad-site.is-selected,
.om-ad-site:has(input:checked:not(:disabled)) {
  border-color: var(--om-accent);
}

.om-ad-site__pick {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.15rem;
  cursor: pointer;
}

.om-ad-site__pick:has(input:disabled) {
  cursor: default;
}

.om-ad-site__name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.om-ad-site__market {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--om-fg-faint);
}

.om-ad-site__desc {
  grid-column: 2 / -1;
  font-size: 0.875rem;
  color: var(--om-fg-muted);
}

.om-ad-site__prices {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--om-line);
  font-size: 0.8rem;
}

.om-ad-site__prices dt {
  color: var(--om-fg-muted);
}

.om-ad-site__prices dd {
  margin: 0;
  color: var(--om-fg);
  font-variant-numeric: tabular-nums;
}

.om-ad-site__quote {
  margin: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--om-line);
  font-size: 0.8rem;
  color: var(--om-fg-muted);
}

.om-ad-site__visit {
  margin-top: auto;
  align-self: flex-start;
  font-size: 0.8rem;
  color: var(--om-fg-muted);
  border-bottom: 1px solid var(--om-line-strong);
}

.om-ad-site__visit:hover {
  color: var(--om-fg);
}

.om-ad-choices {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .om-ad-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.om-ad-choice {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.75rem;
  row-gap: 0.2rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border: 1px solid var(--om-line);
  border-radius: 0.9rem;
  background: var(--om-bg-elev);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.om-ad-choice:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.om-ad-choice:has(input:checked) {
  border-color: var(--om-accent);
}

.om-ad-choice__title {
  font-weight: 500;
}

.om-ad-choice__note {
  grid-column: 2;
  font-size: 0.85rem;
  color: var(--om-fg-muted);
}

.om-ad-variant {
  max-width: 24rem;
  margin-top: 1.25rem;
}

.om-ad-variant[hidden],
.om-ad-help[hidden] {
  display: none;
}

/* ---- Summary ----------------------------------------------------------- */

.om-ad-summary__inner {
  padding: 1.5rem;
  border: 1px solid var(--om-line-strong);
  border-radius: 1rem;
  background: var(--om-bg-elev);
}

.om-ad-items {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
}

.om-ad-items:empty {
  display: none;
}

.om-ad-items li {
  display: grid;
  gap: 0.15rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--om-line);
}

.om-ad-items span {
  color: var(--om-fg-muted);
}

.om-ad-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.25rem 0 0;
}

.om-ad-total span {
  color: var(--om-fg-muted);
}

.om-ad-total strong {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.om-ad-quote {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--om-accent);
}

.om-ad-summary .om-btn {
  margin-top: 1.25rem;
}

/* Mobile total bar (shown by JS, hidden once the sidebar is visible). */
.om-ad-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem var(--om-gutter);
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--om-line-strong);
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 0.9rem;
}

.om-ad-bar strong {
  font-variant-numeric: tabular-nums;
}

.om-ad-bar[hidden] {
  display: none;
}

@media (min-width: 1024px) {
  .om-ad-bar {
    display: none;
  }
}

/* ---- Policies + order -------------------------------------------------- */

.om-ad-policies {
  margin: 3.5rem 0 0;
  padding: 1.5rem;
  border: 1px solid var(--om-line);
  border-radius: 1rem;
}

.om-ad-policies ul {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0 0 0 1.1rem;
  color: var(--om-fg-muted);
  font-size: 0.925rem;
}

.om-ad-order {
  margin-top: 3.5rem;
  max-width: 48rem;
}

.om-ad-shop select.om-form-field {
  appearance: auto;
}

.om-ad-shop .om-form-field[aria-invalid="true"] {
  border-color: #ff9b8f;
}

.om-ad-shop .om-form-field[readonly] {
  color: var(--om-fg-muted);
}

.om-ad-errors {
  padding: 1rem 1.25rem;
  border: 1px solid #ff9b8f;
  border-radius: 0.75rem;
  color: #ffd2cc;
  font-size: 0.9rem;
}

.om-ad-errors:focus {
  outline: 2px solid #ff9b8f;
  outline-offset: 2px;
}

.om-ad-errors p {
  margin: 0 0 0.5rem;
  font-weight: 500;
}

.om-ad-errors ul {
  margin: 0;
  padding-left: 1.1rem;
}

.om-ad-errors a {
  border-bottom: 1px solid currentColor;
}

.om-ad-errors[hidden],
.om-ad-sent[hidden],
.om-ad-quote[hidden] {
  display: none;
}

.om-ad-fallback {
  margin: 0;
  font-size: 0.9rem;
  color: var(--om-fg-muted);
}

/* Order confirmation panel (after "Send by email" or the card fallback). */
.om-ad-sent {
  display: grid;
  gap: 0.85rem;
  padding: 1.25rem;
  border: 1px solid #7fd6a4;
  border-radius: 0.75rem;
  background: rgba(127, 214, 164, 0.06);
  color: var(--om-fg-muted);
  font-size: 0.9rem;
}

.om-ad-sent:focus {
  outline: 2px solid #7fd6a4;
  outline-offset: 2px;
}

.om-ad-sent p {
  margin: 0;
}

.om-ad-sent__status {
  display: grid;
  gap: 0.5rem;
}

.om-ad-sent__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--om-fg);
}

.om-ad-sent__label {
  font-weight: 500;
  color: var(--om-fg);
}

.om-ad-sent__text {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
}

.om-ad-sent__reply {
  color: var(--om-fg);
}

.om-ad-email {
  color: var(--om-fg);
  user-select: all;
  overflow-wrap: anywhere;
}

/* ---- Language toggle --------------------------------------------------- */

.om-ad-lang {
  display: inline-flex;
  margin-bottom: 1.25rem;
  border: 1px solid var(--om-line-strong);
  border-radius: 999px;
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.om-ad-lang__link {
  padding: 0.35rem 0.9rem;
  color: var(--om-fg-muted);
  text-decoration: none;
}

.om-ad-lang__link:hover {
  color: var(--om-fg);
}

.om-ad-lang__link[aria-current="page"] {
  background: var(--om-fg);
  color: var(--om-bg);
}

/* ---- Static price list ------------------------------------------------- */

.om-ad-prices {
  padding-bottom: clamp(3rem, 7vh, 4.5rem);
}

.om-ad-prices__wrap {
  overflow-x: auto;
  border: 1px solid var(--om-line);
  border-radius: 1rem;
}

.om-ad-prices__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.45;
}

.om-ad-prices__table th,
.om-ad-prices__table td {
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--om-line);
}

.om-ad-prices__table tbody tr:last-child > * {
  border-bottom: 0;
}

.om-ad-prices__table thead th {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--om-fg-faint);
}

.om-ad-prices__table tbody th {
  font-weight: 600;
  color: var(--om-fg);
}

.om-ad-prices__table td:last-child {
  font-variant-numeric: tabular-nums;
  color: var(--om-fg);
}

.om-ad-prices__sites {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--om-fg-muted);
}

.om-ad-prices__table td {
  font-variant-numeric: tabular-nums;
  color: var(--om-fg);
}

.om-ad-prices__sub {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--om-fg-muted);
}

.om-ad-prices__package > * {
  background: rgba(255, 255, 255, 0.04);
}

/* ---- Card payment ------------------------------------------------------ */

.om-ad-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* "Pay with card" needs JavaScript (it calls /api/checkout). */
.om-ad-pay {
  display: none;
}

.is-enhanced .om-ad-pay {
  display: inline-flex;
}

.om-ad-pay:disabled,
.om-ad-pay[aria-busy="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.om-ad-pay-status {
  margin: 0;
  font-size: 0.9rem;
  color: var(--om-fg);
}

.om-ad-pay-status[hidden],
.om-ad-ref[hidden] {
  display: none;
}

.om-ad-ref code {
  font-size: 0.85em;
  overflow-wrap: anywhere;
}
