/* ==========================================================================
   Red River Gorge Petting Zoo — Ticket product page
   Styles the FooEvents variations table form, booking date selector,
   feed treats add-on, and add-to-cart button to match the brand.
   Brand: Primary Red #c12326, Black #000, White #fff, Cream #faf4e6
   Fonts: Poppins (headings), Open Sans (body) — enqueue/load separately
   ========================================================================== */

:root {
	--rrg-red: #c12326;
	--rrg-red-dark: #9a1b1e;
	--rrg-black: #1a1a1a;
	--rrg-white: #ffffff;
	--rrg-cream: #faf4e6;
	--rrg-gray: #f4f2ee;
	--rrg-muted: #6a6a6a;
	--rrg-line: #e4e1da;
}

/* ---- Product title & price ---- */
.woocommerce div.product .product_title {
	font-family: 'Poppins', sans-serif;
	font-weight: 700;
	color: var(--rrg-black);
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
	color: var(--rrg-red);
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
}

/* ---- Form as a flex column so we can order children ---- */
.fooevents-variations-table-form {
	display: flex !important;
	flex-direction: column;
	max-width: 640px;
	gap: 20px;
	margin: 0 auto !important;
	opacity: 0;
	transition: opacity 0.4s ease;
}

.fooevents-variations-table-form.rrg-ready {
	opacity: 1;
}

/* Explicit order for every direct child, mockup sequence:
   date selector (1), ticket table (2), feed treats (3), summary (4), button (5) */
.fooevents-variations-table-form > #fooevents_bookings_date_val__trans_field,
.fooevents-variations-table-form > .fooevents-bookings-date,
.fooevents-variations-table-form > .mb-foodate-input { order: 11; }
.fooevents-variations-table-form > .fooevents-variations-table { order: 21; }
.fooevents-variations-table-form > .rrg-addon-field { order: 31; }
.fooevents-variations-table-form > .rrg-summary { order: 40; }
.fooevents-variations-table-form > .single_add_to_cart_button { order: 50; }
.fooevents-variations-table-form > input[type="hidden"],
.fooevents-variations-table-form > #fooevents_bookings_method_field { order: 0; }

/* Hide the empty booking-method form row (hidden input still functions) */
.fooevents-variations-table-form > #fooevents_bookings_method_field {
	display: none !important;
}

/* Remove the clearfix pseudo-elements that add an empty gap in the flex form */
.woocommerce div.product form.cart.fooevents-variations-table-form::before,
.woocommerce div.product form.cart.fooevents-variations-table-form::after {
	display: none !important;
	content: none !important;
}

/* Injected step headers share order with the section they precede;
   DOM order (header inserted right before section) keeps them above it. */
.fooevents-variations-table-form > .rrg-step-date { order: 10; }
.fooevents-variations-table-form > .rrg-step-tickets { order: 20; }
.fooevents-variations-table-form > .rrg-step-treats { order: 30; }

/* ---- Step headers + helper notes ---- */
.rrg-step-label {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	font-size: 19px;
	color: var(--rrg-black);
	margin-bottom: 6px;
}

.rrg-step-num {
	background: var(--rrg-red);
	color: var(--rrg-white);
	width: 26px;
	height: 26px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 700;
	flex-shrink: 0;
}

.rrg-step-help {
	color: var(--rrg-muted);
	font-size: 14px;
	margin: 0 0 4px 36px;
}

/* ---- Booking date selector ---- */
.fooevents-bookings-date label,
.fooevents-bookings-date .required_field {
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	color: var(--rrg-black);
	display: block;
	margin-bottom: 6px;
}

.mb-foodate-input.flatpickr-input,
#fooevents_bookings_date_val__trans {
	width: 100%;
	padding: 14px 16px;
	font-size: 16px;
	border: 1.5px solid var(--rrg-line);
	border-radius: 10px;
	color: var(--rrg-black);
	background: var(--rrg-white);
	cursor: pointer;
}

.mb-foodate-input.flatpickr-input:focus,
#fooevents_bookings_date_val__trans:focus {
	outline: none;
	border-color: var(--rrg-red);
}

/* ---- Ticket variations: rebuild table as stacked cards ---- */
.fooevents-variations-table,
.fooevents-variations-table tbody {
	display: block;
	width: 100%;
	border: none;
}

.fooevents-variation-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	background: var(--rrg-gray);
	border-radius: 12px;
	padding: 16px 18px;
	margin: 0 0 12px;
}

.fooevents-variation-row td {
	display: block;
	padding: 0;
	border: none;
	background: transparent !important;
}

/* Name + detail line block: left side */
.fooevents-variation-row__details {
	flex: 1 1 auto;
	order: 1;
}

.fooevents-variation-row__details label {
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	font-size: 17px;
	color: var(--rrg-black);
	margin: 0;
	display: block;
}

.rrg-detail {
	display: block;
	font-family: 'Open Sans', sans-serif;
	font-weight: 400;
	font-size: 13px;
	color: var(--rrg-muted);
	margin-top: 2px;
}

/* Per-ticket price, stacked under the detail line, red */
.rrg-perprice {
	display: block;
	font-family: 'Open Sans', sans-serif;
	font-weight: 700;
	font-size: 14px;
	color: var(--rrg-red);
	margin-top: 2px;
}

/* Hide the now-empty description cell and the original price cell */
.fooevents-variation-row__description,
.fooevents-variation-row__price {
	display: none !important;
}

/* Stepper on the right */
.fooevents-variation-row .woocommerce-grouped-product-list-item__quantity,
.fooevents-variation-row__quantity {
	order: 2;
	flex: 0 0 auto;
	width: auto !important;
	min-width: 0;
	max-width: none;
	overflow: visible;
	text-align: left;
}

.fooevents-variation-row .rrg-stepper {
	flex-wrap: nowrap;
	white-space: nowrap;
}

/* ---- Steppers (built by JS) ---- */
.fooevents-variation-row .rrg-stepper,
.rrg-addon-field .rrg-stepper {
	display: flex !important;
	align-items: center;
	gap: 12px;
	width: auto;
	position: relative;
}

.fooevents-variation-row .rrg-stepper > .rrg-dec,
.fooevents-variation-row .rrg-stepper > .rrg-inc,
.fooevents-variation-row .rrg-stepper > input,
.rrg-addon-field .rrg-stepper > .rrg-dec,
.rrg-addon-field .rrg-stepper > .rrg-inc,
.rrg-addon-field .rrg-stepper > input {
	position: static !important;
	float: none !important;
	margin: 0 !important;
	flex: 0 0 auto;
}

.rrg-stepper input.qty,
.rrg-stepper input[type="number"] {
	width: 44px !important;
	min-width: 44px;
	text-align: center;
	font-family: 'Poppins', sans-serif;
	font-weight: 700;
	font-size: 18px;
	border: none !important;
	background: transparent !important;
	padding: 0 !important;
	-moz-appearance: textfield;
}

.rrg-stepper input::-webkit-outer-spin-button,
.rrg-stepper input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.fooevents-variations-table-form .rrg-dec,
.fooevents-variations-table-form .rrg-inc {
	width: 40px !important;
	height: 40px !important;
	min-width: 40px;
	padding: 0 !important;
	border-radius: 50% !important;
	font-size: 22px !important;
	line-height: 1 !important;
	cursor: pointer;
	transition: all 0.1s ease;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
}

.fooevents-variations-table-form .rrg-dec {
	background: var(--rrg-white) !important;
	border: 1.5px solid var(--rrg-line) !important;
	color: var(--rrg-black) !important;
}

.fooevents-variations-table-form .rrg-dec:hover {
	border-color: var(--rrg-red) !important;
	color: var(--rrg-red) !important;
}

.fooevents-variations-table-form .rrg-inc {
	background: var(--rrg-red) !important;
	border: none !important;
	color: var(--rrg-white) !important;
}

.fooevents-variations-table-form .rrg-inc:hover {
	background: var(--rrg-red-dark) !important;
}

.rrg-dec:active,
.rrg-inc:active {
	transform: scale(0.9);
}

/* ---- Live summary (built by JS) ---- */
.rrg-summary {
	background: var(--rrg-cream);
	border-radius: 12px;
	padding: 22px 24px;
}

.rrg-sum-line {
	display: flex;
	justify-content: space-between;
	font-size: 15px;
	margin-bottom: 10px;
}

.rrg-sum-line span:first-child { color: #555; }
.rrg-sum-line span:last-child { font-weight: 600; color: var(--rrg-black); }

.rrg-sum-empty { color: var(--rrg-muted); font-size: 14px; }

.rrg-sum-divider {
	height: 1px;
	background: rgba( 0, 0, 0, 0.1 );
	margin: 6px 0 14px;
}

.rrg-total-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}

.rrg-total-lbl {
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	font-size: 18px;
	color: var(--rrg-black);
}

.rrg-total-amt {
	font-family: 'Poppins', sans-serif;
	font-weight: 700;
	font-size: 30px;
	color: var(--rrg-red);
}

/* ---- Feed treats add-on field ---- */
.rrg-addon-field {
	background: var(--rrg-gray);
	border-radius: 12px;
	padding: 16px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
}

.rrg-addon-label {
	margin-bottom: 0 !important;
}

.rrg-addon-label {
	display: block;
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	font-size: 17px;
	color: var(--rrg-black);
	margin-bottom: 8px;
}

/* Treats input now uses the shared .rrg-stepper styling (see steppers above) */

/* ---- Add to cart button ---- */
.fooevents-variations-table-form .single_add_to_cart_button {
	background: var(--rrg-red) !important;
	color: var(--rrg-white) !important;
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	font-size: 17px;
	padding: 16px 32px;
	border: none !important;
	border-radius: 10px !important;
	cursor: pointer;
	transition: background 0.15s ease;
	align-self: stretch;
	width: 100%;
	text-align: center;
}

.fooevents-variations-table-form .single_add_to_cart_button:hover {
	background: var(--rrg-red-dark) !important;
}

/* Kill Elementor's left margin on non-first-child buttons */
.fooevents-variations-table-form .single_add_to_cart_button,
.woocommerce div.product .fooevents-variations-table-form button.single_add_to_cart_button {
	margin-left: 0 !important;
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
	.fooevents-variation-row__details label { font-size: 16px; }
	.fooevents-variations-table-form .single_add_to_cart_button {
		width: 100%;
		align-self: stretch;
		text-align: center;
	}
}
/* ---- Hide FooEvents-generated elements superseded by step headers ---- */
.fooevents-variations-table-form #fooevents-checkout-attendee-info-val-trans {
        display: none !important;
}
.fooevents-variations-table-form .fooevents-bookings-date label.required_field {
        display: none !important;
}
