/* Match the approved storefront proportions without depending on theme CSS. */
.kst-standalone-preorder #preorders :is(.preorder-track, .kst-preorder-row) > .product-card .product-image img {
	width: auto !important;
	height: 70% !important;
	max-width: none !important;
	max-height: none !important;
	object-fit: contain !important;
	object-position: center bottom !important;
	margin-bottom: 28px !important;
	mix-blend-mode: normal !important;
}

@media (min-width: 981px) {
	.kst-standalone-preorder #preorders .product-image {
		height: var(--preorder-image-height, min(420px, 123cqw)) !important;
	}
}

@media (max-width: 680px) {
	.kst-standalone-preorder #preorders :is(.preorder-track, .kst-preorder-row) > .product-card .product-image img {
		margin-bottom: 20px !important;
	}
}

/* Keep the portable page's plinth and purchase controls identical to the
 * approved WordPress storefront without depending on theme-owned assets. */
.kst-standalone-preorder #preorders .product-card {
	container-type: inline-size;
}

.kst-standalone-preorder #preorders .product-info {
	min-width: 0;
	height: auto !important;
	aspect-ratio: auto !important;
	min-height: 0 !important;
	margin-top: -20px !important;
	padding: clamp(47px, calc(24cqw - 25px), 87px) clamp(16px, 6cqw, 34px) clamp(14px, 5cqw, 26px) !important;
	display: flex !important;
	flex-direction: column !important;
	justify-content: flex-start !important;
	gap: 0 !important;
	transform: translateY(-30px) !important;
	background-color: transparent !important;
	background-image: url("storefront/static/reference/plinth-box-raster-v2.png") !important;
	background-repeat: no-repeat !important;
	background-position: center top !important;
	background-size: 100% 100% !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	overflow: hidden;
}

.kst-standalone-preorder #preorders .product-info::before,
.kst-standalone-preorder #preorders .product-info::after {
	display: none !important;
}

.kst-standalone-preorder #preorders .product-info > * {
	max-width: 100%;
	box-sizing: border-box;
	flex: 0 0 auto;
}

.kst-standalone-preorder #preorders .product-series {
	order: 1 !important;
	width: 100%;
	margin: 3cqw 0 max(0px, calc(5cqw - 5px)) !important;
	padding-bottom: max(0px, calc(5cqw - 5px)) !important;
	border-bottom: 1px solid rgba(83, 65, 72, .28);
	font-size: clamp(7px, 2.7cqw, 11px) !important;
}

.kst-standalone-preorder #preorders .product-info h3 {
	order: 2 !important;
	min-height: 22px !important;
	margin: 3px 0 3px !important;
	font-size: clamp(16px, 7cqw, 34px) !important;
}

.kst-standalone-preorder #preorders .product-info > .price-label {
	order: 3;
	font-size: clamp(7px, 2.7cqw, 10px) !important;
}

.kst-standalone-preorder #preorders .product-info > strong {
	order: 4;
	margin-top: max(0px, calc(3cqw - 5px)) !important;
	font-size: clamp(28px, 11cqw, 56px) !important;
}

.kst-standalone-preorder #preorders .deadline {
	order: 5;
	margin: 2.5px 0 !important;
	padding: 7px 2px 6px !important;
	gap: 3px !important;
	border: 0 !important;
}

.kst-standalone-preorder #preorders .deadline > span {
	color: #66555d !important;
	font-size: clamp(7px, 2.6cqw, 10px) !important;
	font-weight: 600 !important;
	letter-spacing: .12em !important;
	text-transform: uppercase !important;
}

.kst-standalone-preorder #preorders .countdown {
	width: max-content !important;
	margin-inline: auto !important;
	grid-template-columns: repeat(4, 44px) !important;
	column-gap: 12px !important;
	justify-content: center !important;
}

.kst-standalone-preorder #preorders .countdown-unit {
	position: relative;
	width: 44px !important;
	min-width: 44px !important;
	gap: 3px !important;
	padding: 0 1cqw !important;
}

.kst-standalone-preorder #preorders .countdown-unit + .countdown-unit::before {
	content: "";
	position: absolute;
	left: 0;
	top: 1px;
	bottom: 1px;
	width: 1px;
	background: rgba(84, 64, 73, .25);
}

.kst-standalone-preorder #preorders .countdown-unit strong {
	font-size: clamp(21px, 8cqw, 38px) !important;
}

.kst-standalone-preorder #preorders .countdown-unit small {
	font-size: clamp(6px, 2.1cqw, 8px) !important;
}

.kst-standalone-preorder #preorders .stage {
	order: 6;
	width: 100% !important;
	height: auto !important;
	min-height: 36px !important;
	margin: 1px 0 7px !important;
	padding: 6px 1px !important;
	display: grid !important;
	grid-template-columns: 1fr !important;
	place-items: center !important;
	gap: 8px !important;
	border-top: 1px solid #d9cfc8 !important;
	border-bottom: 1px solid #d9cfc8 !important;
}

.kst-standalone-preorder #preorders .stage-dot,
.kst-standalone-preorder #preorders .stage-line {
	display: none !important;
}

.kst-standalone-preorder #preorders .stage > span:nth-child(2) {
	font-size: clamp(9px, 3.2cqw, 13px) !important;
	font-weight: 700 !important;
	letter-spacing: .13em !important;
	line-height: 1 !important;
	text-align: center !important;
}

.kst-standalone-preorder #preorders .payment-options {
	order: 7;
	position: static !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	display: grid !important;
	grid-template-columns: 1fr !important;
	gap: 3px !important;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	overflow: visible;
}

.kst-standalone-preorder #preorders .payment-options a {
	width: 100% !important;
	min-width: 0 !important;
	min-height: clamp(31px, 9cqw, 38px) !important;
	max-width: 100%;
	padding: 5px 6px !important;
	display: flex !important;
	flex-direction: row !important;
	align-items: center;
	justify-content: center;
	gap: 0 !important;
	white-space: nowrap !important;
	overflow: hidden;
	border: 1px solid var(--plum) !important;
}

.kst-standalone-preorder #preorders .payment-options a span,
.kst-standalone-preorder #preorders .payment-options a b {
	display: inline !important;
	width: auto !important;
	max-width: none !important;
	color: inherit !important;
	font-family: Montserrat, sans-serif !important;
	font-size: clamp(7px, 2.75cqw, 11px) !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	letter-spacing: .035em !important;
	white-space: nowrap !important;
}

.kst-standalone-preorder #preorders .payment-options a span::after {
	content: " · ";
	white-space: pre;
}

.kst-standalone-preorder #preorders .payment-options .deposit-button {
	background: rgba(244, 240, 235, .82) !important;
}

@media (max-width: 760px) {
	.kst-standalone-preorder #preorders .product-info {
		transform: translateY(-26px) !important;
	}

	.kst-standalone-preorder #preorders .countdown {
		grid-template-columns: repeat(4, 40px) !important;
		column-gap: 8px !important;
	}

	.kst-standalone-preorder #preorders .countdown-unit {
		width: 40px !important;
		min-width: 40px !important;
	}
}

/* Share available space between the actual products, including the last row.
 * Used by both the embedded homepage and the plugin editor preview. */
.kst-standalone-preorder #preorders .preorder-track {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: clamp(16px, 2vw, 36px) !important;
    transform: none !important;
    overflow: visible !important;
    scroll-snap-type: none !important;
    align-items: flex-end;
}
.kst-standalone-preorder #preorders :is(.preorder-track, .kst-preorder-row) > .product-card {
    flex: 1 1 280px !important;
    min-width: 0;
    max-width: none;
}
@media (max-width: 980px) {
    .kst-standalone-preorder #preorders :is(.preorder-track, .kst-preorder-row) > .product-card {
        flex-basis: 220px !important;
    }
}
@media (max-width: 680px) {
    .kst-standalone-preorder #preorders .preorder-shell {
        width: 100%;
        padding: 0 20px !important;
    }
    .kst-standalone-preorder #preorders :is(.preorder-track, .kst-preorder-row) > .product-card {
        flex-basis: 100% !important;
    }
}

/* Five fixed calendar units: no width shifts as seconds change. */
#kingstudio-preorder-root #preorders .countdown.kst-calendar-countdown,
.kst-standalone-preorder #preorders .countdown.kst-calendar-countdown {
    display: grid !important;
    width: min(100%, 420px) !important;
    grid-template-columns: repeat(var(--kst-countdown-units, 3), minmax(0, 1fr)) !important;
    gap: 0 !important;
    margin-inline: auto !important;
    align-items: start !important;
}
#kingstudio-preorder-root #preorders .kst-calendar-countdown .countdown-unit,
.kst-standalone-preorder #preorders .kst-calendar-countdown .countdown-unit {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 0 3px !important;
    gap: 4px !important;
    text-align: center !important;
}
#kingstudio-preorder-root #preorders .kst-calendar-countdown strong,
.kst-standalone-preorder #preorders .kst-calendar-countdown strong {
    display: block !important;
    width: 100% !important;
    font-variant-numeric: tabular-nums lining-nums !important;
    font-feature-settings: "tnum" 1, "lnum" 1 !important;
    font-size: clamp(20px, 6.5cqw, 44px) !important;
    line-height: 1.15 !important;
    letter-spacing: 0 !important;
}
#kingstudio-preorder-root #preorders .kst-calendar-countdown small,
.kst-standalone-preorder #preorders .kst-calendar-countdown small {
    font-size: clamp(8px, 1.8cqw, 11px) !important;
    line-height: 1.3 !important;
    letter-spacing: .03em !important;
    white-space: nowrap !important;
}

/* Selected reference: fixed ivory tiles, no seconds, optional months. */
#kingstudio-preorder-root #preorders .product-info .deadline,
.kst-standalone-preorder #preorders .product-info .deadline {
    width: 100% !important;
    box-sizing: border-box;
}
#kingstudio-preorder-root #preorders .countdown.kst-calendar-countdown,
.kst-standalone-preorder #preorders .countdown.kst-calendar-countdown {
    --kst-tile-size: clamp(40px, 12cqw, 82px);
    grid-template-columns: repeat(var(--kst-countdown-units, 3), var(--kst-tile-size)) !important;
    width: max-content !important;
    max-width: 100%;
    gap: clamp(4px, 1.4cqw, 10px) !important;
    justify-content: center !important;
    align-items: stretch !important;
    margin-inline: auto !important;
}
#kingstudio-preorder-root #preorders .kst-calendar-countdown .countdown-unit,
.kst-standalone-preorder #preorders .kst-calendar-countdown .countdown-unit {
    height: clamp(56px, 12cqw, 82px);
    background: #faf7f2 !important;
    border: 1px solid #cfc5bb !important;
    border-radius: 6px !important;
    padding: 5px 2px !important;
    gap: 4px !important;
    justify-content: center !important;
}
#kingstudio-preorder-root #preorders .kst-calendar-countdown strong,
.kst-standalone-preorder #preorders .kst-calendar-countdown strong {
    font-family: Arial, Helvetica, sans-serif !important;
    font-weight: 700 !important;
    font-size: clamp(20px, 5cqw, 30px) !important;
    line-height: 1.1 !important;
    color: #502b43 !important;
    white-space: nowrap !important;
}
#kingstudio-preorder-root #preorders .kst-calendar-countdown small,
.kst-standalone-preorder #preorders .kst-calendar-countdown small {
    color: #818083 !important;
    font-family: Arial, Helvetica, sans-serif !important;
    letter-spacing: 0 !important;
}

/* Equal group-order columns: final item must never grow to fill its row. */
#kingstudio-preorder-root #preorders .preorder-track,
.kst-standalone-preorder #preorders .preorder-track {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    align-items: end !important;
}
#kingstudio-preorder-root #preorders :is(.preorder-track, .kst-preorder-row) > .product-card,
.kst-standalone-preorder #preorders :is(.preorder-track, .kst-preorder-row) > .product-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    grid-column: auto !important;
}
@media (max-width: 980px) {
    #kingstudio-preorder-root #preorders .preorder-track,
    .kst-standalone-preorder #preorders .preorder-track {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
/* The homepage intentionally has a 1440px viewport; use device width too. */
@media (max-device-width: 680px) and (min-width: 681px) {
    #kingstudio-preorder-root #preorders .preorder-track,
    .kst-standalone-preorder #preorders .preorder-track {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 680px) {
    #kingstudio-preorder-root #preorders .preorder-track,
    .kst-standalone-preorder #preorders .preorder-track {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* Desktop five equal cards; phones three plus two, centered without stretching. */
#kingstudio-preorder-root #preorders .preorder-track,
.kst-standalone-preorder #preorders .preorder-track {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: flex-end !important;
    gap: 24px !important;
}
#kingstudio-preorder-root #preorders :is(.preorder-track, .kst-preorder-row) > .product-card,
.kst-standalone-preorder #preorders :is(.preorder-track, .kst-preorder-row) > .product-card {
    flex: 0 0 calc((100% - 96px) / 5) !important;
    width: calc((100% - 96px) / 5) !important;
    min-width: 0 !important;
    max-width: none !important;
}
@media (max-width: 680px), (max-device-width: 680px) {
    #kingstudio-preorder-root #preorders .preorder-track,
    .kst-standalone-preorder #preorders .preorder-track {
        gap: 12px !important;
    }
    #kingstudio-preorder-root #preorders :is(.preorder-track, .kst-preorder-row) > .product-card,
    .kst-standalone-preorder #preorders :is(.preorder-track, .kst-preorder-row) > .product-card {
        flex: 0 0 calc((100% - 24px) / 3) !important;
        width: calc((100% - 24px) / 3) !important;
    }
}

/* All products, grouped in balanced rows; smaller top rows are centered. */
#kingstudio-preorder-root #preorders .preorder-track,.kst-standalone-preorder #preorders .preorder-track{display:flex!important;flex-direction:column!important;gap:48px!important;align-items:stretch!important}
.kst-preorder-row{display:flex;justify-content:center;align-items:flex-end;gap:24px;width:100%}
#kingstudio-preorder-root #preorders .kst-preorder-row>.product-card,.kst-standalone-preorder #preorders .kst-preorder-row>.product-card{flex:0 0 calc((100% - (var(--kst-row-max) - 1)*24px)/var(--kst-row-max))!important;width:calc((100% - (var(--kst-row-max) - 1)*24px)/var(--kst-row-max))!important;min-width:0!important;display:block!important}
.kst-standalone-preorder #preorders .carousel-arrow{display:none!important}
@media(max-width:680px),(max-device-width:680px){.kst-preorder-row{gap:12px;flex-wrap:wrap}#kingstudio-preorder-root #preorders .kst-preorder-row>.product-card,.kst-standalone-preorder #preorders .kst-preorder-row>.product-card{flex-basis:calc((100% - 24px)/3)!important;width:calc((100% - 24px)/3)!important}}

/* Mobile cards reflow across desktop row wrappers: six=3+3, five=3+2. */
@media (max-width: 767px), (max-device-width: 767px) {
    #kingstudio-preorder-root #preorders .preorder-track,
    .kst-standalone-preorder #preorders .preorder-track {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: flex-end !important;
        gap: 12px !important;
    }
    #kingstudio-preorder-root #preorders .preorder-track > .kst-preorder-row,
    .kst-standalone-preorder #preorders .preorder-track > .kst-preorder-row {
        display: contents !important;
    }
    #kingstudio-preorder-root #preorders :is(.preorder-track, .kst-preorder-row) > .product-card,
    .kst-standalone-preorder #preorders :is(.preorder-track, .kst-preorder-row) > .product-card {
        flex: 0 0 calc((100% - 24px) / 3) !important;
        width: calc((100% - 24px) / 3) !important;
        min-width: 0 !important;
        max-width: none !important;
        margin-inline: 0 !important;
    }
}

/* Shared product-name typography in the standalone editor and storefront. */
@font-face{font-family:'KST Product Condensed';src:url('/wp-content/mu-plugins/kst-product-type/roboto-condensed-variable.ttf') format('truetype');font-style:normal;font-weight:100 900;font-display:swap}
body #preorders .product-card .product-info h3,body #preorders .product-card .product-info h3 *{font-family:'KST Product Condensed','Arial Narrow',Arial,sans-serif!important;font-weight:500!important;font-style:normal!important;letter-spacing:0!important;text-transform:uppercase!important}

/* One heading typeface throughout the storefront. */
html body :is(h1,h2,h3,h4,h5,h6,.elementor-heading-title,.page-title,.entry-title,.widget-title,.woocommerce-loop-category__title,.kst-origin-card__titles strong,.collection-card b,.hot-card b,.series-list span,.account-space__title,.kst-original-footer strong,.kst-home-promotions__copy strong),
html body :is(h1,h2,h3,h4,h5,h6,.elementor-heading-title,.page-title,.entry-title,.widget-title) :is(a,span,strong,b,em){
font-family:'KST Product Condensed','Arial Narrow',Arial,sans-serif!important;
font-weight:500!important;font-style:normal!important;letter-spacing:0!important;
}

/* Cutout figures may extend beyond their plinth when scaled in the editor.
 * Keep image overflow visible without changing card geometry or info clipping. */
.kst-standalone-preorder #preorders .product-card:has(> .product-image.display-mode-cutout) {
    overflow: visible !important;
}
body .kst-el-preorders:has(.kst-standalone-preorder .product-image.display-mode-cutout) {
    overflow: visible !important;
}
