/* Yakuza EV Booking — front-end styles */

/* ---------------------------------------------------------------------------
   My Account: balance panel
   --------------------------------------------------------------------------- */
.yevb-balance-box {
	margin: 2em 0;
	padding: 1.25em 1.5em;
	border: 1px solid #e6e6e6;
	border-radius: 8px;
	background: #fafafa;
}
.yevb-balance-box h2 { margin: 0 0 .75em; font-size: 1.15em; }
.yevb-balance-table { width: 100%; border-collapse: collapse; margin: 0 0 1em; }
.yevb-balance-table th,
.yevb-balance-table td {
	text-align: left;
	padding: .5em .25em;
	border-bottom: 1px solid #ececec;
	font-size: .95em;
}
.yevb-balance-table td { text-align: right; }
.yevb-actions { display: flex; flex-wrap: wrap; gap: .75em; margin: .5em 0 0; }
.yevb-actions .button { margin: 0; }
.yevb-pay-online { font-weight: 600; }
.yevb-paid { color: #1a7f37; font-weight: 600; margin: 0; }
.yevb-cod { color: #555; margin: 0 0 .75em; }
@media (max-width: 480px) {
	.yevb-actions .button { width: 100%; text-align: center; }
}

/* ---------------------------------------------------------------------------
   Injected add-to-cart fallback host
   On product pages whose theme/builder template doesn't output WooCommerce's
   own add-to-cart form (e.g. ACF Pro), the JS materialises the real form here.
   It must stay functional (so variation matching + add-to-cart work and the
   sticky bar can clone the voltage <select>), so we move it off-screen rather
   than display:none. .click(), .val().trigger('change') and form submit all
   work fine off-screen.
   --------------------------------------------------------------------------- */
#yevb-atc-host {
	position: absolute !important;
	left: -99999px !important;
	top: 0 !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	pointer-events: none;
}

/* ---------------------------------------------------------------------------
   Single product page: booking note under the price
   --------------------------------------------------------------------------- */
.yevb-pp-booking {
	margin: .6em 0 1em;
	padding: .65em .85em;
	border: 1px dashed #d8a200;
	border-radius: 8px;
	background: #fff8e6;
	line-height: 1.4;
}
.yevb-pp-booking .yevb-pp-book { display: block; font-size: 1em; color: #7a5a00; }
.yevb-pp-booking .yevb-pp-book strong { font-size: 1.1em; }
.yevb-pp-booking .yevb-pp-rest { display: block; margin-top: .15em; font-size: .82em; color: #6b6b6b; }

/* ---------------------------------------------------------------------------
   Sticky bottom bar — compact, locked, expandable.

   Mobile  : two tight rows — (name + price + toggle), then (volt + Book Now)
             side by side so the bar stays short and the page shows through.
   Desktop : a single row — name, price, volt selector, Book Now — achieved by
             flattening the two inner wrappers with `display:contents` so their
             children line up in one flex row.
   (Sizes in px so they're consistent regardless of the theme's root size.
    Font family is inherited from the theme.)
   --------------------------------------------------------------------------- */
.yevb-sticky {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	z-index: 9999;
	background: #fff;
	border-top: 1px solid #ececec;
	box-shadow: 0 -3px 14px rgba(0, 0, 0, .07);
	padding: 8px 14px;
	padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}

/* Header row: name | price | toggle */
.yevb-sticky-head { display: flex; align-items: center; gap: 10px; }
.yevb-head-name {
	flex: 1 1 auto; min-width: 0;
	font-weight: 700; font-size: 15px; line-height: 1.2;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.yevb-head-price { flex: 0 0 auto; font-weight: 800; font-size: 16px; line-height: 1.2; white-space: nowrap; }
.yevb-head-price del { font-weight: 400; opacity: .5; margin-right: .25em; font-size: .85em; }
.yevb-head-price ins { text-decoration: none; }
.yevb-sticky-toggle {
	flex: 0 0 auto;
	width: 30px; height: 30px;
	margin: 0; padding: 0;
	border: 0; border-radius: 8px;
	background: #f1f1f3; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
}
.yevb-chev {
	width: 9px; height: 9px;
	border-right: 2px solid #333; border-bottom: 2px solid #333;
	transform: rotate(225deg); /* expanded -> up (^) */
	transition: transform .2s ease;
}
.yevb-sticky:not(.is-expanded) .yevb-chev { transform: rotate(45deg); } /* collapsed -> down (v) */

/* Body (mobile): volt selector and Book Now stacked full-width, so they never
   crowd or touch each other on narrow screens. Desktop flattens this into a
   single row via `display:contents` in the media query below. */
.yevb-sticky-body { display: flex; flex-direction: column; align-items: stretch; gap: 9px; padding-top: 9px; }
.yevb-sticky:not(.is-expanded) .yevb-sticky-body { display: none; }

.yevb-sticky-variations {
	display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
	flex: 0 0 auto; min-width: 0;
}
/* Simple products have no variations: hide the empty box and let Book Now fill. */
.yevb-sticky-variations:empty { display: none; }
.yevb-sticky-variations:empty + .yevb-sticky-btn { flex: 1 1 auto; }

.yevb-field { min-width: 0; flex: 1 1 auto; }
.yevb-field-label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: #333; }

/* Inline label (beside the control) — used for the variant dropdown. */
.yevb-field-inline { display: flex; align-items: center; gap: 8px; }
.yevb-field-inline .yevb-field-label { margin-bottom: 0; flex: 0 0 auto; white-space: nowrap; }
.yevb-field-inline .yevb-mirror-select { flex: 1 1 auto; width: auto; }

/* Dropdown (custom arrow drawn as an inline SVG background). */
.yevb-mirror-select {
	width: 100%;
	appearance: none; -webkit-appearance: none; -moz-appearance: none;
	padding: 8px 30px 8px 12px;
	font-size: 14px; color: #111; line-height: 1.2;
	border: 1px solid #cfcfcf; border-radius: 8px;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M3 5l4 4 4-4' fill='none' stroke='%23777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	cursor: pointer;
	font-family: inherit;
}

/* Colour swatches. */
.yevb-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.yevb-swatch {
	width: 32px; height: 32px; padding: 0;
	border: 2px solid #d8d8d8; border-radius: 7px; cursor: pointer;
	box-shadow: inset 0 0 0 2px #fff;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.yevb-swatch.is-active { border-color: #111; box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px #111; }
.yevb-swatch-unknown {
	display: inline-flex; align-items: center; justify-content: center;
	background: #f3f3f3; box-shadow: none;
	font-size: 11px; font-weight: 700; color: #555; text-transform: uppercase;
}

/* Book Now — compact, hugs its own text (full-width only when alone). */
.yevb-sticky-btn {
	flex: 0 0 auto;
	display: inline-block; width: auto; margin: 0;
	padding: 10px 18px; border: 0; border-radius: 8px;
	background: #000; color: #fff;
	font-size: 15px; font-weight: 700; line-height: 1.2;
	white-space: nowrap; text-align: center; cursor: pointer;
	font-family: inherit;
	transition: opacity .15s ease;
}
.yevb-sticky-btn:hover { opacity: .88; }
.yevb-sticky-btn:active { transform: translateY(1px); }

/* Nudge controls when Book Now is tapped without a selection. */
.yevb-sticky.yevb-need-options .yevb-mirror-select,
.yevb-sticky.yevb-need-options .yevb-swatches {
	outline: 2px solid #d8a200;
	outline-offset: 3px;
	border-radius: 8px;
}

/* ---------------------------------------------------------------------------
   Desktop: name, price, volt selector and Book Now on ONE line.
   `display:contents` dissolves the two inner wrappers so their children become
   direct flex items of the bar, in DOM order: name, price, volt, Book Now.
   --------------------------------------------------------------------------- */
@media (min-width: 992px) {
	.yevb-sticky {
		display: flex; align-items: center; gap: 16px;
		padding: 8px 24px;
		padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
	}
	.yevb-sticky-head,
	.yevb-sticky-body,
	.yevb-sticky:not(.is-expanded) .yevb-sticky-body { display: contents; }

	/* Everything fits, so the collapse control isn't needed. */
	.yevb-sticky-toggle { display: none; }

	.yevb-head-name { flex: 1 1 auto; font-size: 16px; }   /* fills the left, pushes controls right */
	.yevb-head-price { font-size: 17px; }
	.yevb-sticky-variations { flex: 0 1 auto; }            /* hug the volt control */
	.yevb-sticky-variations:empty + .yevb-sticky-btn { flex: 0 0 auto; }
	.yevb-field { flex: 0 1 auto; }
	.yevb-sticky-btn { padding: 9px 22px; font-size: 15px; }
}
