/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

/* "Richiedi un ricambio" CTA (F1). Emitted on ricambio single, product
   "Ricambi compatibili" block and family archives; also available as
   the [g3_shop_richiedi_ricambio_cta] shortcode. */
.g3-shop-richiedi-cta-wrap {
	margin: 24px 0;
	text-align: center;
}
.g3-shop-cta--richiedi,
.g3-shop-cta--richiedi:visited {
	display: inline-block;
	padding: 12px 28px;
	background: #e30613;
	color: #fff;
	font-weight: 700;
	font-size: 15px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	text-decoration: none;
	border-radius: 3px;
	transition: background-color 0.15s ease;
}
.g3-shop-cta--richiedi:hover,
.g3-shop-cta--richiedi:focus {
	background: #b4040f;
	color: #fff;
	text-decoration: none;
}
.g3-shop-cta--richiedi--compact {
	padding: 8px 18px;
	font-size: 13px;
}

/* Inline request-form accordion. Rendered right after the "Richiedi"
   CTA when the plugin setting `render_inline_accordion` is on and the
   visitor is on a ricambio/prodotto singular. Toggled by
   public/js/g3-shop-accordion.js.

   Two-state animation:
     - hidden attribute        → display: none, container out of flow
     - no hidden, no is-expanded → collapsed (max-height:0, invisible)
     - no hidden, .is-expanded  → open (max-height cap, fully visible)
   The JS strips `hidden` first (so max-height:0 is painted), forces a
   reflow, then adds `.is-expanded`; on collapse it drops the class and
   waits for transitionend before re-adding `hidden`. */
.g3-shop-form-accordion {
	margin: 16px 0 40px;
	background: #fafafa;
	border: 1px solid #ececec;
	border-radius: 6px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	transition:
		max-height 400ms cubic-bezier(0.4, 0, 0.2, 1),
		opacity   300ms ease-out 60ms;
}
.g3-shop-form-accordion.is-expanded {
	/* Generous cap. Real form heights across breakpoints stay well
	   under this — the cap only exists because max-height can't animate
	   to `auto`; it never truncates content in practice. */
	max-height: 3000px;
	opacity: 1;
}
.g3-shop-form-accordion__inner {
	padding: 24px;
}
.g3-shop-form-accordion__title {
	margin: 0 0 16px;
	font-size: 18px;
	line-height: 1.3;
	font-weight: 700;
	color: #222;
}
.g3-shop-form-accordion__body {
	/* Fluent Forms carries its own layout; we just give it room. */
}

/* D3 guard: full-page error card that replaces the checkout content
   when the (request_id, token) pair is missing / invalid / expired /
   already paid / …. */
.g3-shop-checkout-guard {
	max-width: 640px;
	margin: 40px auto;
	padding: 32px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
	text-align: center;
}
.g3-shop-checkout-guard h2 {
	margin: 0 0 12px;
	font-size: 22px;
	color: #1d2327;
}
.g3-shop-checkout-guard p {
	margin: 0 0 12px;
	color: #333;
	line-height: 1.55;
}
.g3-shop-checkout-guard-callout {
	padding: 10px 14px;
	background: #f0f6fc;
	border-left: 3px solid #2271b1;
	color: #1d2327;
	text-align: left;
	margin: 16px 0;
}
.g3-shop-checkout-guard-actions {
	margin-top: 24px;
}
.g3-shop-checkout-guard-cta {
	display: inline-block;
	padding: 10px 20px;
	background: #2271b1;
	color: #fff;
	text-decoration: none;
	border-radius: 4px;
	font-weight: 600;
}
.g3-shop-checkout-guard-cta:hover,
.g3-shop-checkout-guard-cta:focus {
	background: #135e96;
	color: #fff;
}

/* Hide the Custom Payment field on the checkout form: FF Pro needs it
   present so payment_method renders, but we don't want the customer to
   see a duplicate amount input next to the cart summary. Tag the field
   with this class in FF admin (Advanced → Container Class). */
.g3-shop-hidden-payment,
.g3-shop-hidden-payment.ff-el-form-control,
.g3-shop-hidden-payment .ff-el-input--content,
.ff-el-group.g3-shop-hidden-payment {
	display: none !important;
}

/* Customer recap rendered by [g3_shop_checkout_customer_info]. */
.g3-shop-checkout-customer {
	margin: 24px 0;
	padding: 16px 20px;
	background: #f7f7f7;
	border-left: 4px solid #333;
	font-size: 14px;
}
.g3-shop-checkout-customer h3 {
	margin: 0 0 10px;
	font-size: 15px;
}
.g3-shop-checkout-customer h3:not(:first-child) {
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid #e5e5e5;
}
.g3-shop-checkout-customer-fields {
	display: grid;
	grid-template-columns: 100px 1fr;
	gap: 4px 12px;
	margin: 0;
}
.g3-shop-checkout-customer-fields dt {
	font-weight: 600;
	color: #555;
	margin: 0;
}
.g3-shop-checkout-customer-fields dd {
	margin: 0;
}
.g3-shop-checkout-customer-address {
	margin: 0;
	font-style: normal;
	line-height: 1.6;
}
.g3-shop-checkout-customer-note {
	margin: 16px 0 0;
	padding-top: 12px;
	border-top: 1px solid #e5e5e5;
	font-size: 13px;
	color: #666;
	font-style: italic;
}

/* Checkout summary rendered by [g3_shop_checkout_summary]. */
.g3-shop-checkout-summary {
	margin: 24px 0;
}
.g3-shop-checkout-summary h3 {
	margin: 0 0 12px;
}
.g3-shop-checkout-summary-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}
.g3-shop-checkout-summary-table th,
.g3-shop-checkout-summary-table td {
	padding: 8px 10px;
	border-bottom: 1px solid #e5e5e5;
	text-align: left;
	vertical-align: top;
}
.g3-shop-checkout-summary-table th {
	background: #f7f7f7;
	font-weight: 600;
}
.g3-shop-checkout-summary-table .g3-shop-num {
	text-align: right;
	white-space: nowrap;
}
.g3-shop-checkout-summary-table small {
	color: #666;
}
.g3-shop-checkout-summary-table tfoot td {
	border-bottom: none;
}
.g3-shop-checkout-summary-table tfoot tr:last-child td {
	border-top: 2px solid #333;
	font-size: 15px;
	padding-top: 10px;
}

.g3-shop-checkout-error {
	background: #ffebee;
	border: 1px solid #c62828;
	color: #b71c1c;
	padding: 12px 16px;
	border-radius: 4px;
}