/* Cebu Food Trays — ordering UI */

:root {
	--cft-blue-grey: #8FA3C4;
	--cft-teal-blue: #3D7A94;
	--cft-orange: #E8862E;
	--cft-gold: #F0C877;
	--cft-olive: #C3C14A;
	--cft-dark: #2B2B2B;
	--cft-cream: #FBF8F3;
}

/* ---------- Menu grid ---------- */
.cft-menu-category-title {
	margin: 40px 0 18px;
	font-weight: 700;
}
.cft-menu-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 22px;
	margin-bottom: 12px;
}
.cft-menu-card {
	display: flex;
	flex-direction: column;
}
.cft-menu-card-img img {
	width: 100%;
	height: 170px;
	object-fit: cover;
	display: block;
}
.cft-menu-card-body {
	padding: 16px 18px 18px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1;
}
.cft-menu-card-title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
}
.cft-menu-card-excerpt {
	color: #666;
	font-size: 14px;
	margin: 0;
	flex: 1;
}
.cft-menu-card-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 10px;
}
.cft-menu-card-price {
	font-weight: 700;
	color: var(--cft-teal-blue);
}

/* ---------- Buttons ---------- */
.cft-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 12px 26px;
	border: none;
	border-radius: 999px;
	background: var(--cft-orange);
	color: #fff;
	font-weight: 700;
	font-family: 'Montserrat', sans-serif;
	cursor: pointer;
	transition: opacity .15s ease, transform .1s ease;
}
.cft-btn:hover { opacity: .9; }
.cft-btn:active { transform: scale(0.98); }
.cft-btn-sm { padding: 8px 18px; font-size: 13px; }
.cft-btn-block { width: 100%; }
.cft-btn-dark { background: var(--cft-dark); }
.cft-btn-primary { background: var(--cft-orange); }
.cft-btn-outline {
	/* !important throughout: Astra's own dynamic link-color CSS (from
	   Customizer > Colors) targets plain `a` elements with a selector that
	   otherwise wins the cascade against a single-class rule like this one
	   whenever this button is rendered as an <a> (e.g. "View My Orders" on
	   the order confirmation page) rather than a <button> — the same class
	   of theme-vs-plugin specificity fight already worked around elsewhere
	   in this file (see .cft-qty-btn:hover above). Without it, the text
	   renders in Astra's link color (near-white here) and becomes
	   unreadable against this button's transparent background. */
	background: transparent !important;
	border: 2px solid var(--cft-teal-blue) !important;
	color: var(--cft-teal-blue) !important;
}
.cft-btn-outline:hover { color: #fff !important; background: var(--cft-teal-blue) !important; }
.cft-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Modal ---------- */
.cft-overlay {
	position: fixed;
	inset: 0;
	background: rgba(20, 20, 20, 0.55);
	z-index: 100000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	overflow-y: auto;
	padding: 40px 16px;
}
.cft-overlay[hidden] { display: none; }

/* Google's new Place Autocomplete element (Places UI Kit) auto-adapts to
   the visitor's OS/browser dark-mode preference, which was rendering it
   with a black surface even though the rest of our form is white. Force
   it to always render in light mode and match our field styling. */
gmp-place-autocomplete,
#cft-delivery-address-gmp {
	color-scheme: light;
	--gmp-mat-color-surface: #ffffff;
	--gmp-mat-color-on-surface: var(--cft-dark);
	--gmp-mat-color-on-surface-variant: #666666;
	--gmp-mat-color-outline-decorative: #dcdcdc;
	--gmp-mat-color-primary: var(--cft-teal-blue);
	width: 100%;
	display: block;
}

/* Flatpickr's calendar popup is appended to <body> with its own z-index,
   which sat BELOW our modal overlay (z-index: 100000) — meaning clicking
   the date field opened a calendar that was rendered but invisible,
   hidden underneath the modal. Force it above everything in the modal. */
.flatpickr-calendar {
	z-index: 100050 !important;
}

.cft-modal {
	background: #fff;
	border-radius: 20px;
	max-width: 560px;
	width: 100%;
	padding: 32px 32px 28px;
	position: relative;
	box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.cft-modal-close {
	position: absolute;
	top: 18px;
	right: 20px;
	background: none;
	border: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #888;
}
.cft-modal-title {
	text-align: center;
	margin: 0 0 20px;
	font-weight: 800;
	font-size: 22px;
	line-height: 1.2;
}

.cft-steps {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-bottom: 26px;
	color: #999;
	font-weight: 600;
	font-size: 14px;
}
.cft-step { display: flex; align-items: center; gap: 8px; }
.cft-step-num {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #eee;
	color: #999;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
}
.cft-step-active { color: var(--cft-dark); }
.cft-step-active .cft-step-num { background: var(--cft-orange); color: #fff; }
.cft-step-line { width: 40px; height: 1px; background: #ddd; }

.cft-label {
	display: block;
	font-weight: 700;
	margin-bottom: 8px;
	font-size: 14px;
}
.cft-add-item-box {
	border: 1px solid #eee;
	border-radius: 14px;
	padding: 18px;
	margin-bottom: 18px;
}
.cft-add-item-box select#cft-item-select { margin-bottom: 14px; }

/* Hardened against theme global form/button styles that can override us
   (mismatched specificity between e.g. `input[type=number]` and our
   classes, or a parent theme forcing white button text). */
#cft-item-select,
#cft-delivery-time,
#cft-delivery-area,
select.cft-input {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	box-sizing: border-box !important;
	height: 52px !important;
	line-height: 52px !important; /* height === line-height reliably vertical-centers single-line text in a <select> across browsers, unlike padding-based centering */
	padding: 0 40px 0 16px !important;
	width: 100% !important;
	color: var(--cft-dark) !important;
	background-color: #fff !important;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%232B2B2B' d='M5.5 7.5l4.5 4.5 4.5-4.5z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 16px;
}

.cft-cart-lines { margin-bottom: 8px; }
.cft-cart-line {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) 92px 78px 24px;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px solid #f0f0f0;
	gap: 10px;
}
.cft-cart-line-name {
	font-weight: 600 !important;
	font-size: 14px !important;
	line-height: 1.3 !important;
	min-width: 0 !important;
	width: 100% !important;
	white-space: nowrap !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
	display: block !important;
}
.cft-qty-stepper {
	display: flex !important;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 92px !important;
	flex: none !important;
}
.cft-qty-btn {
	width: 24px !important;
	height: 24px !important;
	min-width: 24px;
	border-radius: 50% !important;
	border: 1px solid #ccc !important;
	background: #fff !important;
	color: var(--cft-dark) !important;
	cursor: pointer;
	font-weight: 700 !important;
	font-size: 15px !important;
	line-height: 1 !important;
	padding: 0 !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.cft-qty-btn:hover { background: var(--cft-cream) !important; border-color: var(--cft-teal-blue) !important; }
.cft-qty-input {
	width: 34px !important;
	max-width: 34px;
	text-align: center !important;
	border: none !important;
	background: transparent !important;
	color: var(--cft-dark) !important;
	font-weight: 600 !important;
	font-size: 14px !important;
	padding: 0 !important;
	box-shadow: none !important;
}
.cft-qty-input:focus { box-shadow: none !important; border: none !important; }
.cft-cart-line-price {
	font-weight: 700 !important;
	font-size: 14px !important;
	color: var(--cft-gold) !important;
	width: 78px !important;
	text-align: right !important;
	white-space: nowrap !important;
}
.cft-cart-line-remove {
	background: none !important;
	border: none !important;
	color: #c33 !important;
	cursor: pointer;
	font-size: 16px !important;
	width: 24px !important;
	padding: 0 !important;
	justify-self: center;
}

.cft-cart-total-row {
	display: flex;
	justify-content: space-between;
	padding: 14px 0;
	border-top: 2px solid #eee;
	margin-bottom: 18px;
}
.cft-order-summary { margin-bottom: 18px; }
.cft-order-summary .cft-cart-total-row {
	padding: 8px 0;
	border-top: none;
	border-bottom: 1px solid #f0f0f0;
	margin-bottom: 0;
	font-size: 14px;
	color: #555;
}
.cft-order-summary .cft-cart-grand-total {
	border-top: 2px solid #eee;
	border-bottom: none;
	padding-top: 14px;
	margin-top: 4px;
	font-size: 16px;
	color: var(--cft-dark);
}

/* Match the date field's height to the selects (Delivery Time / Area)
   next to it — the selects got an explicit fixed height earlier to fix
   clipped text, but plain text inputs like the date field didn't, so they
   ended up visibly shorter. Flatpickr's visible "alt" input (shown to the
   user when altInput:true) needs the same treatment as the real input. */
input.cft-input,
.flatpickr-input,
.flatpickr-alt-input {
	height: 52px !important;
	width: 100% !important;
	box-sizing: border-box !important;
	padding: 0 16px !important;
}

/* Root cause of the date field only taking up ~half the row on mobile:
   flatpickr always wraps the real input + the visible "alt" input in its
   own `.flatpickr-wrapper` div, which flatpickr's base CSS leaves as
   `display:inline-block` with no explicit width — so it shrinks to fit
   its content instead of filling `.cft-field` like every other field
   does. The alt input's own `width:100%` was 100% of THIS narrow
   wrapper, not of the field, which is why it looked stuck at ~50%. */
.flatpickr-wrapper {
	display: block !important;
	width: 100% !important;
}

/* Hide the native up/down spinner arrows on the calendar's year field. */
.flatpickr-current-month input.cur-year {
	-moz-appearance: textfield;
}
.flatpickr-current-month input.cur-year::-webkit-outer-spin-button,
.flatpickr-current-month input.cur-year::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Flatpickr also renders its own clickable up/down arrow controls next to
   the year field (separate from the browser's native spinner above) —
   these sit right on top of the number and are easy to tap by accident on
   a phone, silently bumping the year. Hide them completely; typing the
   year (or just picking a different month via the arrows beside the
   month/year header) is enough, and this removes the accidental-tap risk. */
.numInputWrapper span.arrowUp,
.numInputWrapper span.arrowDown {
	display: none !important;
}
.numInputWrapper:hover { background: transparent !important; }
.numInputWrapper input.cur-year { padding-right: 4px !important; }

/* Flatpickr's default month/year header text is oversized relative to the
   rest of our compact modal UI. */
.flatpickr-current-month {
	font-size: 15px !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
	font-size: 15px !important;
	font-weight: 600;
}

.cft-field { margin-bottom: 16px; }
.cft-field-note {
	font-size: 12px;
	line-height: 1.5;
	color: #888;
	margin: 6px 0 0;
}
.cft-field-note a {
	color: var(--cft-teal-blue, #2b7a8c);
	text-decoration: underline;
}

/* ---------- Coupon code ---------- */
.cft-coupon-row {
	display: flex;
	gap: 10px;
}
.cft-coupon-row .cft-input { flex: 1; }
.cft-coupon-row .cft-btn {
	flex: none;
	padding: 0 22px;
	white-space: nowrap;
}
.cft-coupon-error { color: #b32d2e; }
.cft-coupon-success { color: #2a8f4d; }
#cft-summary-discount-row span:first-child { color: #2a8f4d; }
#cft-summary-discount { color: #2a8f4d; font-weight: 600; }
#cft-summary-coupon-code { font-weight: 400; opacity: .8; }
.cft-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}
.cft-field-row .cft-field { margin-bottom: 0; }
.cft-field-row + .cft-field,
.cft-field-row { margin-bottom: 16px; }

.cft-payment-box {
	border: 1px solid #eee;
	border-radius: 14px;
	padding: 14px 18px;
	margin: 6px 0 16px;
}
.cft-payment-box legend { font-weight: 700; padding: 0 6px; font-size: 13px; }
.cft-radio-label { display: flex; align-items: center; gap: 10px; font-weight: 600; }

.cft-google-hint { font-size: 13px; color: #666; margin-bottom: 16px; }

.cft-modal-nav {
	display: flex;
	gap: 12px;
	margin-top: 8px;
}
.cft-modal-nav .cft-btn-primary { flex: 1; }

.cft-error {
	background: #fdecea;
	color: #b3261e;
	border-radius: 10px;
	padding: 10px 14px;
	font-size: 14px;
	margin-bottom: 16px;
}

/* ---------- Contact form card ---------- */
.cft-contact-form-card {
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 4px 18px rgba(0,0,0,0.06);
	padding: 28px;
}
.cft-contact-form-card .cft-form .cft-field:last-of-type { margin-bottom: 16px; }

/* ---------- My orders ---------- */
.cft-order-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	margin-bottom: 12px;
}
.cft-order-meta { font-size: 13px; color: #777; margin-top: 4px; }
.cft-status-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 999px;
	background: #eee;
	font-size: 12px;
	font-weight: 700;
	margin-right: 10px;
}
.cft-status-paid, .cft-status-confirmed, .cft-status-completed { background: #e3f3e6; color: #1e7a34; }
.cft-status-pending_payment { background: #fff3d6; color: #96700a; }
.cft-status-cancelled, .cft-status-payment_failed { background: #fdecea; color: #b3261e; }

/* ---------- Flatpickr theme tweak ---------- */
.flatpickr-day.selected {
	background: var(--cft-orange) !important;
	border-color: var(--cft-orange) !important;
}
.flatpickr-day:hover { background: var(--cft-gold); }

@media (max-width: 560px) {
	.cft-field-row { grid-template-columns: 1fr; }
	.cft-modal { padding: 24px 18px; }
}

/* ---------- Header widgets: Login/Sign Out button + search/cart icons ---------- */
.cft-auth-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 22px;
	border-radius: 999px;
	background: var(--cft-teal-blue);
	color: #fff !important;
	font-weight: 700;
	font-size: 14px;
	text-decoration: none !important;
	white-space: nowrap;
	transition: opacity .15s ease, transform .1s ease;
}
.cft-auth-btn:hover { opacity: .92; }
.cft-auth-btn:active { transform: scale(0.98); }
.cft-auth-btn-out { background: var(--cft-dark); }
.cft-auth-btn svg { flex: none; }

.cft-icon-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 999px;
	border: 1px solid #e4e0d8;
	background: #fff;
	color: var(--cft-dark);
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease;
}
.cft-icon-btn:hover {
	/* Astra's global button/link hover style turns the icon's `currentColor`
	   white on hover (same leak fixed earlier for the "Order Now" button) —
	   against this button's light cream/white hover background that makes
	   the icon nearly invisible. Force it to stay dark. */
	background: var(--cft-cream);
	border-color: var(--cft-teal-blue);
	color: var(--cft-dark) !important;
}
.cft-icon-btn svg {
	/* Without an explicit width/height here, some themes/editors apply a
	   responsive-image-style `svg { width:100% }` reset that — combined
	   with this button having no fixed width of its own — collapses the
	   icon to 0×18 (confirmed live: a rendered <svg width="18" height="18">
	   measured 0px wide until this was added). Pin the actual pixel size
	   so the icon can't disappear regardless of what else styles <svg>. */
	width: 18px;
	height: 18px;
	flex: none;
	pointer-events: none;
}

.cft-cart-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 999px;
	background: var(--cft-orange);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}
.cft-cart-badge[hidden] { display: none; }

/* ---------- Cart popup + order search popup (reuse .cft-overlay/.cft-modal) ---------- */
.cft-empty-note { color: #777; font-size: 14px; text-align: center; padding: 24px 0; }
.cft-cart-status-note { font-size: 13px; color: #777; margin: 0 0 12px; text-transform: capitalize; }
.cft-cart-items-view { margin: 8px 0; }
.cft-cart-line-view {
	display: flex;
	justify-content: space-between;
	padding: 8px 0;
	border-bottom: 1px solid #eee;
	font-size: 14px;
}
#cft-cart-body .cft-btn { margin-top: 16px; }

.cft-search-order-title { margin: 0 0 8px; }
.cft-search-detail-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
	margin: 16px 0;
	font-size: 13px;
	color: #444;
}
.cft-search-detail-grid strong { color: var(--cft-dark); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.cft-order-message-box {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid #eee;
}
.cft-order-message-box .cft-label { margin-bottom: 6px; display: block; }
.cft-order-message-box textarea { margin-bottom: 10px; }
#cft-search-again { margin-top: 16px; }

@media (max-width: 560px) {
	.cft-search-detail-grid { grid-template-columns: 1fr; }
}
