/*
 * Cozy Home — small-screen layout (loads after components.css)
 */

/* --- Global: avoid horizontal scroll from wide media / long URLs --- */
.site {
	overflow-x: clip;
}

img,
video,
svg {
	max-width: 100%;
	height: auto;
}

iframe {
	max-width: 100%;
}

/* --- Tighter page gutters on phones --- */
@media (max-width: 479px) {
	.container {
		padding-left: max(1rem, env(safe-area-inset-left));
		padding-right: max(1rem, env(safe-area-inset-right));
	}

	.woocommerce .woocommerce-notices-wrapper {
		padding-left: max(1rem, env(safe-area-inset-left));
		padding-right: max(1rem, env(safe-area-inset-right));
	}
}

/* --- Header: logo row only — primary nav is burger drawer (components.css) --- */
@media (max-width: 959px) {
	.site-header__inner {
		display: grid;
		grid-template-columns: auto 1fr auto;
		grid-template-rows: auto;
		align-items: center;
		column-gap: 0.5rem;
		row-gap: 0;
	}

	.site-utilities--start {
		grid-column: 1;
		grid-row: 1;
		justify-self: start;
		display: flex;
		align-items: center;
		gap: 0.35rem;
		flex-wrap: nowrap;
		min-width: 0;
	}

	.site-branding {
		grid-column: 2;
		grid-row: 1;
		justify-self: center;
		min-width: 0;
		max-width: 100%;
	}

	.site-utilities--end {
		grid-column: 3;
		grid-row: 1;
		justify-self: end;
		flex-wrap: wrap;
		justify-content: flex-end;
		max-width: 100%;
	}

	.site-title {
		font-size: clamp(1.125rem, 5vw, 1.75rem);
		line-height: 1.2;
		word-break: break-word;
	}

	.custom-logo {
		max-height: 56px;
	}

	.primary-navigation .primary-menu {
		font-size: 0.9375rem;
		gap: 0.15rem 0;
	}

	.primary-menu > li > a {
		padding: 0.65rem 0.35rem;
		min-height: 2.75rem;
		display: flex;
		align-items: center;
		border-radius: var(--radius-md);
	}

	.mega-menu__inner {
		padding: 0.65rem 0 0.65rem 0.75rem;
	}
}

/* --- Shop toolbar + breadcrumb: stack and wrap cleanly --- */
@media (max-width: 639px) {
	.shop-archive__toolbar {
		padding-top: 1rem;
		padding-left: max(1rem, env(safe-area-inset-left));
		padding-right: max(1rem, env(safe-area-inset-right));
	}

	.shop-archive__toolbar-inner {
		flex-direction: column;
		align-items: stretch;
		gap: 0.85rem;
	}

	.shop-archive__toolbar-leading {
		flex-direction: column;
		align-items: stretch;
		gap: 0.65rem;
	}

	.shop-filters-toggle {
		width: 100%;
		justify-content: center;
		min-height: 2.75rem;
	}

	.shop-archive__toolbar-leading .cozy-breadcrumb {
		text-align: center;
		font-size: 0.75rem;
		line-height: 1.45;
		word-break: break-word;
		hyphens: auto;
	}

	.shop-archive__sort {
		width: 100%;
	}

	.shop-archive__sort select {
		width: 100%;
		min-height: 2.75rem;
	}

	.shop-archive__layout {
		padding-left: max(1rem, env(safe-area-inset-left));
		padding-right: max(1rem, env(safe-area-inset-right));
	}
}

/* --- Hero: comfortable padding + readable copy on small screens --- */
@media (max-width: 599px) {
	.hero-home__inner {
		padding: 2rem max(1rem, env(safe-area-inset-left)) 2rem max(1rem, env(safe-area-inset-right));
	}

	.hero-home__headline {
		font-size: clamp(1.5rem, 7vw, 2.25rem);
		hyphens: auto;
		word-break: break-word;
	}

	.hero-home__subcopy {
		font-size: 1rem;
		padding: 0 0.25rem;
	}

	.hero-home__mascot-img {
		max-height: 160px;
	}

	.hero-home__carousel {
		flex-wrap: wrap;
		justify-content: center;
		row-gap: 0.75rem;
	}

	.hero-home__slides {
		flex: 1 1 100%;
		order: 1;
		min-width: 0;
	}

	.hero-home__nav--prev {
		order: 2;
	}

	.hero-home__nav--next {
		order: 3;
	}

	.hero-home .button.hero-home__pause {
		min-height: 2.75rem;
		padding-left: 1.25rem;
		padding-right: 1.25rem;
	}
}

/* --- Editorial intro band --- */
@media (max-width: 479px) {
	.home-intro {
		padding: 1.75rem max(1rem, env(safe-area-inset-left)) 0 max(1rem, env(safe-area-inset-right));
	}

	.home-intro__tabs {
		flex-direction: column;
		gap: 0.65rem;
		width: 100%;
	}

	.home-intro__tab {
		padding: 0.5rem 0;
	}
}

/* --- Footer founder / newsletter --- */
@media (max-width: 599px) {
	.footer-founder {
		padding: 2.5rem 0;
	}

	.footer-founder__grid {
		gap: 1.5rem;
	}

	.footer-founder__img {
		max-height: none;
	}

	.footer-newsletter {
		padding: 2rem 0;
		text-align: center;
	}

	.footer-newsletter__content {
		text-align: center;
	}

	.footer-press__inner {
		flex-direction: column;
		text-align: center;
	}
}

/* --- Single product breadcrumb strip --- */
@media (max-width: 599px) {
	.cozy-product-subnav {
		padding-left: max(1rem, env(safe-area-inset-left));
		padding-right: max(1rem, env(safe-area-inset-right));
	}

	.cozy-breadcrumb {
		font-size: 0.75rem;
		line-height: 1.5;
		word-break: break-word;
	}
}

/* --- Cart drawer: full-bleed panel on narrow phones --- */
@media (max-width: 479px) {
	.cozy-cart-drawer__panel {
		width: 100vw;
		max-width: 100vw;
		padding-bottom: env(safe-area-inset-bottom);
	}

	.cozy-cart-drawer__head,
	.cozy-cart-drawer__inner,
	.cozy-cart-drawer__actions,
	.cozy-cart-drawer__view {
		padding-left: max(1rem, env(safe-area-inset-left));
		padding-right: max(1rem, env(safe-area-inset-right));
	}
}

/* --- WooCommerce product summary common overflows --- */
@media (max-width: 599px) {
	.woocommerce div.product {
		display: block;
	}

	.woocommerce div.product div.images,
	.woocommerce div.product div.summary {
		width: 100% !important;
		float: none !important;
		max-width: 100%;
	}

	.woocommerce div.product form.cart {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 0.75rem;
	}

	.woocommerce div.product form.cart .quantity .qty {
		min-height: 2.75rem;
	}

	.woocommerce div.product form.cart .button {
		width: 100%;
		min-height: 2.75rem;
	}
}
