/* Warenkorb, Kasse und Mein Konto im SAMA-Design (WooCommerce-Blöcke). */

body.woocommerce-cart,
body.woocommerce-checkout,
body.woocommerce-account {
	--sama-k-gruen: var(--sama-primaer, #298931);
	--sama-k-gruen-dunkel: var(--sama-primaer-dunkel, #0d4f2b);
	--sama-k-blau: var(--sama-anthrazit, #0e1f58);
	--sama-k-text: var(--sama-text, #2b2f3a);
	--sama-k-grau: var(--sama-text-gedaempft, #525866);
	--sama-k-linie: var(--sama-linie, #dde3e1);
	--sama-k-hell: #f3f5f4;
	background: #fff;
}

/* Rahmen und Seitentitel */
body.woocommerce-cart .site-main,
body.woocommerce-checkout .site-main,
body.woocommerce-account .site-main {
	max-width: 1180px;
	margin: 0 auto;
	padding: 40px 16px 80px;
	font-family: var(--sama-schrift, Manrope), system-ui, sans-serif;
	color: var(--sama-k-text);
}
body.woocommerce-cart .page-header .entry-title,
body.woocommerce-checkout .page-header .entry-title,
body.woocommerce-account .page-header .entry-title {
	font-family: inherit;
	font-weight: 800;
	font-size: clamp(30px, 2.4vw + 14px, 42px);
	line-height: 1.15;
	letter-spacing: -0.02em;
	color: var(--sama-k-blau);
	margin: 0 0 28px;
}
body.woocommerce-cart .wp-block-woocommerce-cart,
body.woocommerce-checkout .wp-block-woocommerce-checkout { font-family: inherit; color: var(--sama-k-text); }
body.woocommerce-cart h2,
body.woocommerce-checkout h2,
body.woocommerce-checkout .wc-block-components-title,
body.woocommerce-account h2 { font-family: inherit; font-weight: 800; color: var(--sama-k-blau); }

/* Hello-Theme: alignwide hat negative Ränder – Blöcke bündig im Rahmen halten */
body.woocommerce-cart .site-main .alignwide,
body.woocommerce-checkout .site-main .alignwide { margin-left: 0 !important; margin-right: 0 !important; max-width: 100% !important; width: auto !important; }

/* Links */
body.woocommerce-cart .site-main a:not(.wc-block-components-button):not(.sama-whatsapp):not(.sama-leer__btn),
body.woocommerce-checkout .site-main a:not(.wc-block-components-button):not(.sama-whatsapp),
body.woocommerce-account .site-main a:not(.button):not(.sama-whatsapp) { color: var(--sama-k-gruen); }
body.woocommerce-cart .site-main a:hover,
body.woocommerce-checkout .site-main a:hover { color: var(--sama-k-gruen-dunkel); }

/* Buttons */
body.woocommerce-cart .wc-block-components-button:not(.is-link),
body.woocommerce-checkout .wc-block-components-button:not(.is-link),
body.woocommerce-cart .wp-block-button__link,
body.woocommerce-account .button,
body.woocommerce-account button[type="submit"] {
	background: var(--sama-k-gruen) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 12px !important;
	font-family: inherit;
	font-weight: 800 !important;
	font-size: 17px !important;
	min-height: 52px;
	padding: 14px 24px !important;
	text-decoration: none !important;
	box-shadow: none !important;
	transition: background .15s;
}
body.woocommerce-cart .wc-block-components-button:not(.is-link):hover,
body.woocommerce-checkout .wc-block-components-button:not(.is-link):hover,
body.woocommerce-cart .wp-block-button__link:hover,
body.woocommerce-account .button:hover { background: var(--sama-k-gruen-dunkel) !important; }
body.woocommerce-cart .wc-block-components-button:focus-visible,
body.woocommerce-checkout .wc-block-components-button:focus-visible { outline: 3px solid var(--sama-k-gruen); outline-offset: 2px; }
body.woocommerce-cart .wc-block-components-button .wc-block-components-button__text { text-decoration: none; }

/* Gefüllter Warenkorb: Positionen */
body.woocommerce-cart .wc-block-cart-items { border-color: var(--sama-k-linie); }
body.woocommerce-cart .wc-block-cart-items th { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sama-k-grau); }
body.woocommerce-cart .wc-block-cart-items td { border-color: var(--sama-k-linie) !important; }
body.woocommerce-cart .wc-block-cart-item__image img { border-radius: 10px; background: var(--sama-k-hell); aspect-ratio: 4 / 5; object-fit: contain; padding: 4px; }
body.woocommerce-cart .wc-block-components-product-name { font-weight: 800; font-size: 17px; color: var(--sama-k-blau) !important; text-decoration: none; }
body.woocommerce-cart .wc-block-components-product-metadata,
body.woocommerce-checkout .wc-block-components-product-metadata { font-size: 14px; color: var(--sama-k-grau); line-height: 1.5; }
body.woocommerce-cart .wc-block-components-product-metadata__description,
body.woocommerce-checkout .wc-block-components-product-metadata__description { display: none; }
body.woocommerce-cart .wc-block-components-product-details,
body.woocommerce-checkout .wc-block-components-product-details { margin: 6px 0 0; padding: 0; list-style: none; }
body.woocommerce-cart .wc-block-components-product-details li,
body.woocommerce-checkout .wc-block-components-product-details li { margin: 0 0 2px; }
body.woocommerce-cart .wc-block-components-product-details__name,
body.woocommerce-checkout .wc-block-components-product-details__name { font-weight: 700; color: var(--sama-k-text); }
body.woocommerce-cart .wc-block-cart-item__total,
body.woocommerce-cart .wc-block-components-product-price { font-weight: 800; color: var(--sama-k-blau); }
body.woocommerce-cart .wc-block-components-quantity-selector { border-radius: 10px; border-color: var(--sama-k-linie); }
body.woocommerce-cart .wc-block-components-quantity-selector::after { border-color: var(--sama-k-linie) !important; border-radius: 10px; }
body.woocommerce-cart .wc-block-cart-item__remove-link { color: var(--sama-k-grau) !important; font-size: 14px !important; }

/* Summen-Box (Warenkorb und Kasse) */
body.woocommerce-cart .wp-block-woocommerce-cart-totals-block,
body.woocommerce-checkout .wp-block-woocommerce-checkout-order-summary-block {
	background: var(--sama-k-hell);
	border: 1px solid var(--sama-k-linie);
	border-radius: 16px;
	padding: 24px;
}
body.woocommerce-checkout .wp-block-woocommerce-checkout-order-summary-block { padding: 8px 20px; }
body.woocommerce-cart .wc-block-cart__totals-title { font-size: 15px !important; font-weight: 800 !important; letter-spacing: .06em; color: var(--sama-k-blau) !important; }
body.woocommerce-cart .wc-block-components-totals-wrapper,
body.woocommerce-checkout .wc-block-components-totals-wrapper { border-color: var(--sama-k-linie) !important; }
body.woocommerce-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__label,
body.woocommerce-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__value,
body.woocommerce-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__label,
body.woocommerce-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__value { font-weight: 800; font-size: 20px; color: var(--sama-k-blau); }
body.woocommerce-cart .wc-block-cart__submit { margin-top: 16px; }
body.woocommerce-cart .wc-block-cart__submit-button { width: 100%; }

/* Formulare (Kasse, Gutschein) */
body.woocommerce-cart .wc-block-components-text-input input,
body.woocommerce-checkout .wc-block-components-text-input input,
body.woocommerce-checkout .wc-block-components-textarea,
body.woocommerce-checkout .wc-blocks-components-select__select,
body.woocommerce-checkout .wc-block-components-combobox .components-combobox-control__input,
body.woocommerce-account input.input-text {
	border: 1px solid #c9d1ce !important;
	border-radius: 10px !important;
	background: #fff;
	font-family: inherit;
}
body.woocommerce-cart .wc-block-components-text-input input:focus,
body.woocommerce-checkout .wc-block-components-text-input input:focus,
body.woocommerce-checkout .wc-block-components-textarea:focus,
body.woocommerce-checkout .wc-blocks-components-select__select:focus,
body.woocommerce-account input.input-text:focus {
	border-color: var(--sama-k-gruen) !important;
	box-shadow: 0 0 0 1px var(--sama-k-gruen) !important;
	outline: none;
}
body.woocommerce-checkout .wc-block-components-checkbox__input:checked,
body.woocommerce-checkout .wc-block-components-radio-control__input:checked { border-color: var(--sama-k-gruen); background-color: var(--sama-k-gruen); }
body.woocommerce-checkout .wc-block-components-radio-control__input:checked::before { background: #fff; }
body.woocommerce-checkout .wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control-accordion-option--checked-option-highlighted,
body.woocommerce-checkout .wc-block-components-radio-control--highlight-checked label.wc-block-components-radio-control__option--checked-option-highlighted { box-shadow: inset 0 0 0 2px var(--sama-k-gruen); border-radius: 10px; }
body.woocommerce-checkout .wc-block-components-checkout-step__title { font-weight: 800; color: var(--sama-k-blau); }
body.woocommerce-checkout .wc-block-components-checkout-step__heading-content,
body.woocommerce-checkout .wc-block-components-checkout-step__description { color: var(--sama-k-grau); }
body.woocommerce-checkout .wc-block-checkout__actions_row .wc-block-components-checkout-place-order-button { width: 100%; }
body.woocommerce-checkout .wc-block-components-order-summary-item__image img { border-radius: 8px; background: var(--sama-k-hell); }

/* Leerer Warenkorb */
.sama-leer { max-width: 640px; margin: 8px auto 56px; text-align: center; }
.sama-leer__icon { display: inline-flex; align-items: center; justify-content: center; width: 88px; height: 88px; border-radius: 50%; background: #e7f3e8; color: var(--sama-k-gruen); margin-bottom: 20px; }
.sama-leer__titel { font-size: clamp(24px, 1.6vw + 14px, 32px) !important; margin: 0 0 10px !important; color: var(--sama-k-blau); }
.sama-leer__text { font-size: 17px; line-height: 1.65; color: var(--sama-k-grau); margin: 0 0 24px; }
.sama-leer__aktionen { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
.sama-leer__btn { display: inline-flex; align-items: center; min-height: 52px; padding: 14px 26px; border-radius: 12px; background: var(--sama-k-gruen); color: #fff !important; font-weight: 800; text-decoration: none !important; transition: background .15s; }
.sama-leer__btn:hover { background: var(--sama-k-gruen-dunkel); }
.sama-leer__btn--rahmen { background: transparent; color: var(--sama-k-blau) !important; box-shadow: inset 0 0 0 2px var(--sama-k-blau); }
.sama-leer__btn--rahmen:hover { background: var(--sama-k-blau); color: #fff !important; }
.sama-leer__btn:focus-visible { outline: 3px solid var(--sama-k-gruen); outline-offset: 2px; }
body.woocommerce-cart .wp-block-woocommerce-empty-cart-block .wp-block-separator { display: none; }
body.woocommerce-cart .wp-block-woocommerce-empty-cart-block .sama-leer-produkte-titel { text-align: center; font-size: clamp(22px, 1.4vw + 14px, 28px); margin: 0 0 24px; }

/* Produktkacheln (Leerer Warenkorb / Cross-Sells) */
body.woocommerce-cart .wc-block-grid__products { gap: 24px; margin: 0 !important; }
body.woocommerce-cart .wc-block-grid__product {
	border: 1px solid var(--sama-k-linie) !important;
	border-radius: 16px;
	padding: 16px !important;
	background: #fff;
	display: flex;
	flex-direction: column;
	text-align: left !important;
	flex: 1 1 0 !important;
	max-width: none !important;
	margin: 0 !important;
}
body.woocommerce-cart .wc-block-grid__product-image img { aspect-ratio: 4 / 5; object-fit: contain; background: var(--sama-k-hell); border-radius: 10px; padding: 8px; }
body.woocommerce-cart .wc-block-grid__product-link { text-decoration: none !important; }
body.woocommerce-cart .wc-block-grid__product-title { font-family: inherit; font-weight: 800 !important; font-size: 17px !important; line-height: 1.3; color: var(--sama-k-gruen); margin: 14px 0 8px !important; text-decoration: none; }
body.woocommerce-cart .wc-block-grid__product-price { font-weight: 800; font-size: 19px !important; color: var(--sama-k-blau); margin: 0 0 4px !important; }
body.woocommerce-cart .wc-block-grid__product .wc-gzd-additional-info,
body.woocommerce-cart .wc-block-grid__product .wc-gzd-additional-info a { font-size: 12px !important; color: var(--sama-k-grau) !important; margin: 0 !important; line-height: 1.5; }
body.woocommerce-cart .wc-block-grid__product-add-to-cart { margin-top: auto !important; padding-top: 14px; }
body.woocommerce-cart .wc-block-grid__product-add-to-cart .wp-block-button__link { width: 100%; justify-content: center; font-size: 16px !important; min-height: 48px; }

@media (max-width: 767px) {
	body.woocommerce-cart .site-main,
	body.woocommerce-checkout .site-main,
	body.woocommerce-account .site-main { padding-top: 28px; }
	body.woocommerce-cart .wc-block-grid__products { display: grid !important; grid-template-columns: 1fr 1fr; gap: 12px; }
	body.woocommerce-cart .wc-block-grid__product { padding: 10px !important; }
	body.woocommerce-cart .wc-block-grid__product-title { font-size: 15px !important; }
	body.woocommerce-cart .wp-block-woocommerce-cart-totals-block { padding: 16px; }
}

/* Adressformular: Straße + Hausnummer in einer Zeile, „+ Adresszusatz“ danach.
   WooCommerce rendert den Adresszusatz-Link fest hinter address_1 – daher Reihenfolge per order.
   Breiten per Media Query, weil die Größenklassen der Block-Kasse (is-large …) nicht immer gesetzt sind. */
body.woocommerce-checkout .wc-block-components-address-form { display: flex !important; flex-wrap: wrap !important; justify-content: space-between; }
body.woocommerce-checkout .wc-block-components-address-form > * { order: 3; flex: 0 0 100% !important; max-width: 100%; }
body.woocommerce-checkout .wc-block-components-address-form > .wc-block-components-address-form__country,
body.woocommerce-checkout .wc-block-components-address-form > .wc-block-components-address-form__first_name,
body.woocommerce-checkout .wc-block-components-address-form > .wc-block-components-address-form__last_name,
body.woocommerce-checkout .wc-block-components-address-form > .wc-block-components-address-form__company,
body.woocommerce-checkout .wc-block-components-address-form > .wc-block-components-address-form__address_1,
body.woocommerce-checkout .wc-block-components-address-form > .wc-block-components-address-form__sama-hausnummer { order: 1; }
body.woocommerce-checkout .wc-block-components-address-form > .wc-block-components-address-form__address_2-toggle,
body.woocommerce-checkout .wc-block-components-address-form > .wc-block-components-address-form__address_2,
body.woocommerce-checkout .wc-block-components-address-form > .wc-block-components-address-form__address_2-hidden-input { order: 2; }
body.woocommerce-checkout .wc-block-components-address-form > .wc-block-components-address-form__address_1 { flex-basis: calc(58% - 6px) !important; }
body.woocommerce-checkout .wc-block-components-address-form > .wc-block-components-address-form__sama-hausnummer { flex-basis: calc(42% - 6px) !important; }
@media (min-width: 768px) {
	body.woocommerce-checkout .wc-block-components-address-form > .wc-block-components-address-form__first_name,
	body.woocommerce-checkout .wc-block-components-address-form > .wc-block-components-address-form__last_name,
	body.woocommerce-checkout .wc-block-components-address-form > .wc-block-components-address-form__postcode,
	body.woocommerce-checkout .wc-block-components-address-form > .wc-block-components-address-form__city { flex-basis: calc(50% - 6px) !important; }
	body.woocommerce-checkout .wc-block-components-address-form > .wc-block-components-address-form__address_1 { flex-basis: calc(72% - 6px) !important; }
	body.woocommerce-checkout .wc-block-components-address-form > .wc-block-components-address-form__sama-hausnummer { flex-basis: calc(28% - 6px) !important; }
}
