/**
 * AltCtrl inner pages — tablet layout (768–1024px).
 * Matches home page tablet shell: desktop header, compact gutters, no mobile chrome.
 */

@media (min-width: 768px) and (max-width: 1024px) {
	:root {
		--ac-tablet-gutter: clamp(1rem, 2.5vw, 1.5rem);
		--ac-tablet-radius: 1rem;
		--ac-tablet-blue: #0066ff;
		--ac-tablet-text: #0f172a;
		--ac-tablet-muted: #64748b;
		--ac-tablet-border: #e8edf3;
	}

	/* Shared page shell */
	body.altctrl-mobile-layout:not(.page-template-template-homepage-v2) #content.site-content > .col-full,
	body.altctrl-mobile-layout:not(.page-template-template-homepage-v2) .site-content > .col-full {
		padding-left: var(--ac-tablet-gutter) !important;
		padding-right: var(--ac-tablet-gutter) !important;
	}

	body.altctrl-mobile-layout:not(.page-template-template-homepage-v2) #primary.content-area {
		padding-top: clamp(0.75rem, 1.5vw, 1rem);
		padding-bottom: 0;
	}

	/* ---------------------------------------------------------------------- */
	/* Cart — stacked on tablet; card rows prevent table overlap             */
	/* ---------------------------------------------------------------------- */

	body.altctrl-cart-page.woocommerce-cart .cart-wrapper {
		grid-template-columns: 1fr !important;
	}

	body.altctrl-cart-page .altctrl-cart-features {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	/* ---------------------------------------------------------------------- */
	/* Checkout                                                                */
	/* ---------------------------------------------------------------------- */

	body.altctrl-checkout-page.woocommerce-checkout .altctrl-checkout-layout {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) min(20rem, 36%) !important;
		gap: clamp(1rem, 2vw, 1.5rem) !important;
		align-items: start !important;
	}

	body.altctrl-checkout-page.woocommerce-checkout #content.site-content {
		background: transparent !important;
	}

	body.altctrl-checkout-page.woocommerce-checkout .altctrl-checkout-billing-card {
		background: transparent !important;
		box-shadow: none !important;
		padding: 0 !important;
		margin: 0 !important;
		border-radius: 0 !important;
	}

	body.altctrl-checkout-page.woocommerce-checkout .altctrl-checkout-billing-card__subtitle,
	body.altctrl-checkout-page.woocommerce-checkout .altctrl-checkout-continue--mobile {
		display: none !important;
	}

	body.altctrl-checkout-page.woocommerce-checkout .altctrl-checkout-billing-card__title {
		margin: 0 0 1rem !important;
		padding: 0 0 0.625rem !important;
		border-bottom: 0.0625rem solid var(--ac-tablet-border) !important;
		font-size: 1.05rem !important;
	}

	body.altctrl-checkout-page.woocommerce-checkout .altctrl-checkout-main > h3:first-child {
		display: block !important;
	}

	/* Always show order summary / payment on tablet (no mobile billing-only step) */
	body.altctrl-checkout-page.woocommerce-checkout .altctrl-checkout-layout.altctrl-checkout-step-billing .altctrl-checkout-sidebar,
	body.altctrl-checkout-page.woocommerce-checkout .altctrl-checkout-layout.altctrl-checkout-step-billing .col-2,
	body.altctrl-checkout-page.woocommerce-checkout .altctrl-checkout-layout.altctrl-checkout-step-billing .woocommerce-additional-fields,
	body.altctrl-checkout-page.woocommerce-checkout .altctrl-checkout-sidebar {
		display: block !important;
		visibility: visible !important;
		width: 100% !important;
		max-width: none !important;
	}

	body.altctrl-checkout-page.woocommerce-checkout .altctrl-checkout-sidebar {
		position: sticky;
		top: 1rem;
		background: #fff;
		border-radius: 0.875rem;
		box-shadow: 0 0.0625rem 0.1875rem rgba(15, 23, 42, 0.06), 0 0.25rem 0.75rem rgba(15, 23, 42, 0.04);
		padding: 1rem 0.875rem;
	}

	/* ---------------------------------------------------------------------- */
	/* My Account (logged-in)                                                  */
	/* ---------------------------------------------------------------------- */

	body.altctrl-myaccount-page.altctrl-myaccount-logged-in .altctrl-myaccount {
		grid-template-columns: min(13rem, 28%) minmax(0, 1fr) !important;
		max-width: min(75rem, 100%) !important;
		overflow: hidden !important;
		border-radius: var(--ac-tablet-radius) !important;
		box-shadow: 0 0.0625rem 0.1875rem rgba(15, 23, 42, 0.06);
	}

	body.altctrl-myaccount-page.altctrl-myaccount-logged-in .altctrl-myaccount-sidebar {
		border-right: 0.0625rem solid var(--ac-tablet-border) !important;
		border-bottom: 0 !important;
	}

	body.altctrl-myaccount-page.altctrl-myaccount-logged-in .woocommerce-MyAccount-navigation li a {
		white-space: normal !important;
		font-size: 0.8125rem !important;
		padding: 0.5rem 0.875rem !important;
	}

	body.altctrl-myaccount-page.altctrl-myaccount-logged-in .altctrl-myaccount-stats {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}

	body.altctrl-myaccount-page.altctrl-myaccount-logged-in .altctrl-myaccount-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}

	/* ---------------------------------------------------------------------- */
	/* My Account auth (login / lost password)                                 */
	/* ---------------------------------------------------------------------- */

	body.altctrl-myaccount-auth-page .altctrl-signin__hero,
	body.altctrl-myaccount-auth-page .altctrl-signin__card,
	body.altctrl-myaccount-auth-page .altctrl-signin__trust {
		width: min(100% - 2rem, 42rem) !important;
	}

	/* ---------------------------------------------------------------------- */
	/* Single product                                                          */
	/* ---------------------------------------------------------------------- */

	body.altctrl-single-product-page.single-product .single-product-wrapper {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
		grid-template-areas:
			"summary gallery"
			"purchase purchase"
			"pincode pincode" !important;
		gap: clamp(1rem, 2vw, 1.5rem) !important;
		align-items: start !important;
	}

	/* Title / meta left, product image right */
	body.altctrl-single-product-page.single-product .entry-summary {
		grid-area: summary !important;
		width: 100% !important;
		max-width: none !important;
		float: none !important;
		min-width: 0 !important;
	}

	body.altctrl-single-product-page.single-product .product-images-wrapper {
		grid-area: gallery !important;
		width: 100% !important;
		max-width: none !important;
		float: none !important;
		min-width: 0 !important;
	}

	/* Price / ATC / Buy Now / trust — full width like pincode */
	body.altctrl-single-product-page.single-product .single-product-wrapper > .product-actions-wrapper,
	body.altctrl-single-product-page.single-product .single-product-wrapper > .altctrl-purchase-block {
		grid-area: purchase !important;
		width: 100% !important;
		max-width: none !important;
		margin: 0 !important;
		min-width: 0 !important;
	}

	body.altctrl-single-product-page.single-product .single-product-wrapper > .product-actions-wrapper .product-actions,
	body.altctrl-single-product-page.single-product .single-product-wrapper > .product-actions-wrapper .altctrl-purchase-block {
		width: 100% !important;
		max-width: none !important;
		margin: 0 !important;
	}

	body.altctrl-single-product-page.single-product .single-product-wrapper .altctrl-purchase-block .altctrl-pdp-controls__main {
		flex-wrap: nowrap !important;
		width: 100% !important;
	}

	body.altctrl-single-product-page.single-product .single-product-wrapper .altctrl-purchase-block .altctrl-add-to-cart-btn,
	body.altctrl-single-product-page.single-product .single-product-wrapper .altctrl-purchase-block .single_add_to_cart_button {
		flex: 1 1 auto !important;
		min-width: 0 !important;
		overflow: visible !important;
		white-space: nowrap !important;
	}

	body.altctrl-single-product-page.single-product .single-product-wrapper .altctrl-purchase-block .altctrl-buy-now-btn,
	body.altctrl-single-product-page.single-product .single-product-wrapper .altctrl-purchase-block .altctrl-service-bar {
		width: 100% !important;
		max-width: none !important;
	}

	/* Delivery / pincode full width under purchase */
	body.altctrl-single-product-page.single-product .single-product-wrapper > .altctrl-pincode-check {
		grid-area: pincode !important;
		width: 100% !important;
		max-width: none !important;
		margin: 0 !important;
	}

	body.altctrl-single-product-page.single-product .altctrl-pincode-check__help-columns {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 0.35rem clamp(1.25rem, 3vw, 2.5rem) !important;
	}

	body.altctrl-single-product-page.single-product .altctrl-pincode-check__help-list li {
		align-items: center !important;
	}

	body.altctrl-single-product-page.single-product .altctrl-pincode-check__help-area {
		white-space: normal !important;
		word-break: normal !important;
		overflow-wrap: break-word !important;
	}

	body.altctrl-single-product-page.single-product .product-images-wrapper .woocommerce-product-gallery .flex-viewport img,
	body.altctrl-single-product-page.single-product .product-images-wrapper .techmarket-single-product-gallery-images .slick-slide img {
		max-height: 22rem !important;
	}

	body.altctrl-single-product-page.single-product .entry-summary .product_title {
		font-size: clamp(1.125rem, 2vw, 1.375rem) !important;
	}

	body.altctrl-single-product-page.single-product .altctrl-info-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}

	body.altctrl-single-product-page.single-product .altctrl-primary-actions {
		flex-direction: row !important;
		flex-wrap: wrap !important;
	}

	body.altctrl-single-product-page.single-product .altctrl-product-accordion {
		grid-column: 1 / -1;
		margin-top: 0.5rem !important;
	}

	body.altctrl-single-product-page.single-product .altctrl-reviews-section {
		grid-column: 1 / -1;
	}

	/* ---------------------------------------------------------------------- */
	/* Policy / legal / about pages                                            */
	/* ---------------------------------------------------------------------- */

	body.altctrl-policy-page .altctrl-policy {
		padding: clamp(1.5rem, 3vw, 2.25rem) 0 clamp(2rem, 4vw, 2.75rem) !important;
	}

	body.altctrl-policy-page .altctrl-policy__container {
		width: min(100% - 2rem, 42rem) !important;
	}

	body.altctrl-policy-page .altctrl-policy__title {
		font-size: clamp(1.5rem, 2.8vw, 1.875rem) !important;
	}

	body.altctrl-policy-page .altctrl-policy__body {
		border-radius: var(--ac-tablet-radius) !important;
	}

	/* ---------------------------------------------------------------------- */
	/* Contact                                                                 */
	/* ---------------------------------------------------------------------- */

	body.altctrl-contact-page .altctrl-contact__hero,
	body.altctrl-contact-page .altctrl-contact__layout,
	body.altctrl-contact-page .altctrl-contact__support {
		width: min(100% - 2rem, 56rem) !important;
	}

	body.altctrl-contact-page .altctrl-contact__layout {
		grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr) !important;
		gap: clamp(1rem, 2vw, 1.5rem) !important;
	}

	body.altctrl-contact-page .altctrl-contact__support {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}

	/* ---------------------------------------------------------------------- */
	/* Track order                                                             */
	/* ---------------------------------------------------------------------- */

	body.altctrl-track-order-page .altctrl-track__shell {
		width: min(100% - 2rem, 56rem) !important;
		margin-inline: auto !important;
	}

	body.altctrl-track-order-page .altctrl-track {
		padding-top: var(--ac-track-shell-y, clamp(1.5rem, 3vw, 2rem)) !important;
		padding-bottom: var(--ac-track-card-y, clamp(1.5rem, 3vw, 2rem)) !important;
	}

	/* ---------------------------------------------------------------------- */
	/* Order confirmation / thank you                                          */
	/* ---------------------------------------------------------------------- */

	body.woocommerce-order-received #content.site-content > .col-full,
	body.woocommerce-order-received .site-content > .col-full {
		max-width: min(42rem, 100%) !important;
		margin-inline: auto !important;
	}

	body.woocommerce-order-received .woocommerce-order {
		padding: clamp(1rem, 2vw, 1.5rem) !important;
		border: 0.0625rem solid var(--ac-tablet-border) !important;
		border-radius: var(--ac-tablet-radius) !important;
		background: #fff !important;
		box-shadow: 0 0.0625rem 0.1875rem rgba(15, 23, 42, 0.06) !important;
	}

	/* ---------------------------------------------------------------------- */
	/* Search results (product search uses archive styling)                    */
	/* ---------------------------------------------------------------------- */

	body.altctrl-search-page .shop-control-bar .handheld-sidebar-toggle {
		display: none !important;
	}
}
