/* RisingLiberty Shop — visual-first catalogue */

:root {
  --rl-shop-accent: #7dd3fc;
  --rl-shop-accent-soft: color-mix(in srgb, #38bdf8 22%, transparent);
  --rl-shop-surface: #08080a;
  --rl-shop-border: rgba(255, 255, 255, 0.08);
  --rl-shop-muted: rgba(255, 255, 255, 0.42);
  --rl-shop-page-bg: #000;
  --rl-shop-nav-bg: #000;
  --rl-shop-nav-border: rgba(255, 255, 255, 0.08);
  --rl-shop-text: #f4f4f5;
}

html[data-theme="light"] {
  --rl-shop-accent: #0284c7;
  --rl-shop-accent-soft: color-mix(in srgb, #0ea5e9 18%, transparent);
  --rl-shop-surface: #ffffff;
  --rl-shop-border: rgba(0, 0, 0, 0.1);
  --rl-shop-muted: rgba(24, 24, 27, 0.5);
  --rl-shop-page-bg: #ffffff;
  --rl-shop-nav-bg: #ffffff;
  --rl-shop-nav-border: rgba(15, 23, 42, 0.1);
  --rl-shop-text: #18181b;
}

/* Eintöniger Hintergrund (schwarz / weiß) — Shop, Produkt, Warenkorb, Kasse */
body.public-ay.public-ay--subpage:has(.rl-subpage--shop) {
  background: var(--rl-shop-page-bg) !important;
  color: var(--rl-shop-text);
}

/* Sterne / Glow aus — eintönige Fläche */
body.public-ay.public-ay--subpage:has(.rl-subpage--shop) .ay-bg,
body.public-ay.public-ay--subpage:has(.rl-subpage--shop) .ay-glow,
body.public-ay.public-ay--subpage:has(.rl-subpage--shop) #ay-stars {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Taskleiste: farblich an Theme (nicht im Light-Mode dunkel bleiben) */
body.public-ay.public-ay--subpage:has(.rl-subpage--shop) .rl-public-nav {
  background: var(--rl-shop-nav-bg) !important;
  border-bottom: 1px solid var(--rl-shop-nav-border) !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html[data-theme="dark"] body.public-ay.public-ay--subpage:has(.rl-subpage--shop) .rl-public-nav {
  background: #000 !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="light"] body.public-ay.public-ay--subpage:has(.rl-subpage--shop) .rl-public-nav {
  background: #fff !important;
  border-bottom-color: rgba(15, 23, 42, 0.1) !important;
}

html[data-theme="light"] body.public-ay.public-ay--subpage:has(.rl-subpage--shop) .rl-public-nav__link {
  color: #3f3f46;
}

html[data-theme="light"] body.public-ay.public-ay--subpage:has(.rl-subpage--shop) .rl-public-nav__link:hover,
html[data-theme="light"] body.public-ay.public-ay--subpage:has(.rl-subpage--shop) .rl-public-nav__link.is-active {
  color: #18181b;
  background: rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] body.public-ay.public-ay--subpage:has(.rl-subpage--shop) .rl-public-nav__btn {
  color: #18181b;
  border-color: rgba(15, 23, 42, 0.12);
  background: #fff;
}

html[data-theme="light"] body.public-ay.public-ay--subpage:has(.rl-subpage--shop) .rl-public-nav__btn--solid {
  background: #18181b;
  color: #fff;
  border-color: #18181b;
}

html[data-theme="light"] body.public-ay.public-ay--subpage:has(.rl-subpage--shop) .ay-theme-toggle {
  color: #18181b;
  border-color: rgba(15, 23, 42, 0.12);
  background: #fff;
}

/* —— Page shell —— */
.rl-subpage--shop {
  width: min(100%, 74rem);
  color: var(--rl-shop-text);
}

.rl-subpage--shop .rl-subpage__content {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* —— Hero / top bar —— */
.rl-shop-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin: 0 0 1.75rem;
  padding: 0.1rem 0 1.25rem;
  border-bottom: 1px solid var(--rl-shop-border);
  animation: rl-shop-in 0.45s ease both;
}

.rl-shop-hero__text {
  min-width: 0;
  flex: 1;
}

.rl-shop-hero__title {
  margin: 0;
  font-size: clamp(1.9rem, 4.2vw, 2.55rem);
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--rl-shop-text);
}

/* —— Cart control —— */
.rl-shop-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}

.rl-shop-cart-link {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  max-width: 100%;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0a0a0c;
  white-space: nowrap;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.rl-shop-cart-link:hover {
  border-color: color-mix(in srgb, var(--rl-shop-accent) 50%, transparent);
  background: #121216;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  transform: translateY(-1px);
}

.rl-shop-cart-link__icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  max-width: 18px;
  max-height: 18px;
  display: block;
  flex: 0 0 18px;
}

.rl-shop-cart-link__label {
  display: inline;
}

@media (max-width: 420px) {
  .rl-shop-cart-link__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .rl-shop-cart-link {
    padding: 0.65rem;
  }
}

.rl-shop-cart-badge {
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.32rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.2rem;
  text-align: center;
  color: #050508;
  background: var(--rl-shop-accent);
}

.rl-shop-cart-badge:empty,
.rl-shop-cart-badge[data-count="0"] {
  display: none;
}

/* —— Product grid —— */
.rl-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 1.35rem;
  margin: 0 0 2rem;
  animation: rl-shop-in 0.5s ease 0.08s both;
}

@media (min-width: 720px) {
  .rl-shop-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.65rem;
  }
}

.rl-shop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  border-radius: 18px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #08080a;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.rl-shop-card:hover,
.rl-shop-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(125, 211, 252, 0.28);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(125, 211, 252, 0.08);
  outline: none;
}

.rl-shop-card__img-wrap {
  position: relative;
  aspect-ratio: 1;
  background:
    radial-gradient(90% 80% at 50% 20%, rgba(255, 255, 255, 0.06), transparent 55%),
    #050507;
  overflow: hidden;
}

.rl-shop-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.rl-shop-card:hover .rl-shop-card__img {
  transform: scale(1.04);
}

.rl-shop-card__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #121216, #050507);
}

.rl-shop-card__body {
  padding: 1rem 1.1rem 1.2rem;
  display: grid;
  gap: 0.35rem;
  flex: 1;
  background: linear-gradient(180deg, #0a0a0c 0%, #050507 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.rl-shop-card__title {
  font-weight: 650;
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: #fafafa;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rl-shop-card__price {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--rl-shop-accent);
  letter-spacing: -0.01em;
}

/* —— Empty —— */
.rl-shop-empty {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.45rem;
  margin: 2rem 0 2.5rem;
  padding: 2.5rem 1.25rem;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  background: #08080a;
  animation: rl-shop-in 0.45s ease both;
}

.rl-shop-empty__title {
  margin: 0;
  font-weight: 650;
  font-size: 1.05rem;
}

.rl-shop-empty__text {
  margin: 0;
  max-width: 22rem;
  font-size: 0.9rem;
  color: var(--rl-shop-muted);
  line-height: 1.45;
}

/* —— Footer —— */
.rl-shop-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.55rem;
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--rl-shop-muted);
}

.rl-shop-foot a {
  color: inherit;
  text-decoration: none;
}

.rl-shop-foot a:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

@keyframes rl-shop-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rl-shop-hero,
  .rl-shop-grid,
  .rl-shop-empty,
  .rl-shop-card,
  .rl-shop-card__img {
    animation: none !important;
    transition: none !important;
  }
}

/* —— Product detail —— */
.rl-product {
  display: grid;
  gap: 2rem;
  margin: 0.5rem 0 2rem;
}

@media (min-width: 860px) {
  .rl-product {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: start;
    gap: 2.75rem;
  }
}

.rl-product__media {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--rl-shop-border);
  background: #08080a;
  aspect-ratio: 1;
}

.rl-product__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rl-product__price {
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.rl-product__desc {
  margin: 0 0 1.25rem;
  opacity: 0.8;
  line-height: 1.55;
  font-size: 0.95rem;
}

.rl-product__form {
  display: grid;
  gap: 0.9rem;
  max-width: 22rem;
}

.rl-product__form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 560;
  font-size: 0.9rem;
}

.rl-product__form select,
.rl-product__form input[type="number"],
.rl-shop-field input,
.rl-shop-field select {
  padding: 0.7rem 0.85rem;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0a0a0c;
  color: inherit;
  font: inherit;
}

.rl-product__form select:focus,
.rl-product__form input:focus,
.rl-shop-field input:focus,
.rl-shop-field select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--rl-shop-accent) 55%, transparent);
  box-shadow: 0 0 0 3px var(--rl-shop-accent-soft);
}

.rl-product__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.rl-product__err {
  color: #ef4444;
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

.rl-product__toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 80;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--rl-shop-accent) 92%, #000);
  color: #0b1220;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.rl-product__toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* —— Cart + checkout layout —— */
.rl-shop-layout {
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 900px) {
  .rl-shop-layout--checkout {
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.75fr);
    align-items: start;
  }
}

.rl-shop-panel {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #08080a;
  padding: 1.2rem 1.3rem 1.4rem;
}

.rl-shop-panel h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #fff;
}

.rl-cart-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rl-cart-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--rl-shop-border);
}

.rl-cart-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.rl-cart-item__img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: #050507;
}

.rl-cart-item__title {
  margin: 0 0 0.2rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.rl-cart-item__meta {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.7;
}

.rl-cart-item__right {
  text-align: right;
  display: grid;
  gap: 0.4rem;
  justify-items: end;
}

.rl-cart-item__price {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

.rl-cart-item__qty {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--rl-shop-border);
  border-radius: 8px;
  overflow: hidden;
}

.rl-cart-item__qty button {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  width: 1.75rem;
  height: 1.75rem;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.rl-cart-item__qty span {
  min-width: 1.4rem;
  text-align: center;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.rl-cart-item__remove {
  appearance: none;
  border: 0;
  background: none;
  color: inherit;
  opacity: 0.55;
  cursor: pointer;
  font-size: 0.78rem;
  text-decoration: underline;
  padding: 0;
}

.rl-cart-item__remove:hover {
  opacity: 1;
}

.rl-cart-summary {
  display: grid;
  gap: 0.65rem;
}

.rl-cart-summary__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
}

.rl-cart-summary__row--total {
  font-weight: 700;
  font-size: 1.1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rl-shop-border);
  margin-top: 0.25rem;
}

.rl-cart-summary__muted {
  color: color-mix(in srgb, var(--rl-shop-muted, #71717a) 90%, transparent);
  font-size: 0.9rem;
}

.rl-cart-summary__note {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: color-mix(in srgb, var(--rl-shop-muted, #71717a) 95%, transparent);
  line-height: 1.35;
}

.rl-cart-summary__note--warn {
  margin-top: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: color-mix(in srgb, #c4a35a 14%, transparent);
  color: color-mix(in srgb, #f5e6c8 88%, #fff);
  border: 1px solid color-mix(in srgb, #c4a35a 28%, transparent);
}

.rl-cart-summary__row--sub {
  font-size: 0.82rem;
  opacity: 0.78;
  padding-left: 0.35rem;
}

.rl-shop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.rl-shop-fields {
  display: grid;
  gap: 0.85rem;
}

.rl-shop-fields--2 {
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 560px) {
  .rl-shop-fields--2 {
    grid-template-columns: 1fr;
  }
}

/* Label = eine Zeile; Input darunter (kein Grid-Split von Text+optional) */
.rl-shop-field {
  display: grid;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 550;
  min-width: 0;
}

.rl-shop-field__label {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 560;
  font-size: 0.88rem;
}

/* sehr klein, unauffällig — in derselben Label-Zeile */
.rl-shop-opt {
  display: inline;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  color: rgba(255, 255, 255, 0.3);
  line-height: 1;
}

.rl-shop-field.span-2 {
  grid-column: 1 / -1;
}

.rl-shop-field input::placeholder {
  color: rgba(255, 255, 255, 0.28);
  font-weight: 400;
}

#rl-shop-stripe-mount {
  min-height: 48px;
}

.rl-shop-stripe-stack {
  display: grid;
  gap: 0.75rem;
}

.rl-shop-pay-error {
  color: #ef4444;
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

.rl-shop-login-gate {
  text-align: center;
  padding: 1.75rem 1.25rem 1.5rem;
  display: grid;
  gap: 1rem;
  justify-items: center;
  max-width: 32rem;
  margin: 0 auto;
}

.rl-shop-login-gate__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.rl-shop-login-gate__text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--rl-shop-muted);
  text-align: left;
  width: 100%;
}

.rl-shop-login-gate__text strong {
  color: inherit;
  font-weight: 650;
  opacity: 0.95;
}

.rl-shop-login-gate .rl-shop-actions {
  justify-content: center;
  width: 100%;
}

.rl-shop-guest-hint {
  margin: 0 0 1.15rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--rl-shop-border);
  background: #08080a;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--rl-shop-muted);
}

.rl-shop-guest-hint p {
  margin: 0;
}

.rl-shop-guest-hint a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.rl-shop-success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

/* Light theme — solid white page already via CSS vars above */
html[data-theme="light"] .rl-shop-panel h2 {
  color: #18181b;
}

html[data-theme="light"] .rl-shop-card,
html[data-theme="light"] .rl-shop-panel,
html[data-theme="light"] .rl-shop-empty {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.1);
  color: #18181b;
  box-shadow: none;
}

html[data-theme="light"] .rl-shop-card__img-wrap {
  background: #fafafa;
}

html[data-theme="light"] .rl-shop-card__body {
  background: #fff;
  border-top-color: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .rl-shop-card__title {
  color: #18181b;
}

html[data-theme="light"] .rl-shop-card__price {
  color: #0284c7;
}

html[data-theme="light"] .rl-shop-field__label {
  color: #3f3f46;
}

html[data-theme="light"] .rl-shop-opt {
  color: rgba(63, 63, 70, 0.45);
}

html[data-theme="light"] .rl-shop-field input,
html[data-theme="light"] .rl-shop-field select,
html[data-theme="light"] .rl-product__form select,
html[data-theme="light"] .rl-product__form input[type="number"] {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.14);
  color: #18181b;
}

html[data-theme="light"] .rl-shop-cart-link {
  background: #fff;
  color: #18181b;
  border-color: rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .rl-shop-cart-badge {
  color: #fff;
  background: #0284c7;
}

html[data-theme="light"] .rl-shop-guest-hint,
html[data-theme="light"] .rl-shop-foot,
html[data-theme="light"] .rl-shop-login-gate__text {
  color: rgba(24, 24, 27, 0.55);
}

html[data-theme="light"] .rl-shop-hero {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .rl-product__media {
  background: #fafafa;
  border-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .rl-cart-item {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .rl-cart-summary__row--total {
  border-top-color: rgba(0, 0, 0, 0.1);
}
