/* =====================================================================
 * WooCommerce
 *
 * WooCommerce bringt eigene Grundregeln mit, die auf Shopseiten auch
 * ausserhalb des Shops greifen. `.woocommerce img { height: auto }` ist
 * spezifischer als eine einzelne Klasse und laesst dort sonst das Logo
 * im Kopfbereich auf Originalgroesse aufblaehen.
 * Hier wird die Absicht des Designs wiederhergestellt.
 * ===================================================================== */

.fy-header .fy-brand-logo {
  width: auto;
  height: 40px;
}

.fy-footer .fy-footer-logo {
  width: auto;
  height: 54px;
}

@media (max-width: 767px) {
  .fy-header .fy-brand-logo {
    height: 34px;
  }
}

/* --- Shopinhalte an das Design angleichen ---------------------------- */
.fy-content-area .woocommerce {
  color: inherit;
}

.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--fy-space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
  content: none;
}

.woocommerce ul.products li.product {
  width: 100% !important;
  margin: 0 !important;
  float: none !important;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: var(--fy-space-3);
  background: var(--fy-paper-raised);
  border: 1px solid var(--fy-line-paper);
  border-radius: var(--fy-r-md);
  box-shadow: var(--fy-shadow-card);
}

.woocommerce ul.products li.product a img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--fy-r-sm);
  margin-bottom: 0.5rem;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--fy-font-display), sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  padding: 0;
  margin: 0;
}

.woocommerce ul.products li.product .price,
.woocommerce div.product p.price,
.woocommerce div.product span.price {
  font-family: var(--fy-font-display), sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fy-crimson);
  font-variant-numeric: tabular-nums;
}

.woocommerce ul.products li.product .button,
.woocommerce div.product form.cart .button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.9rem 1.6rem;
  background: var(--fy-crimson);
  color: #FFFFFF;
  font-family: var(--fy-font-util), sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  border: 1px solid var(--fy-crimson);
  border-radius: var(--fy-r-sm);
  transition: background var(--fy-dur) var(--fy-ease);
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover {
  background: var(--fy-crimson-deep);
  border-color: var(--fy-crimson-deep);
  color: #FFFFFF;
}

.woocommerce div.product .product_title {
  font-family: var(--fy-font-display), sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  border-top-color: var(--fy-crimson);
  background: var(--fy-paper-raised);
  color: inherit;
}

.woocommerce-message::before,
.woocommerce-info::before {
  color: var(--fy-crimson);
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce-page form .form-row input.input-text,
.select2-container .select2-selection--single {
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  background: var(--fy-paper-raised);
  color: inherit;
  font-family: var(--fy-font-body), sans-serif;
  font-size: 1rem;
  border: 1px solid var(--fy-line-paper);
  border-radius: var(--fy-r-sm);
}

.woocommerce form .form-row label,
.woocommerce-checkout label {
  font-family: var(--fy-font-util), sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fy-slate);
}

.woocommerce table.shop_table,
.woocommerce-checkout table.shop_table {
  border-radius: var(--fy-r-md);
  border-color: var(--fy-line-paper);
}

.woocommerce-checkout #payment {
  background: var(--fy-paper-raised);
  border-radius: var(--fy-r-md);
  border: 1px solid var(--fy-line-paper);
}

.woocommerce .woocommerce-breadcrumb {
  font-family: var(--fy-font-util), sans-serif;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--fy-slate);
}

.woocommerce .woocommerce-breadcrumb a {
  color: var(--fy-crimson);
}

/* Sternebewertungen sind abgeschaltet, der Platzhalter soll nicht stehen. */
.woocommerce .star-rating,
.woocommerce .woocommerce-product-rating {
  display: none;
}

/* =====================================================================
 * Block-Checkout und Block-Warenkorb
 *
 * WooCommerce rendert Kasse und Warenkorb als Bloecke mit eigenen
 * Klassen und eigenen Farbvariablen. Sie werden hier auf die Marke
 * gezogen, damit der Bezahlvorgang nicht wie ein Fremdkoerper wirkt.
 * ===================================================================== */

.wc-block-components-button:not(.is-link),
.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button {
  background: var(--fy-crimson) !important;
  color: #FFFFFF !important;
  font-family: var(--fy-font-util), sans-serif !important;
  font-size: 0.8125rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.16em !important;
  border-radius: var(--fy-r-sm) !important;
  min-height: 52px !important;
  transition: background var(--fy-dur) var(--fy-ease) !important;
}

.wc-block-components-button:not(.is-link):hover,
.wc-block-cart__submit-button:hover,
.wc-block-components-checkout-place-order-button:hover {
  background: var(--fy-crimson-deep) !important;
}

.wc-block-components-title,
.wc-block-components-checkout-step__title,
.wp-block-woocommerce-checkout-order-summary-block .wc-block-components-title {
  font-family: var(--fy-font-display), sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}

.wc-block-components-totals-item__value,
.wc-block-components-product-price,
.wc-block-formatted-money-amount {
  font-family: var(--fy-font-display), sans-serif;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
  color: var(--fy-crimson);
}

.wc-block-components-text-input input[type="text"],
.wc-block-components-text-input input[type="email"],
.wc-block-components-text-input input[type="tel"],
.wc-block-components-textarea,
.wc-blocks-components-select__select {
  border-radius: var(--fy-r-sm) !important;
  min-height: 50px;
  font-family: var(--fy-font-body), sans-serif;
}

.wc-block-components-text-input.is-active label,
.wc-block-components-checkout-step__description {
  color: var(--fy-slate);
}

.wc-block-components-checkbox .wc-block-components-checkbox__input:checked {
  background-color: var(--fy-crimson);
  border-color: var(--fy-crimson);
}

.wc-block-components-radio-control__option--checked-option-highlighted,
.wc-block-components-radio-control-accordion-option--checked-option-highlighted {
  border-color: var(--fy-crimson) !important;
  box-shadow: 0 0 0 1px var(--fy-crimson) !important;
}

.wc-block-components-notice-banner {
  border-radius: var(--fy-r-md);
}

/* Rechtstexte im Checkout sichtbar halten, nicht als Fussnote verstecken. */
.wc-gzd-checkbox-placeholder label,
.woocommerce-terms-and-conditions-wrapper label,
.wc-block-components-checkout-policies {
  font-size: 0.875rem !important;
  line-height: 1.6 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-family: var(--fy-font-body), sans-serif !important;
  color: inherit !important;
}

.wc-gzd-checkbox-placeholder a,
.woocommerce-terms-and-conditions-wrapper a {
  color: var(--fy-crimson) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Produkttitel folgen der Textfarbe, nicht der Standard-Linkfarbe. */
.woocommerce ul.products li.product a,
.woocommerce ul.products li.product a:visited,
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  color: inherit;
  text-decoration: none;
}

.woocommerce ul.products li.product a:hover .woocommerce-loop-product__title {
  color: var(--fy-crimson);
}

.woocommerce ul.products li.product a.button {
  color: #FFFFFF;
  margin-top: auto;
}

.woocommerce .woocommerce-result-count {
  font-family: var(--fy-font-util), sans-serif;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--fy-slate);
}

.woocommerce .woocommerce-ordering select,
.bde-woo-select select {
  min-height: 44px;
  padding: 0.5rem 0.8rem;
  background: var(--fy-paper-raised);
  color: inherit;
  border: 1px solid var(--fy-line-paper);
  border-radius: var(--fy-r-sm);
  font-family: var(--fy-font-body), sans-serif;
}

.fy-preis-hinweis {
  font-size: 0.8125rem;
  color: var(--fy-slate);
  max-width: 56ch;
  margin: 0.75rem 0 1.25rem;
}

/* Der Produktname als h2, weil die Vorlage bereits ein h1 setzt. */
.woocommerce div.product .product_title {
  display: none;
}

/* Links in Warenkorb und Kasse (Blocks). Ohne eigene Farbe griff die
 * Standard-Linkfarbe des Browsers, im dunklen Modus ein blasses Lila auf
 * hellem Grund. Produktnamen folgen der Textfarbe, alle anderen Links sind
 * rot. Die Knoepfe behalten ihre eigene Farbe. */
.wp-block-woocommerce-cart a:not(.wc-block-components-button),
.wp-block-woocommerce-checkout a:not(.wc-block-components-button) {
  color: var(--fy-crimson);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.wp-block-woocommerce-cart a.wc-block-components-product-name,
.wp-block-woocommerce-checkout a.wc-block-components-product-name {
  color: inherit;
  text-decoration: none;
}

.wp-block-woocommerce-cart a.wc-block-components-product-name:hover,
.wp-block-woocommerce-checkout a.wc-block-components-product-name:hover {
  color: var(--fy-crimson);
}
