/**
 * Store Operating Hours - Frontend & Admin Styles
 *
 * Colors, font size, border radius, padding, and text alignment are
 * applied inline by PHP (from the administrator's saved settings), so
 * this file only handles layout, spacing, and responsiveness -- things
 * that shouldn't be re-typed into the settings page.
 */

.soh-notice {
	margin: 20px 0;
	box-sizing: border-box;
	max-width: 100%;
	line-height: 1.6;
}

.soh-notice .soh-message {
	margin: 0 0 12px;
	white-space: pre-line;
}

.soh-notice .soh-message:last-child {
	margin-bottom: 0;
}

.soh-countdown {
	margin-top: 10px;
}

.soh-countdown-label {
	margin: 0 0 6px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	font-size: 0.8em;
	opacity: 0.85;
}

.soh-countdown-timer {
	display: inline-flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: inherit;
}

.soh-countdown-segment {
	display: inline-flex;
	align-items: baseline;
	gap: 2px;
	font-variant-numeric: tabular-nums;
}

.soh-countdown-segment span {
	font-size: 1.4em;
	font-weight: 700;
}

.soh-countdown-segment small {
	font-size: 0.75em;
	opacity: 0.8;
}

/* Tablet */
@media screen and (max-width: 768px) {
	.soh-notice {
		padding: 16px !important;
	}
	.soh-countdown-segment span {
		font-size: 1.2em;
	}
}

/* Mobile */
@media screen and (max-width: 480px) {
	.soh-notice {
		font-size: 14px !important;
	}
	.soh-countdown-timer {
		gap: 6px;
	}
	.soh-countdown-segment span {
		font-size: 1.05em;
	}
}

/* ---------------------------------------------------------------- */
/* Hover tooltip on disabled Add to Cart buttons                     */
/* ---------------------------------------------------------------- */

.soh-tooltip-wrap {
	position: relative;
	display: inline-block;
	max-width: 100%;
}

.soh-disabled-btn {
	opacity: 0.5;
	cursor: not-allowed;
}

.soh-tooltip-text {
	visibility: hidden;
	opacity: 0;
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	min-width: 220px;
	max-width: 300px;
	white-space: pre-line;
	text-align: left;
	line-height: 1.5;
	z-index: 9999;
	transition: opacity 0.15s ease;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
	pointer-events: none;
}

.soh-tooltip-text::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: var(--soh-tip-bg, #333);
}

.soh-tooltip-wrap:hover .soh-tooltip-text,
.soh-tooltip-wrap:focus-within .soh-tooltip-text {
	visibility: visible;
	opacity: 1;
}

/* On touch devices there is no hover, so keep the tooltip reasonably
   sized and left-aligned to the button instead of centered/overflowing. */
@media (hover: none) {
	.soh-tooltip-text {
		left: 0;
		transform: none;
		max-width: 260px;
	}
}

.soh-countdown-standalone {
	display: inline-block;
	margin: 12px 0;
	max-width: 320px;
}

/* ---------------------------------------------------------------- */
/* Admin settings page                                               */
/* ---------------------------------------------------------------- */

.soh-admin-wrap .form-table th {
	width: 260px;
}

.soh-admin-wrap textarea.large-text {
	width: 100%;
	max-width: 480px;
}
