/* =========================================================================
   Chubby Chair — responsive layout safeguards
   Keeps the 1440px+ Figma coordinate lock untouched while giving narrower
   viewports a predictable fluid flow with no horizontal page overflow.
   ========================================================================= */

@media (max-width: 1439px) {
	html,
	body {
		overflow-x: hidden;
	}

	.cc-container,
	.cc-nav,
	.cc-nav__menu,
	.cc-footer__grid,
	.cc-footer__links,
	.cc-hero__grid,
	.cc-product__hero,
	.cc-cart__layout,
	.cc-checkout__form,
	.cc-account {
		min-width: 0;
	}

	/* Use the compact navigation until the exact desktop composition fits. */
	.cc-nav {
		position: relative;
		min-height: 72px;
		padding-block: .875rem;
	}
	.cc-nav__toggle {
		display: inline-grid;
		flex: 0 0 44px;
		place-items: center;
		width: 44px;
		height: 44px;
		border: 0;
		background: none;
		color: #000;
		cursor: pointer;
	}
	.cc-nav__menu {
		position: absolute;
		inset-inline: clamp(1rem, 4vw, 3.75rem);
		top: calc(100% + .25rem);
		z-index: 100;
		display: none;
		max-height: calc(100vh - 6rem);
		flex-direction: column;
		align-items: stretch;
		gap: 1.25rem;
		overflow-y: auto;
		border: 1px solid rgba(0, 0, 0, .05);
		border-radius: var(--radius-lg);
		background: #fff;
		padding: 1.25rem 1.5rem;
		box-shadow: 0 18px 50px rgba(0, 0, 0, .12);
	}
	.cc-nav__menu.is-open {
		display: flex;
	}
	.cc-nav__links {
		flex-direction: column;
		align-items: stretch;
		gap: .25rem;
	}
	.cc-nav__links > li,
	.cc-nav__links a {
		width: 100%;
	}
	.cc-nav__links a {
		display: block;
		padding: .625rem 0;
		text-align: right;
	}
	.cc-icons {
		justify-content: flex-start;
		padding-top: .75rem;
		border-top: 1px solid rgba(0, 0, 0, .08);
	}

	/* The footer remains structured between the phone and exact desktop views. */
	.cc-footer {
		margin-top: 2rem;
		padding-bottom: 2rem;
	}
	.cc-footer__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 2rem;
		padding: 2.5rem clamp(1.5rem, 5vw, 3.5rem);
	}
	.cc-footer__links {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: clamp(1.25rem, 4vw, 2.5rem);
	}
	.cc-footer__col {
		min-width: 0;
	}
	.cc-footer__logo {
		justify-content: center;
	}
	.cc-footer__logo img {
		max-width: min(228px, 100%);
		height: auto;
	}
	.cc-footer__social {
		margin-top: 1rem;
	}

	/* Four related cards are too narrow before the exact desktop canvas. */
	.cc-related ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	/* WooCommerce tables remain usable without widening the page. */
	.cc-account__content {
		min-width: 0;
	}
	.cc-account__content .woocommerce-orders-table,
	.cc-account__content table.shop_table {
		display: block;
		max-width: 100%;
		overflow-x: auto;
		white-space: nowrap;
		-webkit-overflow-scrolling: touch;
	}
}

@media (max-width: 1023px) {
	/* Keep complex three-column feature content and cart lines stacked. */
	.cc-home-features {
		grid-template-columns: minmax(0, 1fr);
	}
	.cc-home-features__media {
		order: -1;
	}
	.cc-home-features__chair {
		width: min(316px, 72vw);
		transform: none;
	}
	.cc-home-feature__body {
		max-width: 42rem;
	}

	.cc-cart__layout {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 899px) {
	/* A two-column hero/product/account is cramped in portrait tablets. */
	.cc-hero {
		height: auto;
		max-height: none;
		min-height: 0;
	}
	.cc-hero__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.cc-product__hero {
		flex-direction: column;
	}
	.cc-product__info,
	.cc-product__gallery {
		max-width: none;
	}

	.cc-account {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 767px) {
	:root {
		--pad-x: 1.25rem;
		--pad-x-md: 1.25rem;
	}

	.cc-container {
		padding-inline: var(--pad-x);
	}

	.cc-logo img,
	.cc-logo svg {
		width: auto;
		max-width: 108px;
		height: 36px;
	}

	.cc-nav__menu {
		inset-inline: var(--pad-x);
	}

	/* Home hero: remove absolute collisions and fit all controls on one phone. */
	.cc-hero {
		overflow: hidden;
	}
	.cc-hero__inner {
		flex: none;
	}
	.cc-hero__grid {
		gap: 1.25rem;
		padding-top: .5rem;
		padding-bottom: 0;
	}
	.cc-hero__text {
		align-items: stretch;
		gap: 1rem;
	}
	.cc-hero__title {
		font-size: clamp(1.75rem, 8.5vw, 2.25rem);
		overflow-wrap: anywhere;
	}
	.cc-hero__buy {
		gap: .75rem;
	}
	.cc-hero__prices {
		flex-wrap: wrap;
		gap: .5rem .75rem;
	}
	.cc-hero__blob {
		left: -90vw;
		top: 9rem;
		width: 190vw;
		max-width: none;
	}
	.cc-hero__media {
		gap: .75rem;
	}
	.cc-hero__stage {
		min-height: 360px;
	}
	.cc-hero__chair-frame {
		width: min(248px, 68vw);
	}
	.cc-hero__tags {
		right: 0;
		top: 24%;
		gap: .25rem;
	}
	.cc-hero__tag--a {
		width: 128px;
		height: 60px;
	}
	.cc-hero__tag--b {
		width: 165px;
		height: 62px;
	}
	.cc-hero__tag-copy {
		font-size: 12px;
	}
	.cc-hero__tag--c {
		width: 166px;
		height: 53px;
	}
	.cc-hero__dots,
	.cc-swatches {
		flex-wrap: wrap;
	}
	.cc-hero__dots {
		justify-content: center;
		gap: .75rem clamp(.35rem, 2vw, .65rem);
		padding-inline: .25rem;
	}
	.cc-hero__thumbs {
		position: static;
		justify-content: center;
		margin: 1.25rem auto 0;
		padding-bottom: 1rem;
	}
	.cc-hero__thumb {
		width: 76px;
		height: 76px;
	}
	.cc-hero__thumb-img {
		height: 88px;
	}
	.cc-hero__thumb-img--table {
		height: 48px;
	}

	/* Home sections. */
	.cc-home-lifestyle {
		padding-block: 2rem;
	}
	.cc-home-lifestyle__photo,
	.cc-home-lifestyle__photo--tall,
	.cc-home-lifestyle__photo--top-a,
	.cc-home-lifestyle__photo--top-b {
		height: clamp(240px, 76vw, 340px);
	}
	.cc-home-lifestyle__band {
		padding: 1.5rem;
	}
	.cc-home-lifestyle__title {
		font-size: 1.5rem;
	}
	.cc-home-lifestyle__body {
		margin-top: 1rem;
	}
	.cc-home-cards {
		gap: 1rem;
		padding-block: 2rem;
	}
	.cc-home-card {
		aspect-ratio: 4 / 5;
	}
	.cc-home-card__label {
		inset-inline: 1rem;
		bottom: 1rem;
		gap: .75rem;
		padding: 1rem;
	}
	.cc-home-card__label .cc-arrow-btn {
		width: 48px !important;
		height: 48px !important;
	}
	.cc-home-card__title {
		font-size: 1.25rem;
	}
	.cc-home-card__price {
		flex-wrap: wrap;
		gap: .25rem .4rem;
		font-size: 1rem;
	}
	.cc-home-hobby {
		padding-block: 2rem;
	}
	.cc-home-hobby__stage {
		min-height: 280px;
		padding-block: 3rem;
	}
	.cc-home-hobby__text {
		width: min(100%, 480px);
	}
	.cc-home-features {
		gap: 2.5rem;
		padding-block: 3rem;
	}
	.cc-home-features__col {
		gap: 2.5rem;
	}
	.cc-home-feature__head {
		width: 100%;
	}
	.cc-home-feature__title {
		min-width: 0;
		overflow-wrap: anywhere;
	}
	.cc-home-feature__body {
		max-width: none;
	}
	.cc-check-badge {
		flex: 0 0 48px;
		width: 48px;
		height: 48px;
	}

	/* Content pages. */
	.cc-about__intro {
		gap: 1.25rem;
		padding-block: 3rem 2.5rem;
	}
	.cc-about__title,
	.cc-contact__title,
	.cc-faq__title {
		font-size: 2rem;
	}
	.cc-about__hero {
		aspect-ratio: 4 / 3;
	}
	.cc-about__stats {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: .5rem;
		padding-block: 3rem;
	}
	.cc-about__stat {
		min-width: 0;
	}
	.cc-about__stat-value {
		font-size: 1.5rem;
	}
	.cc-about__stat-label {
		font-size: .875rem;
		line-height: 1.6;
		overflow-wrap: anywhere;
	}
	.cc-about__story {
		gap: 1.5rem;
		padding-block: 2rem;
	}
	.cc-about__values {
		gap: 1.5rem;
		padding-block: 3rem;
	}
	.cc-about__values-grid {
		width: 100%;
		gap: 2rem;
	}
	.cc-about__value {
		width: 100%;
	}
	.cc-contact__form-wrap {
		margin-top: 3rem;
		padding-inline: var(--pad-x);
		padding-bottom: 4rem;
	}
	.cc-contact__form {
		gap: 1.5rem;
		padding: 1rem;
	}
	.cc-faq__head {
		padding-top: 3rem;
	}
	.cc-faq__item {
		padding: 1rem;
	}
	.cc-faq__summary {
		gap: .75rem;
	}
	.cc-faq__question {
		min-width: 0;
		font-size: 1.0625rem;
		overflow-wrap: anywhere;
	}
	.cc-resource-page {
		padding-block: 3rem 5rem;
	}
	.cc-resource-page__body {
		margin-top: 2.5rem;
	}
	.cc-resource-page__editor .wp-block-file {
		flex-direction: column;
		align-items: stretch;
	}
	.cc-resource-page__editor .wp-block-file__button {
		width: 100%;
	}
	.cc-resource-page--downloads .cc-resource-page__editor .wp-block-file__embed {
		height: clamp(22rem, 68vh, 34rem) !important;
	}
	.cc-download-card {
		grid-template-columns: 52px minmax(0, 1fr);
		gap: 1rem;
		padding: 1.25rem;
	}
	.cc-download-card__icon {
		width: 52px;
		height: 52px;
	}
	.cc-login-page {
		min-height: 0;
		padding: 2rem var(--pad-x) 4rem;
	}
	.cc-login-card {
		min-height: 0;
		padding: 1.5rem;
	}
	.cc-login-card.is-registering {
		min-height: 0;
	}
	.cc-login-card__notices {
		position: static;
		margin-bottom: 1rem;
		transform: none;
	}
	.cc-login-card__content {
		margin-top: 2.5rem;
	}
	.cc-login-card__content--register {
		width: 100%;
	}
	.cc-login-card__actions {
		margin-top: 2.5rem;
	}
	.cc-register-form__actions {
		margin-top: .5rem;
	}

	/* Shop, product, cart, checkout, and account. */
	.cc-shop,
	.cc-checkout,
	.cc-account {
		padding-block: 1rem 4rem;
	}
	.cc-shop__tabs {
		justify-content: flex-start;
		gap: .5rem;
		margin-top: 2rem;
		overflow-x: auto;
		padding-bottom: .25rem;
		scroll-snap-type: x proximity;
		-webkit-overflow-scrolling: touch;
	}
	.cc-shop__tab {
		flex: 0 0 auto;
		padding-inline: .75rem;
		white-space: nowrap;
		scroll-snap-align: start;
	}
	.cc-card__title {
		white-space: normal;
		overflow-wrap: anywhere;
	}
	.cc-product__hero {
		gap: 2rem;
		padding-bottom: 3rem;
	}
	.cc-product__info {
		gap: 1.75rem;
	}
	.cc-product__buybox {
		max-width: none;
	}
	.cc-product__pricerow {
		flex-wrap: wrap;
	}
	.cc-product__buybox .button,
	.cc-product__buybox .single_add_to_cart_button {
		width: 100%;
	}
	.cc-product__thumb {
		width: 80px;
		height: 80px;
	}
	.cc-tabs__head {
		gap: 1.25rem;
		padding-inline: 1rem;
	}
	.cc-tabs__panel {
		padding: 1rem;
	}
	.cc-tabs__panel--description .cc-tabs__content {
		padding: 1rem;
	}
	.cc-tabs__panel table.shop_attributes {
		display: block;
		overflow-x: auto;
	}
	.cc-related {
		gap: 1.75rem;
		padding-block: 3rem;
	}
	.cc-related__title {
		font-size: 1.75rem;
	}
	.cc-cart__head {
		flex-wrap: wrap;
		gap: 1rem;
		padding-block: 1rem 2rem;
	}
	.cc-cart__title,
	.cc-checkout__title {
		font-size: 2rem;
	}
	.cc-cart__line {
		display: grid;
		grid-template-columns: 96px minmax(0, 1fr);
		gap: .875rem 1rem;
		align-items: center;
	}
	.cc-cart__thumb {
		grid-column: 1;
		grid-row: 1 / span 2;
		width: 96px;
		height: 96px;
	}
	.cc-cart__thumb-img {
		height: 68px;
	}
	.cc-cart__name {
		grid-column: 2;
		grid-row: 1;
	}
	.cc-cart__qty {
		grid-column: 2;
		grid-row: 2;
		gap: .75rem;
	}
	.cc-qty-btn {
		width: 40px;
		height: 40px;
	}
	.cc-cart__price {
		grid-column: 1 / -1;
		grid-row: 3;
		justify-self: end;
		margin-inline-start: 0;
	}
	.cc-cart__price .cc-amount__num {
		font-size: 1.25rem;
	}
	.cc-receipt {
		padding: 1.25rem;
	}
	.cc-checkout .cc-card {
		padding: 1.25rem;
	}
	.cc-checkout__review {
		position: static;
	}
	.cc-checkout .shop_table {
		display: block;
		max-width: 100%;
		overflow-x: auto;
	}
	.cc-account__nav {
		padding: .75rem;
	}
	.cc-account-orders__title {
		font-size: 1.75rem;
		line-height: 1.4;
	}
	.cc-account-orders__tabs {
		justify-content: flex-start;
		gap: .75rem;
		overflow-x: auto;
	}
	.cc-account-orders__tab {
		flex: 0 0 auto;
		white-space: nowrap;
	}
	.cc-account-orders__panel {
		padding: 1rem;
	}
	.cc-account-order-card__header,
	.cc-account-order-card__meta,
	.cc-account-orders__empty {
		flex-wrap: wrap;
	}

	/* Footer becomes a deliberate single-column composition on phones. */
	.cc-footer__grid {
		gap: 1.5rem;
		border-radius: 24px;
		padding: 2rem 1.25rem;
	}
	.cc-footer__links {
		grid-template-columns: minmax(0, 1fr);
		gap: 1.5rem;
	}
	.cc-footer__col,
	.cc-footer__col ul {
		align-items: center;
		text-align: center;
	}
	.cc-footer__col li,
	.cc-footer__col a {
		text-align: center;
	}
	.cc-footer__social {
		display: flex;
		justify-content: center;
		width: 100%;
		gap: .75rem;
		padding: .75rem;
	}
	.cc-social-icon {
		width: 48px;
		height: 48px;
	}
	.cc-footer__copy {
		margin-top: 1.5rem;
		padding-inline: .5rem;
		line-height: 1.8;
	}
}

@media (max-width: 479px) {
	.cc-register-form__name-row {
		grid-template-columns: minmax(0, 1fr);
	}

	.cc-related ul.products {
		grid-template-columns: minmax(0, 1fr);
	}

	.cc-pagination,
	.woocommerce-pagination ul.page-numbers {
		flex-wrap: wrap;
	}
	.woocommerce-pagination .page-numbers :is(a, span),
	.woocommerce-pagination :is(a.page-numbers, span.page-numbers) {
		min-width: 38px;
		height: 38px;
		padding-inline: 12px;
	}
	.woocommerce-pagination .page-numbers .current,
	.woocommerce-pagination span.page-numbers.current {
		width: 42px;
		height: 42px;
	}
}

@media (max-width: 359px) {
	:root {
		--pad-x: 1rem;
		--pad-x-md: 1rem;
	}

	.cc-nav {
		gap: .5rem;
	}
	.cc-hero__stage {
		min-height: 330px;
	}
	.cc-hero__tag--a {
		width: 116px;
		height: 54px;
	}
	.cc-hero__tag--b {
		width: 148px;
		height: 56px;
	}
	.cc-hero__tag-copy {
		font-size: 10.5px;
	}
	.cc-hero__tag--c {
		width: 149px;
		height: 48px;
	}
	.cc-home-card__label {
		inset-inline: .75rem;
		padding: .75rem;
	}
	.cc-cart__line {
		grid-template-columns: 84px minmax(0, 1fr);
		gap: .75rem;
	}
	.cc-cart__thumb {
		width: 84px;
		height: 84px;
	}
	.cc-qty-btn {
		width: 36px;
		height: 36px;
	}
}
