/* ==========================================================================
   OwnServe — Responsive & Motion
   Breakpoints: 1024 / 900 / 768 / 560 / 420
   ========================================================================== */

/* Large desktop tweaks ----------------------------------------------------- */
@media (min-width: 1441px) {
	.os-container {
		max-width: var(--os-container-wide);
	}
}

/* <= 1024px: tablet-landscape / small desktop ------------------------------ */
@media (max-width: 1024px) {
	.os-grid--4 {
		grid-template-columns: repeat(3, 1fr);
	}

	.os-footer__grid {
		grid-template-columns: 1fr 1fr 1fr;
	}

	.os-footer__brand {
		grid-column: 1 / -1;
	}
}

/* <= 900px: collapse nav into hamburger ------------------------------------ */
@media (max-width: 900px) {
	:root {
		--os-header-h: 64px;
	}

	/* Keep the image logo comfortably inside the shorter mobile header. */
	.os-logo__img {
		height: 36px;
	}

	.os-navtoggle {
		display: flex;
	}

	/* Header is the positioning anchor for the dropdown. It must sit above
	   all page/hero content so the menu never hides behind images. */
	.os-header {
		position: sticky;
		z-index: 1000;
	}

	/* --------------------------------------------------------------------
	   Mobile navigation = full-width dropdown anchored directly below the
	   navbar (not an off-canvas side panel, not positioned to the page).
	   Anchored to .os-header via position:absolute; top:100%; left/right:0.
	   -------------------------------------------------------------------- */
	.os-nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		width: 100%;
		max-width: 100%;
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		gap: 0;
		background: #fff; /* solid background */
		padding: 0.5rem 1rem 1.25rem;
		box-shadow: var(--os-shadow-lg);
		border-top: 1px solid var(--os-line);
		border-bottom: 1px solid var(--os-line);
		z-index: 1001; /* above hero/product images */

		/* Hidden until opened */
		max-height: 0;
		overflow: hidden;
		opacity: 0;
		visibility: hidden;
		transform: translateY(-8px);
		transition: max-height var(--os-dur) var(--os-ease),
			opacity var(--os-dur) var(--os-ease),
			transform var(--os-dur) var(--os-ease),
			visibility var(--os-dur) var(--os-ease);
	}

	.os-nav.is-open {
		max-height: calc(100vh - var(--os-header-h));
		overflow-y: auto;
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}

	.os-nav__list {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		width: 100%;
	}

	.os-nav__link {
		display: block;
		padding: 0.9rem 0.75rem; /* comfortable touch target */
		min-height: 44px;
		font-size: 1.05rem;
		border-bottom: 1px solid var(--os-line-soft);
	}

	.os-nav__link::after {
		display: none;
	}

	.os-header__cta {
		margin-top: 1.25rem;
		flex-direction: column;
		align-items: stretch;
		width: 100%;
	}

	.os-header__cta .os-btn {
		width: 100%;
	}

	/* Keep the primary CTA visible in the top bar on mobile */
	.os-header__cta--top {
		display: none;
	}

	/* Click-outside backdrop: covers the page below the navbar. Sits above
	   page content but below the dropdown panel. */
	.os-nav-backdrop {
		display: block;
		position: fixed;
		inset: var(--os-header-h) 0 0 0;
		background: rgba(7, 23, 46, 0.5);
		opacity: 0;
		visibility: hidden;
		transition: opacity var(--os-dur) var(--os-ease),
			visibility var(--os-dur) var(--os-ease);
		z-index: 999;
	}

	.os-nav-backdrop.is-open {
		opacity: 1;
		visibility: visible;
	}

	/* Prevent body scroll when menu open */
	body.os-noscroll {
		overflow: hidden;
	}

	/* Hero becomes single column */
	.os-hero__grid {
		grid-template-columns: 1fr;
	}

	.os-hero__media {
		order: -1;
		margin-bottom: var(--os-space-6);
	}

	.os-split {
		grid-template-columns: 1fr;
	}

	.os-split--media-first .os-split__media {
		order: -1;
	}

	.os-dash {
		grid-template-columns: 132px 1fr;
	}
}

/* <= 768px: tablet portrait ------------------------------------------------ */
@media (max-width: 768px) {
	.os-grid--3,
	.os-grid--4 {
		grid-template-columns: repeat(2, 1fr);
	}

	.os-compare {
		grid-template-columns: 1fr;
	}

	.os-calc {
		grid-template-columns: 1fr;
	}

	.os-footer__grid {
		grid-template-columns: 1fr 1fr;
	}

	/* Big how-it-works flow stacks vertically on small screens */
	.os-flow--howitworks {
		flex-direction: column;
		align-items: stretch;
	}

	.os-flow--howitworks .os-flow__step {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.os-flow--howitworks .os-flow__node {
		justify-content: flex-start;
	}

	.os-flow--howitworks .os-flow__arrow {
		display: flex;
		justify-content: center;
		padding: 0.35rem 0;
	}

	.os-flow--howitworks .os-flow__arrow .os-icon {
		transform: rotate(90deg);
	}
}

/* <= 560px: large phone ---------------------------------------------------- */
@media (max-width: 560px) {
	.os-grid--2,
	.os-grid--3,
	.os-grid--4 {
		grid-template-columns: 1fr;
	}

	.os-pricing-grid {
		grid-template-columns: 1fr;
	}

	.os-fulfil-grid {
		grid-template-columns: 1fr;
	}

	.os-hero__actions .os-btn {
		width: 100%;
	}

	/* Dashboard: hide sidebar labels, keep icons */
	.os-dash {
		grid-template-columns: 1fr;
	}

	.os-dash__side {
		display: none;
	}

	.os-footer__grid {
		grid-template-columns: 1fr;
		gap: var(--os-space-5);
	}

	.os-footer__bottom {
		flex-direction: column;
		align-items: flex-start;
		text-align: left;
	}
}

/* <= 420px: small phone (375/390/320 safe) --------------------------------- */
@media (max-width: 420px) {
	:root {
		--os-gutter: 1rem;
	}

	.os-badge {
		font-size: 0.8rem;
		padding: 0.4rem 0.7rem;
	}

	.os-status {
		font-size: 0.66rem;
	}

	.os-restaurant-types {
		grid-template-columns: 1fr;
	}
}

/* Reduced motion ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}

	.os-reveal {
		opacity: 1 !important;
		transform: none !important;
	}

	.os-btn:hover,
	.os-fcard:hover,
	.os-typecard:hover,
	.os-pcard:hover {
		transform: none !important;
	}
}

/* Print -------------------------------------------------------------------- */
@media print {
	.os-header,
	.os-navtoggle,
	.os-nav-backdrop,
	.os-ctaband__actions {
		display: none !important;
	}
}
