/**
 * Mobile layout fixes — header, borders, PDP, catalogue
 */

html,
body.dd-shell {
	overflow-x: hidden;
	max-width: 100vw;
}

body.dd-shell #wrapper,
body.dd-shell .dd-site-header,
body.dd-shell .dd-announcement,
body.dd-shell .dd-mobile-nav,
body.dd-shell .dd-site-footer {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

/* Full-bleed borders (no cut-off lines) */
body.dd-shell .dd-site-header,
body.dd-shell .dd-mobile-nav,
body.dd-shell .dd-site-footer,
body.dd-shell .dd-legal,
body.dd-shell .dd-archive-head,
body.dd-shell .dd-pdp-details,
body.dd-shell .dd-related {
	border-left: 0 !important;
	border-right: 0 !important;
}

@media (max-width: 900px) {
	.dd-announcement {
		font-size: 0.62rem;
		letter-spacing: 0.1em;
		padding: 0.55rem 0.75rem;
		line-height: 1.35;
	}

	.dd-site-header {
		display: grid !important;
		grid-template-columns: 1fr auto;
		align-items: center;
		gap: 0.5rem 0.75rem;
		padding: 0.85rem 1rem !important;
		width: 100% !important;
		border-bottom: 1px solid var(--dd-line, rgba(20, 18, 16, 0.12)) !important;
	}

	.dd-brand {
		font-size: 1.25rem !important;
		letter-spacing: 0.06em !important;
		white-space: nowrap !important;
		line-height: 1.1 !important;
		grid-column: 1;
		justify-self: start;
	}

	.dd-header-actions {
		grid-column: 2;
		justify-self: end;
		align-items: center;
		gap: 0.65rem !important;
	}

	.dd-header-actions a {
		font-size: 0.65rem !important;
		letter-spacing: 0.08em !important;
		white-space: nowrap;
	}

	/* Hide Search label on small phones — keep Bag + menu */
	.dd-header-actions a:first-child {
		display: none;
	}

	.dd-nav-toggle {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		width: 44px !important;
		height: 44px !important;
		padding: 0 !important;
		margin: 0;
		vertical-align: middle;
	}

	.dd-mobile-nav {
		width: 100%;
		padding: 1rem !important;
		box-sizing: border-box;
		border-bottom: 1px solid var(--dd-line, rgba(20, 18, 16, 0.12)) !important;
	}

	.dd-mobile-nav a {
		text-align: center;
		padding: 0.55rem 0;
		border-bottom: 1px solid var(--dd-line, rgba(20, 18, 16, 0.08));
	}

	.dd-mobile-nav a:last-child {
		border-bottom: 0;
	}

	/* Catalogue / shop — centre product text on mobile */
	body.dd-shell.woocommerce-shop #main,
	body.dd-shell.tax-product_cat #main,
	body.dd-shell.tax-product_tag #main,
	body.dd-shell.post-type-archive-product #main {
		padding: 1rem 1rem 2.5rem !important;
		box-sizing: border-box;
	}

	body.dd-shell .dd-archive-head {
		text-align: center;
		padding: 0 0.5rem;
		margin-bottom: 1.75rem;
	}

	body.dd-shell ul.products,
	body.dd-shell .products.row {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 1.25rem 0.85rem !important;
	}

	body.dd-shell .product-small .box-text,
	body.dd-shell .product-small .product-title,
	body.dd-shell .product-small .name,
	body.dd-shell .product-small .price,
	body.dd-shell .product-small .afterpay-paragraph,
	body.dd-shell .product-small [class*="afterpay"] {
		text-align: center !important;
	}

	body.dd-shell .product-small .box-text {
		padding: 0 0.15rem !important;
	}

	/* Homepage products */
	.dd-products {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 1.25rem 0.85rem !important;
		padding: 0 1rem;
		box-sizing: border-box;
	}

	.dd-product,
	.dd-product__title,
	.dd-product__price {
		text-align: center !important;
	}

	.dd-section {
		padding-left: 1rem !important;
		padding-right: 1rem !important;
	}

	.dd-occasions__grid {
		grid-template-columns: 1fr !important;
	}

	.dd-occasion {
		text-align: center;
		min-height: 0;
		padding: 1.5rem 1.25rem;
	}

	/* Product page mobile */
	body.dd-shell.single-product #main {
		padding: 0.75rem 1rem 2.5rem !important;
		box-sizing: border-box;
		overflow-x: hidden;
	}

	.dd-pdp-grid {
		grid-template-columns: 1fr !important;
		gap: 1.25rem !important;
	}

	.dd-pdp-gallery {
		grid-template-columns: 1fr !important;
		width: 100%;
	}

	.dd-pdp-main {
		width: 100% !important;
		max-width: 100% !important;
		max-height: none !important;
		aspect-ratio: 2 / 3;
		margin: 0 auto;
	}

	.dd-pdp-main img {
		object-fit: cover !important;
		object-position: center top !important;
	}

	.dd-pdp-thumbs {
		order: 2;
		flex-direction: row !important;
		justify-content: center !important;
		flex-wrap: nowrap;
		gap: 0.5rem !important;
		max-height: none !important;
		overflow-x: auto;
		padding: 0.25rem 0 0.35rem;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.dd-pdp-thumbs::-webkit-scrollbar {
		display: none;
	}

	.dd-pdp-thumb {
		width: 64px !important;
		height: 86px !important;
		flex: 0 0 64px !important;
	}

	.dd-crumbs {
		justify-content: center;
		text-align: center;
		font-size: 0.62rem !important;
		line-height: 1.4;
	}

	.dd-pdp-info {
		max-width: none !important;
		width: 100% !important;
		text-align: center;
		padding: 0;
	}

	.dd-pdp-info .dd-eyebrow {
		white-space: normal !important;
		overflow: visible !important;
		text-overflow: unset !important;
		font-size: 0.62rem;
		line-height: 1.45;
		margin-left: auto;
		margin-right: auto;
		max-width: 100%;
	}

	.dd-pdp-title {
		font-size: clamp(1.55rem, 7vw, 2rem) !important;
		text-align: center !important;
	}

	.dd-pdp-price,
	.dd-pdp-desc {
		text-align: center;
		margin-left: auto;
		margin-right: auto;
	}

	.dd-pdp-desc {
		max-width: 36rem;
	}

	/* Afterpay must wrap, not clip */
	.dd-pdp-info .afterpay-paragraph,
	.dd-pdp-info [class*="afterpay"],
	.dd-pdp-info [class*="Afterpay"] {
		display: flex !important;
		flex-wrap: wrap !important;
		justify-content: center !important;
		align-items: center !important;
		gap: 0.25rem 0.4rem !important;
		max-width: 100% !important;
		overflow: visible !important;
		white-space: normal !important;
		text-align: center !important;
		line-height: 1.45 !important;
		font-size: 0.78rem !important;
		margin: 0.35rem auto 1rem !important;
	}

	.dd-pdp-info .afterpay-paragraph img,
	.dd-pdp-info [class*="afterpay"] img {
		max-width: 72px !important;
		height: auto !important;
		flex: 0 0 auto;
	}

	.dd-pdp-cart,
	.dd-pdp-cart form.cart,
	.dd-pdp-cart .variations,
	.dd-pdp-cart .variations select,
	.dd-pdp-cart .single_add_to_cart_button {
		width: 100% !important;
		max-width: 100% !important;
	}

	.dd-pdp-cart .variations label,
	.dd-pdp-cart .variations .label {
		text-align: left;
	}

	.dd-pdp-cart .quantity {
		margin-left: auto !important;
		margin-right: auto !important;
	}

	.dd-size-help,
	.dd-pdp-promises {
		text-align: center;
		max-width: none !important;
		margin-left: auto;
		margin-right: auto;
	}

	.dd-pdp-promises {
		justify-items: center;
	}

	.dd-related .dd-products {
		grid-template-columns: repeat(2, 1fr) !important;
		padding: 0;
	}
}

@media (max-width: 560px) {
	.dd-brand {
		font-size: 1.15rem !important;
	}

	body.dd-shell ul.products,
	body.dd-shell .products.row,
	.dd-products {
		grid-template-columns: 1fr 1fr !important;
	}

	.dd-footer-grid {
		grid-template-columns: 1fr !important;
		text-align: center;
	}

	.dd-site-footer .dd-brand {
		display: inline-block;
	}
}
