#content > .box,
#content > div > .box {
  margin-bottom: var(--space-10);
}

#content > .box:last-child,
#content > div > .box:last-child {
  margin-bottom: 0;
}

#content > .box > .box-heading,
#content > div > .box > .box-heading {
  background: none;
  border: none;
  border-bottom: 2px solid var(--color-accent);
  padding: var(--space-4) var(--space-5) var(--space-3) var(--space-5);
  margin-bottom: var(--space-6);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
}

@media (max-width: 599px) {
  #content > .box,
  #content > div > .box {
    margin-bottom: var(--space-6);
  }

  #content [id^="carousel"] {
    margin-bottom: var(--space-6);
  }
}

/* ---- Welcome module (.welcome / homepage content) ----------------------
   module/welcome.tpl renders <div class="welcome"> then echoes raw HTML
   from the database. The welcome wrapper itself is empty; the actual
   homepage content is rendered as siblings of this element. */

.welcome {
  display: none;
}

/* Homepage h1 from the database welcome text */
#content > h1,
#content .richter-section-heading h2 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  text-align: center;
  margin-bottom: var(--space-4);
}

/* Homepage paragraphs */
#content > p {
  margin-bottom: var(--space-4);
}

.richter-home-shop-text {
  text-align: center;
}

/* Orange notice paragraph (no Ladengeschäft) */
.richter-home-notice {
  color: #ff8c00;
}

/* Centered image blocks on the homepage
   Used for Profifilter, voucher and ShopVote images. */
#content > p.richter-home-image {
  text-align: center;
}

#content > p.richter-home-image img {
  display: inline-block;
  max-width: 100%;
  height: auto;
}

/* ShopVote verification / trust text */
#content > p.richter-home-trust {
  max-width: 650px;
  margin: calc(var(--space-4) * -0.5) auto var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  text-align: center;
}

#content > p.richter-home-trust a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

#content > p.richter-home-trust a:hover {
  color: var(--color-primary);
}

/* ---- Homepage Dartshop category grid -------------------------------
   Responsive category cards.
   Desktop: 3 columns
   Tablet:  2 columns
   Mobile:  1 column */

.richter-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin: var(--space-6) 0;
}

.richter-category-card {
  min-width: 0;
}

.richter-category-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  color: var(--color-text);
  text-decoration: none;
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-base);
}

.richter-category-card a:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
}

.richter-category-card__image {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--color-bg-subtle);
}

.richter-category-card__image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.richter-category-card a:hover .richter-category-card__image img {
  transform: scale(1.02);
}

.richter-category-card__text {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  text-align: center;
  font-size: var(--font-size-sm);
  line-height: 1.5;
  font-weight: var(--font-weight-medium);
}

.richter-category-card__text strong {
  color: var(--color-primary);
}

@media (max-width: 991px) {
  .richter-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 599px) {
  .richter-category-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
    margin: var(--space-4) 0;
  }

  .richter-category-card__text {
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-sm);
  }
}

#content ul:not([class]),
#content ol:not([class]) {
  margin: 0 0 var(--space-4) 0;
  padding-left: var(--space-6);
}

#content ul:not([class]) ul:not([class]),
#content ol:not([class]) ol:not([class]),
#content ul:not([class]) ol:not([class]),
#content ol:not([class]) ul:not([class]) {
  margin-top: var(--space-2);
  margin-bottom: 0;
}

#content ul:not([class]) li,
#content ol:not([class]) li {
  margin-bottom: var(--space-2);
}

/* ---- Homepage description text block (Dartshop Beschreibung) -----------
   The longer shop description (h2 + long paragraph about dart products)
   also comes from a welcome module. Give it appropriate spacing. */

#content > h2 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}

/* ---- Profifilter / Voucher / ShopVote widget block in column_left ------
   The welcome module in column_left renders the Profifilter link image,
   Gutschein image, and ShopVote badge. */

#column-left img {
  max-width: 100%;
  height: auto;
}

#column-left table {
  max-width: 100%;
}

/* ---- Trust signals bar (homepage only, home.tpl) -------------------------
   v1.7 — see home.tpl for the "why" and the placeholder-copy caveat. */

.richter-trust-bar {
  background: var(--color-bg-subtle);
  border-bottom: 1px solid var(--color-border);
}

.richter-trust-bar__inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: var(--space-4) var(--container-padding);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-8);
}

.richter-trust-bar__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.richter-trust-bar__item a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: inherit;
  text-decoration: none;
}

.richter-trust-bar__item a:hover {
  color: var(--color-primary);
}

.richter-trust-bar__item a:hover svg {
  color: var(--color-primary);
}

.richter-trust-bar__item svg {
  flex-shrink: 0;
  color: var(--color-primary);
}

@media (max-width: 767px) {
  /* v1.9 bugfix — "the trustbar does not break on small screens, so
     it stays too wide and the user has to scroll". This used to be
     a deliberate horizontal scroller (overflow-x:auto + nowrap) — on
     reflection that's a worse experience than just wrapping, since
     nothing here needs to be reachable via swipe/scroll discovery.
     Wraps onto as many short lines as needed instead. */

  .richter-trust-bar__inner {
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-5);
    padding: var(--space-3) var(--container-padding);
  }

  .richter-trust-bar__item {
    font-size: var(--font-size-xs);
  }
}

/* ---- Homepage services / promotion row -------------------------------
   Three compact service cards.
   Desktop: 3 columns
   Tablet:  2 columns
   Mobile:  1 column
*/

.richter-home-services {
  margin: var(--space-10) 0;
}

.richter-home-services__header {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-accent);
}

.richter-home-services__header h2 {
  margin: 0;
  color: var(--color-primary);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  line-height: 1.3;
}

.richter-home-services__header p {
  margin: var(--space-2) 0 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  line-height: 1.5;
}


/* Cards */

.richter-home-services__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.richter-home-service {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);

  min-width: 0;
  padding: var(--space-5);

  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);

  color: var(--color-text);
  text-decoration: none;

  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-base);
}

.richter-home-service:hover {
  transform: translateY(-2px);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
}


/* Icon */

.richter-home-service__icon {
  flex: 0 0 44px;

  width: 44px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--color-accent);
  background: var(--color-bg-subtle);

  border-radius: 50%;
}

.richter-home-service__icon svg {
  width: 24px;
  height: 24px;
}


/* Text */

.richter-home-service__body {
  min-width: 0;

  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.richter-home-service__title {
  display: block;

  color: var(--color-primary);

  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  line-height: 1.3;
}

.richter-home-service__subtitle {
  display: block;

  margin-top: 2px;

  color: var(--color-text-muted);

  font-size: var(--font-size-xs);
  line-height: 1.3;
}

.richter-home-service__text {
  display: block;

  margin-top: var(--space-2);

  color: var(--color-text-muted);

  font-size: var(--font-size-sm);
  line-height: 1.5;
}


/* Link */

.richter-home-service__link {
  display: inline-block;

  margin-top: var(--space-3);

  color: var(--color-accent);

  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  line-height: 1.3;
}

.richter-home-service__link > span {
  display: inline-block;
  margin-left: 3px;

  transition: transform var(--transition-base);
}

.richter-home-service:hover .richter-home-service__link > span {
  transform: translateX(3px);
}


/* Keyboard accessibility */

.richter-home-service:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}


/* ---- Tablet -------------------------------------------------------- */

@media (max-width: 991px) {
  .richter-home-services__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .richter-home-service:last-child {
    grid-column: 1 / -1;
  }
}


/* ---- Mobile ------------------------------------------------------- */

@media (max-width: 599px) {
  .richter-home-services {
    margin: var(--space-8) 0;
  }

  .richter-home-services__header {
    margin-bottom: var(--space-4);
  }

  .richter-home-services__header p {
    font-size: var(--font-size-xs);
  }

  .richter-home-services__grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .richter-home-service:last-child {
    grid-column: auto;
  }

  .richter-home-service {
    gap: var(--space-3);
    padding: var(--space-4);
  }

  .richter-home-service__icon {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }

  .richter-home-service__icon svg {
    width: 22px;
    height: 22px;
  }

  .richter-home-service__title {
    font-size: var(--font-size-sm);
  }

  .richter-home-service__text {
    font-size: var(--font-size-xs);
  }

  .richter-home-service__link {
    margin-top: var(--space-2);
    font-size: var(--font-size-xs);
  }
}
