/* Thuận Phát Vinatex – component styles (0.3.2 design foundation).
 * Source of truth for colour, type, spacing, radius and shadow is theme.json; this file only maps those
 * presets to short --tp-* tokens and styles components. The --tp-* colour names are a contract with the
 * Business Core plugin (its blocks.css reads them) – rename none of them. See docs/CC2-DESIGN-SYSTEM.md.
 * Breakpoints (media queries cannot read custom properties): 600px core navigation, 782px core columns,
 * 1024px tablet landscape, 1200px wide content. */

/* ==========================================================================
   1. Tokens
   ========================================================================== */
:root {
	/* Brand colours (theme.json palette, measured from the logo) */
	--tp-navy: var(--wp--preset--color--navy, #00467c);
	--tp-blue: var(--wp--preset--color--blue, #006cb6);
	--tp-red: var(--wp--preset--color--red, #e52c2f);
	--tp-cta: var(--wp--preset--color--red-cta, #cf2429);
	--tp-maroon: var(--wp--preset--color--maroon, #961a20);
	--tp-tint: var(--wp--preset--color--tint, #f5f8fc);
	--tp-ink: var(--wp--preset--color--ink, #1a2b3f);
	--tp-muted: var(--wp--preset--color--muted, #4a5a6e);
	--tp-line: var(--wp--preset--color--line, #d8e1eb);
	--tp-surface: var(--wp--preset--color--white, #fff);
	--tp-tint-2: #eaf0f7;

	/* Text and lines on navy (all ≥ 6:1 against #00467C) */
	--tp-on-dark: #fff;
	--tp-on-dark-strong: rgba(255, 255, 255, .9);
	--tp-on-dark-soft: rgba(255, 255, 255, .8);
	--tp-on-dark-line: rgba(255, 255, 255, .25);
	--tp-on-dark-accent: #8ec5ee;
	--tp-on-dark-eyebrow: #ffb3b4;

	/* Shape, depth, motion (theme.json settings.custom / shadow presets) */
	--tp-radius-sm: var(--wp--custom--radius--sm, 4px);
	--tp-radius: var(--wp--custom--radius--md, 8px);
	--tp-radius-lg: var(--wp--custom--radius--lg, 12px);
	--tp-radius-pill: var(--wp--custom--radius--pill, 999px);
	--tp-control-h: var(--wp--custom--control--min-height, 44px);
	--tp-control-radius: var(--wp--custom--control--radius, 6px);
	--tp-shadow: var(--wp--preset--shadow--card, 0 1px 2px rgba(0, 40, 80, .06), 0 8px 24px rgba(0, 40, 80, .07));
	--tp-shadow-raised: var(--wp--preset--shadow--raised, 0 2px 4px rgba(0, 40, 80, .06), 0 16px 40px rgba(0, 40, 80, .12));
	--tp-shadow-float: 0 16px 40px rgba(0, 20, 50, .22);
	--tp-fast: var(--wp--custom--motion--fast, 150ms);
	--tp-base: var(--wp--custom--motion--base, 200ms);
	--tp-ease: var(--wp--custom--motion--ease, cubic-bezier(.2, 0, 0, 1));

	/* Spacing (theme.json spacing presets) */
	--tp-space-2xs: var(--wp--preset--spacing--10, .25rem);
	--tp-space-xs: var(--wp--preset--spacing--20, .5rem);
	--tp-space-s: var(--wp--preset--spacing--30, 1rem);
	--tp-space-m: var(--wp--preset--spacing--40, 1.5rem);
	--tp-space-l: var(--wp--preset--spacing--50, clamp(2rem, 4vw, 3rem));

	/* Focus ring: blue on light surfaces (5.5:1), white on navy (blue would be 1.76:1) */
	--tp-focus-color: var(--tp-blue);
	--tp-focus-width: var(--wp--custom--focus--width, 2px);
	--tp-focus-offset: var(--wp--custom--focus--offset, 3px);
}
.has-navy-background-color,
.tp-footer,
.tp-topbar { --tp-focus-color: #fff; }

/* ==========================================================================
   2. Base
   ========================================================================== */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: var(--tp-focus-width) solid var(--tp-focus-color); outline-offset: var(--tp-focus-offset); }
/* theme.json sets a :focus outline on buttons; keep it keyboard-only and dark-surface aware. */
.wp-element-button:focus:not(:focus-visible) { outline: none; }
.wp-element-button:focus-visible, .wp-block-button__link:focus-visible { outline: var(--tp-focus-width) solid var(--tp-focus-color); outline-offset: var(--tp-focus-offset); }
img { max-width: 100%; height: auto; }
.screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important; }
:where(h1, h2, h3) { text-wrap: balance; }
:where(p, li) { text-wrap: pretty; }
a[href^="tel:"] { font-variant-numeric: tabular-nums; white-space: nowrap; }
:where(.wp-block-post-content, .tp-prose) a:where(:not(.wp-element-button):not(.tp-btn)) { text-underline-offset: .18em; text-decoration-thickness: 1px; }
:where(.wp-block-post-content, .tp-prose) a:where(:not(.wp-element-button):not(.tp-btn)):hover { text-decoration-thickness: 2px; }

/* ==========================================================================
   3. Buttons – one system for core Buttons and the plugin's .tp-btn
   ========================================================================== */
.wp-block-button__link,
.tp-btn { min-height: var(--tp-control-h); border-radius: var(--tp-control-radius); line-height: 1.2; transition: background-color var(--tp-fast) var(--tp-ease), color var(--tp-fast) var(--tp-ease), border-color var(--tp-fast) var(--tp-ease), box-shadow var(--tp-fast) var(--tp-ease); }
.wp-block-button__link { display: inline-flex; align-items: center; justify-content: center; text-align: center; box-sizing: border-box; }
.tp-btn { font-size: 1rem; padding: .7rem 1.25rem; }
.tp-btn--primary,
.wp-block-button:not(.is-style-outline) > .wp-block-button__link { box-shadow: 0 1px 2px rgba(150, 26, 32, .18); }
.tp-btn--primary:hover,
.wp-block-button:not(.is-style-outline) > .wp-block-button__link:hover { box-shadow: 0 4px 12px rgba(150, 26, 32, .25); }
/* Outline buttons on light surfaces: navy outline (core default would inherit the red CTA). */
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) { color: var(--tp-navy); border: 1.5px solid currentColor; background: transparent; }
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color):hover { background: var(--tp-navy); border-color: var(--tp-navy); color: #fff; }
/* Outline buttons on navy (hero pattern sets white text/border inline): fill on hover. */
.has-navy-background-color .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) { color: #fff; border-color: rgba(255, 255, 255, .7); }
.has-navy-background-color .wp-block-button.is-style-outline > .wp-block-button__link:hover { background: #fff; color: var(--tp-navy) !important; }
.tp-quote-button .tp-btn { white-space: nowrap; }

/* ==========================================================================
   4. Top bar + header
   ========================================================================== */
.tp-topbar { font-size: .8125rem; }
.tp-topbar .tp-info { margin: 0; }
.tp-topbar a { color: inherit; text-decoration: none; }
.tp-topbar a:hover { text-decoration: underline; }
.tp-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--tp-line); box-shadow: 0 1px 0 rgba(0, 40, 80, .02), 0 6px 18px rgba(0, 40, 80, .05); }
.admin-bar .tp-header { top: var(--wp-admin--admin-bar--height, 32px); }
.tp-header .wp-block-site-logo img { display: block; }
.tp-header .wp-block-navigation a { color: var(--tp-ink); }
.tp-header .wp-block-navigation .wp-block-navigation-item__content { padding-block: .5rem; }
.tp-header .wp-block-navigation a:hover, .tp-header .wp-block-navigation .current-menu-item > a, .tp-header .wp-block-navigation [aria-current="page"] { color: var(--tp-navy); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; text-decoration-color: var(--tp-red); }
.tp-header .wp-block-navigation__responsive-container.is-menu-open { padding: var(--tp-space-m); }
.tp-header .wp-block-navigation__responsive-container-open,
.tp-header .wp-block-navigation__responsive-container-close { min-width: var(--tp-control-h); min-height: var(--tp-control-h); justify-content: center; align-items: center; }
@media (max-width: 781px) {
	.tp-hide-mobile { display: none !important; }
}
@media (min-width: 782px) {
	.tp-hide-desktop { display: none !important; }
}
/* Six menu items + logo + "Yêu cầu tư vấn & báo giá" need ~1000px. Core only switches to the hamburger
   below 600px, so keep the overlay menu up to 1023px to stop the header row overflowing on tablets. */
@media (min-width: 600px) and (max-width: 1023px) {
	.tp-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.tp-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
	/* The header row is space-between: without this the lone hamburger sits centred between logo and CTA. */
	.tp-header .wp-block-navigation { margin-left: auto; }
}
@media (min-width: 1024px) and (max-width: 1199px) {
	.tp-header .wp-block-navigation .wp-block-navigation__container { gap: 1rem; }
	.tp-header .wp-block-navigation { font-size: .9rem; }
}
/* Mobile menu overlay: left-aligned items, larger tap targets; hide floating widget while open */
.tp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
.tp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { align-items: flex-start; }
.tp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { font-size: 1.15rem; font-weight: 600; }
.tp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { min-height: var(--tp-control-h); display: flex; align-items: center; }
.has-modal-open .tp-fab { display: none; }

/* ==========================================================================
   5. Dark (navy) surfaces – hero, CTA bands, footer
   ========================================================================== */
.has-navy-background-color a:where(:not(.wp-element-button):not(.tp-btn)) { color: var(--tp-on-dark); }
.has-navy-background-color .tp-btn:not(.tp-btn--primary) { background: transparent; border-color: rgba(255, 255, 255, .55); color: var(--tp-on-dark); }
.has-navy-background-color .tp-btn:not(.tp-btn--primary):hover { background: #fff; color: var(--tp-navy); }
.has-navy-background-color .tp-info__label { color: rgba(255, 255, 255, .75); }
.has-navy-background-color .tp-eyebrow { color: var(--tp-on-dark-eyebrow); }
.has-navy-background-color .tp-lede { color: rgba(255, 255, 255, .85); }
.has-navy-background-color .tp-facts li { color: var(--tp-on-dark-strong); }
.has-navy-background-color .tp-checks li::before { border-color: var(--tp-on-dark-accent); }

/* ==========================================================================
   6. Section helpers used by patterns
   ========================================================================== */
/* Eyebrow text uses the AA red (5.33:1); the logo red stays for non-text accents. */
.tp-eyebrow { margin: 0; font-size: .8125rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--tp-cta); }
.tp-eyebrow + :where(h1, h2) { margin-top: var(--tp-space-xs); }
.tp-lede { color: var(--tp-muted); font-size: 1.125rem; max-width: 62ch; }
/* In 1200px bands, keep the narrow lede aligned with the band's left edge instead of centred. */
.is-layout-constrained > .tp-lede, .is-layout-constrained > .tp-prose { margin-left: calc((100% - min(100%, 1200px)) / 2) !important; margin-right: auto !important; }
.tp-rule { width: 56px; height: 3px; border: 0; background: var(--tp-red); margin: 0; }

.tp-hero { position: relative; overflow: hidden; }
.tp-hero h1 { color: #fff; }
.tp-hero .wp-block-image img { border-radius: var(--tp-radius); box-shadow: 0 20px 40px rgba(0, 20, 50, .35); }
.tp-hero::after { content: ""; position: absolute; right: -10%; bottom: -40%; width: 60%; height: 120%; background: radial-gradient(closest-side, rgba(0, 108, 182, .35), transparent); pointer-events: none; }
.tp-hero > * { position: relative; z-index: 1; }
@media (max-width: 781px) {
	.tp-hero .wp-block-columns { gap: var(--tp-space-l); }
}

.tp-facts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.tp-facts li { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.tp-facts li::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--tp-red); flex: none; }

/* Surfaces: plain card, product-line card */
.tp-card-plain,
.tp-line-card { background: var(--tp-surface); border: 1px solid var(--tp-line); border-radius: var(--tp-radius); height: 100%; box-sizing: border-box; }
.tp-card-plain { padding: var(--tp-space-m); }
.tp-card-plain h3 { margin-top: 0; }
.tp-line-card { position: relative; overflow: hidden; display: flex; flex-direction: column; transition: border-color var(--tp-base) var(--tp-ease), box-shadow var(--tp-base) var(--tp-ease), transform var(--tp-base) var(--tp-ease); }
.tp-line-card:hover, .tp-line-card:focus-within { border-color: var(--tp-blue); box-shadow: var(--tp-shadow-raised); transform: translateY(-2px); }
.tp-line-card .wp-block-image { margin: 0; }
.tp-line-card .wp-block-image img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.tp-line-card__body { padding: var(--tp-space-m); display: flex; flex-direction: column; gap: .75rem; flex: 1; }
.tp-line-card__body > :last-child { margin-top: auto; }
.tp-checks { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.tp-checks li { position: relative; padding-left: 1.6rem; }
.tp-checks li::before { content: ""; position: absolute; left: 0; top: .45em; width: 10px; height: 6px; border-left: 2px solid var(--tp-blue); border-bottom: 2px solid var(--tp-blue); transform: rotate(-45deg); }

/* Production steps (real sequence → numbered). 5 columns ≥ 1024px, 3 on tablet, vertical on mobile. */
.tp-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; counter-reset: tp-step; position: relative; }
.tp-steps::before { content: ""; position: absolute; left: 22px; right: 22px; top: 22px; border-top: 2px dashed rgba(255, 255, 255, .35); }
.tp-steps li { counter-increment: tp-step; position: relative; display: grid; gap: .4rem; align-content: start; color: var(--tp-on-dark-soft); font-size: .9rem; }
.tp-steps li::before { content: counter(tp-step, decimal-leading-zero); width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--tp-navy); border: 2px solid var(--tp-on-dark-accent); color: #fff; font-weight: 600; font-size: .85rem; position: relative; }
.tp-steps strong { display: block; font-size: 1.05rem; color: #fff; }
@media (min-width: 782px) and (max-width: 1023px) {
	.tp-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: var(--tp-space-m); }
	.tp-steps::before { display: none; }
}
@media (max-width: 781px) {
	.tp-steps { grid-template-columns: 1fr; gap: 1.25rem; }
	.tp-steps::before { left: 22px; right: auto; top: 0; bottom: 0; border-top: 0; border-left: 2px dashed rgba(255, 255, 255, .35); }
	.tp-steps li { grid-template-columns: 46px 1fr; column-gap: 1rem; display: grid; }
	.tp-steps li::before { grid-row: 1 / 3; }
	.tp-steps li > * { grid-column: 2; }
}

/* Ordering steps (light surface) */
.tp-order { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; counter-reset: tp-order; }
.tp-order li { counter-increment: tp-order; background: var(--tp-surface); border: 1px solid var(--tp-line); border-radius: var(--tp-radius); padding: 1.25rem; display: block; color: var(--tp-muted); font-size: .92rem; }
.tp-order li::before { content: "Bước " counter(tp-order); display: block; margin-bottom: .4rem; color: var(--tp-cta); font-weight: 600; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.tp-order strong { display: block; margin-bottom: .3rem; color: var(--tp-navy); font-size: 1.05rem; }
@media (max-width: 960px) { .tp-order { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .tp-order { grid-template-columns: 1fr; } }

.tp-industries { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; }
.tp-industries li { background: var(--tp-tint); border-radius: var(--tp-radius); padding: 1rem 1.1rem; display: grid; gap: .2rem; }
.tp-industries strong { color: var(--tp-navy); }
.tp-industries span { color: var(--tp-muted); font-size: .875rem; }

/* ==========================================================================
   7. Catalogue + product page (refines the plugin's blocks in theme context)
   ========================================================================== */
.tp-card__link { transition: border-color var(--tp-base) var(--tp-ease), box-shadow var(--tp-base) var(--tp-ease), transform var(--tp-base) var(--tp-ease); }
.tp-card__link:hover, .tp-card__link:focus-visible { box-shadow: var(--tp-shadow-raised); transform: translateY(-2px); }
.tp-card__media img { transition: transform 400ms var(--tp-ease); }
.tp-card__link:hover .tp-card__media img { transform: scale(1.03); }
.tp-filter a { min-height: 40px; display: inline-flex; align-items: center; transition: border-color var(--tp-fast) var(--tp-ease), background-color var(--tp-fast) var(--tp-ease); }
.tp-filter a:not([aria-current="page"]):hover { border-color: var(--tp-navy); }
.tp-quote { border-radius: var(--tp-radius-lg); }

.tp-product-media .wp-block-post-featured-image img { border-radius: var(--tp-radius); aspect-ratio: 1 / 1; object-fit: cover; }
.tp-product-media .wp-block-post-featured-image:empty, .tp-noimg-box { aspect-ratio: 1 / 1; border-radius: var(--tp-radius); background: repeating-linear-gradient(45deg, var(--tp-tint) 0 10px, var(--tp-tint-2) 10px 11px); }
.tp-noimg-box { display: grid; place-items: center; color: var(--tp-muted); font-size: .95rem; font-weight: 500; }
.tp-related h2 { font-size: var(--wp--preset--font-size--x-large); }

/* Left-aligned reading column inside wide pages */
.tp-prose { max-width: 760px; }
.tp-prose .wp-block-gallery { margin-top: var(--tp-space-m); }

/* Breadcrumbs */
.tp-crumbs { font-size: .85rem; color: var(--tp-muted); }
.tp-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; }
.tp-crumbs li + li::before { content: "/"; margin-right: .35rem; color: var(--tp-muted); opacity: .6; }
.tp-crumbs a { color: var(--tp-muted); }

/* ==========================================================================
   8. Floating contact widget
   ========================================================================== */
.tp-fab { position: fixed; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: .6rem; transition: opacity var(--tp-base), transform var(--tp-base); }
.tp-fab[data-away="true"]:not(.is-open) { opacity: 0; transform: translateY(12px); pointer-events: none; }
/* It sits after the footer in tab order, so keyboard users reach it while it is stepped aside: show it on focus. */
.tp-fab[data-away="true"]:focus-within { opacity: 1; transform: none; pointer-events: auto; }
.tp-fab__toggle { display: inline-flex; align-items: center; gap: .5rem; min-height: 48px; padding: .6rem 1.1rem .6rem .9rem; border: 0; border-radius: var(--tp-radius-pill); background: var(--tp-cta); color: #fff; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 10px 24px rgba(0, 20, 50, .25); }
.tp-fab__toggle:hover { background: var(--tp-maroon); }
.tp-fab__toggle > span { display: inline-flex; align-items: center; gap: .45rem; }
.tp-fab__close { display: none !important; }
.tp-fab.is-open .tp-fab__open { display: none !important; }
.tp-fab.is-open .tp-fab__close { display: inline-flex !important; }
.tp-fab__panel { width: min(320px, calc(100vw - 32px)); background: var(--tp-surface); border: 1px solid var(--tp-line); border-radius: var(--tp-radius-lg); box-shadow: var(--tp-shadow-float); padding: .9rem; }
.tp-fab__title { margin: 0 0 .5rem; font-weight: 700; color: var(--tp-navy); }
.tp-fab__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.tp-fab__item { display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; border-radius: var(--tp-radius); text-decoration: none; color: var(--tp-ink); min-height: var(--tp-control-h); }
.tp-fab__item:hover { background: var(--tp-tint); }
.tp-fab__item .tp-icon { flex: none; width: 36px; height: 36px; padding: 8px; border-radius: 50%; box-sizing: border-box; }
.tp-fab__item--call .tp-icon { background: #fde8e8; color: var(--tp-cta); }
.tp-fab__item--zalo .tp-icon { background: #e3f0fa; color: var(--tp-blue); }
.tp-fab__item span { display: grid; line-height: 1.25; }
.tp-fab__item strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.tp-fab__item small { color: var(--tp-muted); font-size: .78rem; }
.tp-fab__quote { display: block; margin-top: .5rem; padding: .6rem; text-align: center; border-top: 1px solid var(--tp-line); font-weight: 600; color: var(--tp-navy); text-decoration: none; }
.tp-fab__quote:hover { text-decoration: underline; }
@media (max-width: 600px) {
	.tp-fab__toggle { padding: .6rem .9rem; }
	body { padding-bottom: 72px; }
}

/* ==========================================================================
   9. Footer
   ========================================================================== */
.tp-footer a { color: var(--tp-on-dark); }
.tp-footer .wp-block-site-logo img { background: #fff; border-radius: var(--tp-radius); padding: 8px; box-sizing: content-box; }
.tp-footer h2 { margin-bottom: var(--tp-space-s); letter-spacing: 0; }
.tp-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.tp-footer ul a { display: inline-block; padding-block: .2rem; text-decoration: none; color: rgba(255, 255, 255, .85); }
.tp-footer ul a:hover { color: #fff; text-decoration: underline; }
.tp-footer .tp-info { margin: 0 0 .35rem; color: var(--tp-on-dark-strong); }
.tp-legal { border-top: 1px solid var(--tp-on-dark-line); font-size: .82rem; color: rgba(255, 255, 255, .75); }
@media (min-width: 782px) and (max-width: 1023px) {
	/* Four footer columns are too narrow on tablets: company block full width, link columns below. */
	.tp-footer > .wp-block-columns { flex-wrap: wrap !important; row-gap: var(--tp-space-l); }
	.tp-footer > .wp-block-columns > .wp-block-column:first-child { flex-basis: 100% !important; }
	.tp-footer > .wp-block-columns > .wp-block-column:not(:first-child) { flex: 1 1 0 !important; min-width: 0; }
}

/* ==========================================================================
   10. Editor previews
   ========================================================================== */
.editor-styles-wrapper .tp-fab { position: static; align-items: flex-start; }
.editor-styles-wrapper .tp-fab__panel[hidden] { display: block; }

/* ==========================================================================
   11. 0.4.0 – "Đường may chuẩn mực" components (CC4-B)
   ========================================================================== */
/* Seam motif: a stitched line in the logo red, decoration only (the red never carries text). */
.tp-seam::before { content: ""; display: block; width: 56px; margin-bottom: var(--tp-space-xs); border-top: 2px dashed var(--tp-red); }
.has-navy-background-color .tp-seam::before { border-top-color: var(--tp-on-dark-eyebrow); }

/* Hero (B2B) */
.tp-hero--b2b .tp-hero__sub { margin-top: var(--tp-space-xs); color: var(--tp-on-dark-strong); font-weight: 600; }
.tp-hero--b2b .tp-hero__actions .wp-block-buttons { margin: 0; }

/* Business fact box (values come from Business Core contact-info blocks) */
.tp-factbox { background: var(--tp-tint); border: 1px solid var(--tp-line); border-left: 4px solid var(--tp-navy); border-radius: var(--tp-radius); padding: var(--tp-space-m); }
.tp-factbox h3 { margin-top: 0; }
.tp-factbox .tp-info { margin: 0 0 .5rem; }

/* Garment tags in the two group cards */
.tp-taglist { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.tp-taglist li { padding: .25rem .65rem; border: 1px solid var(--tp-line); border-radius: var(--tp-radius-pill); background: var(--tp-tint); color: var(--tp-ink); font-size: .85rem; }

/* "Đồng phục cho toàn doanh nghiệp" */
.tp-dept { position: relative; height: 100%; box-sizing: border-box; padding: var(--tp-space-m) var(--tp-space-m) var(--tp-space-s); background: var(--tp-surface); border: 1px solid var(--tp-line); border-top: 3px solid var(--tp-navy); border-radius: var(--tp-radius); display: flex; flex-direction: column; gap: .35rem; transition: border-color var(--tp-base) var(--tp-ease), box-shadow var(--tp-base) var(--tp-ease); }
.tp-dept:hover, .tp-dept:focus-within { box-shadow: var(--tp-shadow-raised); border-color: var(--tp-blue); border-top-color: var(--tp-navy); }
.tp-dept h3 { margin: 0; font-size: var(--wp--preset--font-size--large); }
.tp-dept p { margin: 0; color: var(--tp-muted); }
.tp-dept .tp-dept__link { margin-top: auto; padding-top: .5rem; }
.tp-dept__link a { display: inline-flex; align-items: center; min-height: var(--tp-control-h); font-weight: 600; color: var(--tp-navy); text-decoration: none; }
.tp-dept__link a::after { content: "→"; margin-left: .35rem; transition: transform var(--tp-fast) var(--tp-ease); }
.tp-dept__link a:hover { text-decoration: underline; text-underline-offset: .2em; }
.tp-dept__link a:hover::after { transform: translateX(3px); }
.tp-note { color: var(--tp-muted); font-size: .875rem; max-width: 760px; }

/* Promotion banner – layout only; every word lives in the block content. 1–4 highlights share the row. */
.tp-promo .tp-promo__head > * { margin-top: 0; }
.tp-promo .tp-promo__head h2 { margin-top: var(--tp-space-xs); }
.tp-offers { display: flex; flex-wrap: wrap; gap: var(--tp-space-m) var(--tp-space-l); margin-top: var(--tp-space-m); }
.tp-offers:not(:has(.tp-offer)) { display: none; }
.tp-offer { flex: 1 1 0; min-width: min(220px, 100%); padding-top: var(--tp-space-s); border-top: 2px dashed var(--tp-on-dark-eyebrow); }
.tp-offer:only-child { flex: 0 1 640px; }
.tp-offer h3 { margin: 0; font-size: var(--wp--preset--font-size--large); letter-spacing: .02em; text-transform: uppercase; }
.tp-offer p { margin: .35rem 0 0; color: var(--tp-on-dark-strong); }
.tp-promo__foot { margin-top: var(--tp-space-m); gap: var(--tp-space-s) var(--tp-space-m) !important; }
.tp-promo__foot .wp-block-buttons { margin: 0; }
.tp-promo__note { margin: 0; color: var(--tp-on-dark-soft); font-size: .875rem; }
@media (max-width: 599px) {
	.tp-offer { flex-basis: 100%; }
	.tp-promo__foot .wp-block-button, .tp-promo__foot .wp-block-button__link { width: 100%; }
}

/* Catalogue: search + product-line navigation */
.tp-cat-tools { display: grid; gap: var(--tp-space-s); }
.tp-cat-search { max-width: 520px; }
.tp-cat-search .wp-block-search__inside-wrapper { border: 1px solid var(--tp-line); border-radius: var(--tp-control-radius); background: var(--tp-surface); padding: 3px; }
.tp-cat-search .wp-block-search__input { border: 0; min-height: 40px; padding: 0 .75rem; font: inherit; background: transparent; }
.tp-cat-search .wp-block-search__button { min-height: 40px; margin-left: 4px; border-radius: calc(var(--tp-control-radius) - 2px); }
.tp-linenav { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.tp-linenav p { margin: 0; }
.tp-linenav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.tp-linenav li, .tp-linenav .children { display: contents; }
.tp-linenav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 .9rem; border: 1px solid var(--tp-line); border-radius: var(--tp-radius-pill); background: var(--tp-surface); color: var(--tp-ink); font-size: .9rem; text-decoration: none; transition: border-color var(--tp-fast) var(--tp-ease); }
.tp-linenav .children a::before { content: "↳"; margin-right: .35rem; color: var(--tp-muted); }
.tp-linenav a:hover { border-color: var(--tp-navy); }
.tp-linenav .current-cat > a, .tp-linenav a[aria-current="page"] { background: var(--tp-navy); border-color: var(--tp-navy); color: #fff; }
.tp-linenav .current-cat > a::before { color: inherit; }
@media (max-width: 599px) {
	/* One scrollable row of chips instead of a tall block of wrapped pills. */
	.tp-linenav, .tp-linenav ul { flex-wrap: nowrap; }
	.tp-linenav { overflow-x: auto; scrollbar-width: thin; padding-bottom: .35rem; -webkit-overflow-scrolling: touch; }
	.tp-linenav a { white-space: nowrap; }
}

/* Catalogue: product cards (core Query Loop) */
/* Grid gap comes from the block (layout uses it to size 4 columns) – do not override it on desktop. */
.tp-pcard { height: 100%; display: flex; flex-direction: column; background: var(--tp-surface); border: 1px solid var(--tp-line); border-radius: var(--tp-radius); overflow: hidden; transition: border-color var(--tp-base) var(--tp-ease), box-shadow var(--tp-base) var(--tp-ease), transform var(--tp-base) var(--tp-ease); }
.tp-pcard:hover, .tp-pcard:focus-within { border-color: var(--tp-blue); box-shadow: var(--tp-shadow-raised); transform: translateY(-2px); }
.tp-pcard .tp-pcard__media { margin: 0; background: var(--tp-tint); }
.tp-pcard .tp-pcard__media img { transition: transform 400ms var(--tp-ease); }
.tp-pcard:hover .tp-pcard__media img { transform: scale(1.03); }
.tp-pcard .tp-noimg-box { border-radius: 0; }
.tp-pcard__body { flex: 1; display: flex; flex-direction: column; gap: .35rem; padding: var(--tp-space-s); }
.tp-pcard__body > * { margin: 0 !important; }
.tp-pcard__lines { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--tp-blue); }
.tp-pcard__lines a { color: inherit; text-decoration: none; }
.tp-pcard__lines a:hover { text-decoration: underline; }
.tp-pcard__title { font-size: 1rem; line-height: 1.35; }
.tp-pcard__title a { color: var(--tp-navy); text-decoration: none; }
.tp-pcard__title a:hover { text-decoration: underline; text-underline-offset: .2em; }
.tp-pcard__code { font-size: .8125rem; color: var(--tp-muted); font-variant-numeric: tabular-nums; }
.tp-pcard__code::before { content: "Mã mẫu: "; }
.tp-pcard__code:empty { display: none; }
.tp-pcard__actions { margin-top: auto !important; padding-top: .5rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.tp-pcard__more { display: inline-flex; align-items: center; min-height: var(--tp-control-h); padding: 0 .9rem; border: 1.5px solid var(--tp-navy); border-radius: var(--tp-control-radius); color: var(--tp-navy); font-weight: 600; font-size: .9rem; text-decoration: none; box-sizing: border-box; }
.tp-pcard__more:hover { background: var(--tp-navy); color: #fff; }
.tp-pcard .tp-quote-button .tp-btn { font-size: .9rem; padding: .55rem .9rem; }
@media (max-width: 599px) {
	.tp-pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: .75rem !important; }
	.tp-pcard__body { padding: .7rem; }
	.tp-pcard__lines { font-size: .6875rem; }
	.tp-pcard__actions { flex-direction: column; align-items: stretch; }
	.tp-pcard__more, .tp-pcard .tp-quote-button, .tp-pcard .tp-quote-button .tp-btn { width: 100%; justify-content: center; }
	.tp-pcard .tp-quote-button .tp-btn { white-space: normal; text-align: center; box-sizing: border-box; }
}
@media (max-width: 359px) { .tp-pgrid { grid-template-columns: 1fr !important; } }
.tp-pager { margin-top: var(--tp-space-l); gap: .4rem; }
.tp-pager a, .tp-pager .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: var(--tp-control-h); min-height: var(--tp-control-h); padding: 0 .75rem; border: 1px solid var(--tp-line); border-radius: var(--tp-control-radius); color: var(--tp-navy); text-decoration: none; box-sizing: border-box; }
.tp-pager .page-numbers.current { background: var(--tp-navy); border-color: var(--tp-navy); color: #fff; }
.tp-pager a:hover { border-color: var(--tp-navy); }

/* Product detail */
.tp-ref-note { margin-top: var(--tp-space-s); padding: .7rem .9rem; border: 1px solid #f1d9a6; border-radius: var(--tp-control-radius); background: #fff8ea; color: #5c4300; font-size: .875rem; }

/* Header submenu (Mẫu đồng phục ▾) */
.tp-header .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container { min-width: 260px; padding: .4rem 0; border: 1px solid var(--tp-line) !important; border-radius: var(--tp-radius); box-shadow: var(--tp-shadow-raised); }
.tp-header .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: .6rem 1rem; }
/* Flex/grid containers built from "default" (flow) groups: core adds margin-block-start to every child after the
   first, which staggers items in a row. Reset it inside the 0.4.0 components. */
.tp-offers > *, .tp-pcard__actions > *, .tp-linenav > *, .tp-cat-tools > *, .tp-promo__foot > * { margin-block: 0 !important; }
.tp-cat-head .tp-crumbs + .tp-eyebrow { margin-top: var(--tp-space-s); }
/* Mobile/tablet overlay: submenu is a plain indented list, everything left-aligned (the navigation block's
   "justify right" setting would otherwise right-align the parent item and centre the children). */
.tp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { align-items: flex-start !important; text-align: left; }
.tp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container { padding: 0 0 0 1rem !important; border: 0 !important; box-shadow: none !important; background: transparent !important; gap: 0 !important; }
.tp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item { font-size: 1rem; font-weight: 500; }
.tp-header .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container .wp-block-navigation-item__content { white-space: nowrap; }
@media (max-width: 599px) {
	/* Five department tiles: two compact columns instead of one long stack on phones. */
	.tp-dept-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: .75rem !important; }
	.tp-dept { padding: .9rem .9rem .5rem; }
	.tp-dept h3 { font-size: 1rem; }
	.tp-dept p { font-size: .875rem; }
	.tp-dept__link a { font-size: .875rem; }
}

/* ==========================================================================
   12. 0.5.0 – Premium B2B motion & lead generation (CC4-D)
   ========================================================================== */
:root {
	--tp-gold: #e9c77b;      /* gold on navy 5.96:1, on #003864 7.38:1 (text kept off the light gradient corner) */
	--tp-gold-deep: #9a7428; /* decorative rules on cream */
	--tp-cream: #f8f1e1;
	--tp-reveal: 320ms;
}

/* Hero entrance (~400ms). Keyframes only: if animations are off, content is simply visible. */
@keyframes tp-fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes tp-scale-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.tp-hero--b2b .wp-block-columns > .wp-block-column { animation: tp-fade-up 400ms var(--tp-ease) both; }
.tp-hero--b2b .wp-block-columns > .wp-block-column + .wp-block-column { animation-delay: 120ms; }

/* Scroll reveal (engage.js adds .tp-reveal only when JS runs and motion is allowed). */
.tp-js .tp-reveal { transition: opacity var(--tp-reveal) var(--tp-ease), transform var(--tp-reveal) var(--tp-ease); }
.tp-js .tp-reveal:not(.is-revealed) { opacity: 0; transform: translateY(14px); }
@media (prefers-reduced-motion: reduce) { .tp-js .tp-reveal:not(.is-revealed) { opacity: 1; transform: none; } }

/* Product cards: 1.03 image scale + elevation, ~200–250ms. */
.tp-card__media img, .tp-pcard .tp-pcard__media img { transition-duration: 250ms; }

/* Benefits banner directly below the hero: light band, numbered cards (counter, no extra markup). */
.tp-benefits { background: linear-gradient(180deg, var(--tp-tint) 0%, var(--tp-surface) 100%); border-bottom: 1px solid var(--tp-line); }
.tp-benefits .tp-promo__head h2 { color: var(--tp-navy); }
.tp-benefits .tp-offers { counter-reset: tp-benefit; gap: var(--tp-space-s); }
.tp-benefits .tp-offer { counter-increment: tp-benefit; position: relative; border-top: 0; padding: var(--tp-space-m) var(--tp-space-m) var(--tp-space-m) calc(var(--tp-space-m) + 52px); background: var(--tp-surface); border: 1px solid var(--tp-line); border-radius: var(--tp-radius); box-shadow: var(--tp-shadow); }
.tp-benefits .tp-offer::before { content: counter(tp-benefit, decimal-leading-zero); position: absolute; left: var(--tp-space-m); top: var(--tp-space-m); width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--tp-navy); color: #fff; font-weight: 700; font-size: .875rem; box-shadow: 0 0 0 3px var(--tp-surface), 0 0 0 4px var(--tp-gold); }
.tp-benefits .tp-offer h3 { color: var(--tp-navy); text-transform: none; letter-spacing: 0; font-size: var(--wp--preset--font-size--large); }
.tp-benefits .tp-offer p { color: var(--tp-muted); }
.tp-benefits .tp-offer:only-child { flex-basis: 640px; }

/* Contact hub: gentle expand/collapse + Facebook channel. */
@keyframes tp-hub-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.tp-fab.is-open .tp-fab__panel { animation: tp-hub-in 200ms var(--tp-ease) both; transform-origin: bottom right; }
.tp-fab__item--facebook .tp-icon { background: #e7eefb; color: #1b4fa8; }

/* ---------- Promotion pop-up ---------- */
.tp-pop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) 16px; }
.tp-pop[hidden] { display: none; }
.tp-pop__backdrop { position: absolute; inset: 0; background: rgba(0, 22, 44, .62); opacity: 0; transition: opacity 220ms var(--tp-ease); }
.tp-pop__dialog { position: relative; width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--tp-cream); border-radius: 18px; padding: 22px; box-shadow: 0 30px 60px rgba(0, 20, 50, .35); opacity: 0; transform: scale(.96); transition: opacity 220ms var(--tp-ease), transform 220ms var(--tp-ease); }
.tp-pop.is-open .tp-pop__backdrop { opacity: 1; }
.tp-pop.is-open .tp-pop__dialog { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .tp-pop__dialog { transform: none; } }
html.tp-pop-open { overflow: hidden; }
html.tp-pop-open .tp-fab { visibility: hidden; }
.tp-pop__close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #fff; color: var(--tp-navy); cursor: pointer; box-shadow: 0 2px 8px rgba(0, 20, 50, .18); }
.tp-pop__close:hover { background: var(--tp-tint); }

/* Coupon base: navy ticket, gold value, cream perforation, stitched inner line (no imagery). */
.tp-coupon { position: relative; display: grid; grid-template-columns: 1fr 112px; min-height: 210px; background: radial-gradient(90% 120% at 100% 0%, #0a5a98 0%, var(--tp-navy) 45%, #003864 100%); color: #fff; border-radius: 14px; outline: 1px dashed rgba(248, 241, 225, .5); outline-offset: -10px; }
.tp-coupon__main { padding: 30px 24px 26px 30px; display: grid; align-content: center; gap: .35rem; }
.tp-coupon__eyebrow { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .18em; color: var(--tp-gold); }
.tp-coupon__title { margin: 0; color: #fff; line-height: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: .1em .3em; }
.tp-coupon__lead { font-size: clamp(1.25rem, 4.5vw, 1.6rem); font-weight: 700; letter-spacing: .02em; }
.tp-coupon__value { font-size: clamp(3.25rem, 13vw, 4.5rem); font-weight: 800; color: var(--tp-gold); letter-spacing: -.03em; text-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.tp-coupon__headline { margin: .4rem 0 0; font-size: 1.0625rem; font-weight: 600; color: var(--tp-cream); }
.tp-coupon__stub { position: relative; display: grid; place-items: center; border-left: 2px dashed rgba(248, 241, 225, .55); }
.tp-coupon__stub span { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 800; font-size: 1.5rem; letter-spacing: .12em; color: var(--tp-gold); }
/* Ticket notches on the perforation line, in the dialog colour. */
.tp-coupon__stub::before, .tp-coupon__stub::after { content: ""; position: absolute; left: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--tp-cream); }
.tp-coupon__stub::before { top: -12px; }
.tp-coupon__stub::after { bottom: -12px; }

.tp-pop__actions { display: grid; gap: .75rem; margin-top: 18px; justify-items: start; }
.tp-pop__cta { min-height: 48px; padding: .8rem 1.4rem; font-size: 1rem; letter-spacing: .04em; }
.tp-pop__terms { font-size: .875rem; color: var(--tp-ink); }
.tp-pop__terms summary { cursor: pointer; color: var(--tp-navy); font-weight: 600; text-decoration: underline; text-underline-offset: .2em; min-height: 32px; display: inline-flex; align-items: center; }
.tp-pop__terms p { margin: .4rem 0 0; color: #3b4a5e; }

/* Variant B – gift card: vertical, ribbon band across the corner. */
.tp-pop--gift .tp-coupon { grid-template-columns: 1fr; text-align: center; overflow: hidden; outline-offset: -12px; }
.tp-pop--gift .tp-coupon__main { padding: 40px 28px 16px; justify-items: center; }
.tp-pop--gift .tp-coupon__title { justify-content: center; }
.tp-pop--gift .tp-coupon__stub { border-left: 0; border-top: 2px dashed rgba(248, 241, 225, .55); padding: 10px; }
.tp-pop--gift .tp-coupon__stub span { writing-mode: horizontal-tb; transform: none; font-size: 1rem; }
.tp-pop--gift .tp-coupon__stub::before, .tp-pop--gift .tp-coupon__stub::after { top: -13px; bottom: auto; left: auto; }
.tp-pop--gift .tp-coupon__stub::before { left: -12px; }
.tp-pop--gift .tp-coupon__stub::after { right: -12px; }
.tp-pop--gift .tp-coupon::before { content: ""; position: absolute; top: 18px; right: -46px; width: 170px; height: 26px; background: linear-gradient(90deg, #c9a14f, var(--tp-gold), #c9a14f); transform: rotate(45deg); box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.tp-pop--gift .tp-pop__actions { justify-items: center; text-align: center; }

/* Variant C – stamp: scalloped edge via a radial mask, value in a gold seal. */
.tp-pop--stamp .tp-coupon { grid-template-columns: 1fr 120px; border-radius: 2px; padding: 10px; outline-offset: -20px;
	/* Perforated stamp edge: dotted holes only in the 10px padding ring; the content box stays fully opaque. */
	-webkit-mask: radial-gradient(circle 5px at 50% 50%, transparent 96%, #000 100%) 0 0 / 16px 16px round, linear-gradient(#000, #000) content-box;
	-webkit-mask-composite: source-over;
	mask: radial-gradient(circle 5px at 50% 50%, transparent 96%, #000 100%) 0 0 / 16px 16px round, linear-gradient(#000, #000) content-box;
	mask-composite: add; }
.tp-pop--stamp .tp-coupon__stub { border-left: 0; }
.tp-pop--stamp .tp-coupon__stub::before, .tp-pop--stamp .tp-coupon__stub::after { display: none; }
.tp-pop--stamp .tp-coupon__stub span { writing-mode: horizontal-tb; transform: none; width: 84px; height: 84px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--tp-gold); box-shadow: inset 0 0 0 4px var(--tp-navy), inset 0 0 0 5px rgba(233, 199, 123, .6); font-size: 1.35rem; }

/* Form step (local preview). */
.tp-pop.is-form .tp-pop__dialog { background: #fff; }
.tp-pop__form-title { margin: 0 44px 6px 0; color: var(--tp-navy); font-size: var(--wp--preset--font-size--x-large); }
.tp-pop__form-title:focus { outline: none; }
.tp-pop__preview-note { margin: 0 0 12px; padding: .6rem .8rem; border-radius: var(--tp-control-radius); background: #fff8ea; border: 1px solid #f1d9a6; color: #5c4300; font-size: .875rem; }
.tp-pop__form { display: grid; gap: .85rem; }
.tp-pop__form .tp-field input { width: 100%; box-sizing: border-box; font: inherit; min-height: 46px; padding: .6rem .8rem; border: 1px solid var(--tp-line); border-radius: var(--tp-control-radius); background: var(--tp-tint); }
.tp-pop__form .tp-field input[aria-invalid="true"] { border-color: var(--tp-cta); background: #fff5f5; }
.tp-pop__form-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.tp-pop__status { margin: 0; padding: .7rem .9rem; border-radius: var(--tp-control-radius); background: var(--tp-tint); color: var(--tp-ink); font-size: .9rem; }

@media (max-width: 599px) {
	.tp-pop__dialog { padding: 16px; border-radius: 16px; }
	.tp-coupon, .tp-pop--stamp .tp-coupon { grid-template-columns: 1fr; }
	.tp-coupon__main { padding: 30px 20px 14px; }
	.tp-coupon__stub { border-left: 0; border-top: 2px dashed rgba(248, 241, 225, .55); padding: 10px; }
	.tp-coupon__stub span { writing-mode: horizontal-tb; transform: none; font-size: 1.1rem; }
	.tp-coupon__stub::before, .tp-coupon__stub::after { top: -13px; bottom: auto; }
	.tp-coupon__stub::before { left: -12px; }
	.tp-coupon__stub::after { left: auto; right: -12px; }
	.tp-pop--stamp .tp-coupon__stub span { width: auto; height: auto; padding: .3rem 1rem; border-radius: 999px; }
	.tp-pop__cta { width: 100%; }
	.tp-pop__actions { justify-items: stretch; }
}

/* ==========================================================================
   13. 0.5.1 – Gift-box pop-up with bow (CC4-E1)
   Navy box, cream inner card with a light-gold border, red SVG bow over the top edge.
   Motion: box fade + light scale 450ms; bow springs once (140ms delay + 460ms, done by 600ms) (transform only, never opacity,
   so a paused animation can never leave anything invisible). Reduced motion: no transforms.
   ========================================================================== */
/* Keep the dialog inside the side gutter on phones (it was content-box: 100% + its own padding). */
.tp-pop { grid-template-columns: minmax(0, 1fr); }
.tp-pop__dialog { box-sizing: border-box; }
.tp-pop--giftbox { overflow-y: auto; place-items: initial; padding-top: 72px; }
.tp-pop--giftbox:not(.tp-pop--bow-classic):not(.tp-pop--bow-lid):not(.tp-pop--bow-rosette) { padding-top: 16px; }
.tp-pop--giftbox .tp-pop__dialog { margin: auto; width: min(500px, 100%); max-height: none; overflow: visible; padding: 16px; border-radius: 22px;
	background: radial-gradient(120% 90% at 50% 0%, #0a5a98 0%, var(--tp-navy) 55%, #003864 100%);
	transform: translateY(10px) scale(.94); transition: opacity 450ms var(--tp-ease), transform 450ms cubic-bezier(.2, .9, .3, 1.1); }
.tp-pop--giftbox.is-open .tp-pop__dialog { transform: none; }
.tp-pop--giftbox:not(.is-open) .tp-pop__dialog { transition-duration: 200ms; }
/* Ribbon wrapping the box: visible only on the navy frame (top and bottom), never over text. */
.tp-pop--giftbox .tp-pop__dialog::before, .tp-pop--giftbox .tp-pop__dialog::after { content: ""; position: absolute; left: 50%; width: 30px; margin-left: -15px; height: 16px; background: linear-gradient(90deg, #961a20, #cf2429 30%, #e8434a 50%, #cf2429 70%, #961a20); box-shadow: inset 2px 0 0 rgba(233, 199, 123, .55), inset -2px 0 0 rgba(233, 199, 123, .55); }
.tp-pop--giftbox .tp-pop__dialog::before { top: 0; }
.tp-pop--giftbox .tp-pop__dialog::after { bottom: 0; }
.tp-pop--giftbox:not([class*="tp-pop--bow-"]) .tp-pop__dialog::before, .tp-pop--giftbox:not([class*="tp-pop--bow-"]) .tp-pop__dialog::after { display: none; }
.tp-pop--giftbox .tp-pop__close { top: -14px; right: -14px; border: 2px solid var(--tp-gold); }

/* Inner card: cream, light-gold border with a fine inner gold line. */
.tp-gift { position: relative; z-index: 1; padding: 52px 30px 22px; text-align: center; background: var(--tp-cream); border: 1.5px solid #e2c98f; border-radius: 14px; box-shadow: inset 0 0 0 5px var(--tp-cream), inset 0 0 0 6px rgba(185, 141, 59, .45); }
.tp-pop--giftbox:not([class*="tp-pop--bow-"]) .tp-gift { padding-top: 30px; }
.tp-gift__eyebrow { margin: 0 0 .5rem; font-size: .75rem; font-weight: 700; letter-spacing: .14em; line-height: 1.5; color: var(--tp-navy); }
.tp-gift__title { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 .3em; line-height: 1; color: var(--tp-navy); }
.tp-gift__lead { font-size: clamp(1.3rem, 4.6vw, 1.7rem); font-weight: 800; letter-spacing: .03em; }
.tp-gift__value { font-size: clamp(3.6rem, 15vw, 5rem); font-weight: 800; letter-spacing: -.03em; color: var(--tp-cta); text-shadow: 0 2px 0 rgba(150, 26, 32, .12); }
.tp-gift__headline { margin: .55rem 0 0; font-size: 1.0625rem; font-weight: 600; color: var(--tp-ink); }
/* Ticket perforation with notches cut in the navy frame colour (keeps the accepted Ticket spirit). */
.tp-gift__perf { position: relative; margin: 20px -30px 16px; border-top: 2px dashed rgba(154, 116, 40, .55); }
.tp-gift__perf::before, .tp-gift__perf::after { content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--tp-navy); }
.tp-gift__perf::before { left: -12px; }
.tp-gift__perf::after { right: -12px; }
.tp-gift .tp-pop__actions { margin-top: 0; justify-items: center; }
.tp-gift .tp-pop__cta { justify-content: center; text-align: center; min-height: 52px; padding: .85rem 1.8rem; font-size: 1.0625rem; box-shadow: 0 6px 16px rgba(207, 36, 41, .3); }
.tp-gift .tp-pop__terms { text-align: center; }
.tp-gift .tp-pop__terms p { text-align: left; }

/* Bow: centred on the top edge, overlapping the frame. */
.tp-gift__bow { position: absolute; z-index: 3; top: -66px; left: 0; right: 0; margin: 0 auto; width: 200px; pointer-events: none; transform-origin: 50% 62%; filter: drop-shadow(0 4px 6px rgba(0, 20, 50, .3)); }
.tp-gift__bow .tp-bow { display: block; width: 100%; height: auto; }
@keyframes tp-bow-pop { 0% { transform: scale(.6) rotate(-6deg); } 55% { transform: scale(1.08) rotate(2deg); } 80% { transform: scale(.98); } 100% { transform: none; } }
.tp-pop.is-open .tp-gift__bow { animation: tp-bow-pop 460ms cubic-bezier(.3, 1.4, .5, 1) 140ms 1 backwards; }

/* B – box with a lid: darker lid band across the top with the ribbon running through it. */
.tp-pop--bow-lid .tp-pop__dialog { padding-top: 50px; }
.tp-pop--bow-lid .tp-pop__dialog::before { top: 0; left: -8px; right: -8px; width: auto; margin: 0; height: 38px; border-radius: 12px 12px 6px 6px;
	background: linear-gradient(90deg, transparent calc(50% - 15px), #cf2429 calc(50% - 15px), #e8434a 50%, #cf2429 calc(50% + 15px), transparent calc(50% + 15px)), linear-gradient(#0d5c99, #003864);
	box-shadow: 0 6px 10px rgba(0, 20, 50, .35), inset 0 -2px 0 rgba(233, 199, 123, .7); }
.tp-pop--bow-lid .tp-gift__bow { top: -46px; width: 150px; }
.tp-pop--bow-lid .tp-gift { padding-top: 40px; }
.tp-pop--bow-lid .tp-pop__close { top: -18px; right: -18px; }

/* C – rosette: slightly smaller footprint, gold ribbon edges. */
.tp-pop--bow-rosette .tp-gift__bow { top: -54px; width: 160px; }

/* Form step: plain white card, decoration hidden so nothing competes with the fields. */
.tp-pop--giftbox.is-form .tp-pop__dialog { background: #fff; padding: 22px; }
.tp-pop--giftbox.is-form .tp-pop__dialog::before, .tp-pop--giftbox.is-form .tp-pop__dialog::after, .tp-pop--giftbox.is-form .tp-gift__bow { display: none; }
.tp-pop--giftbox.is-form .tp-pop__close { top: 10px; right: 10px; border: 0; }

@media (prefers-reduced-motion: reduce) {
	.tp-pop--giftbox .tp-pop__dialog, .tp-pop--giftbox.is-open .tp-pop__dialog { transform: none; transition: opacity 200ms linear; }
	.tp-pop.is-open .tp-gift__bow { animation: none; }
}

@media (max-width: 599px) {
	.tp-pop--giftbox { padding: 58px 12px 16px; }
	.tp-pop--giftbox .tp-pop__dialog { padding: 12px; border-radius: 18px; }
	.tp-pop--giftbox .tp-pop__dialog::before, .tp-pop--giftbox .tp-pop__dialog::after { height: 12px; width: 24px; margin-left: -12px; }
	.tp-pop--giftbox .tp-pop__close { top: -12px; right: -6px; }
	.tp-gift { padding: 44px 18px 18px; }
	.tp-gift__perf { margin: 16px -18px 14px; }
	.tp-gift__bow { top: -52px; width: 156px; }
	.tp-gift .tp-pop__actions { justify-items: stretch; }
	.tp-pop--bow-lid .tp-pop__dialog { padding-top: 42px; }
	.tp-pop--bow-lid .tp-pop__dialog::before { left: -6px; right: -6px; height: 32px; width: auto; margin: 0; }
	.tp-pop--bow-lid .tp-gift__bow { top: -40px; width: 122px; }
	.tp-pop--bow-lid .tp-gift { padding-top: 34px; }
	.tp-pop--bow-lid .tp-pop__close { top: -14px; right: -10px; }
	.tp-pop--bow-rosette .tp-gift__bow { top: -44px; width: 128px; }
}

/* CC4-F2A: preserve full garment geometry in catalogue and detail media. */
.tp-pcard__media img, .tp-card__media img, .tp-product-media .wp-block-post-featured-image img { object-fit: contain !important; }
.tp-pcard:hover .tp-pcard__media img, .tp-card__link:hover .tp-card__media img { transform: none; }

/* CC4-UI1: equal category cards; preserve Image Manager's inner crop geometry. */
.tp-featured .tp-f3c-category-collections {
 display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:24px;align-items:stretch;
}
.tp-featured .tp-f3c-category-collections>.tp-f3c-collection-card {
 min-width:0;margin:0!important;box-sizing:border-box;display:flex;flex-direction:column;
 gap:16px;padding:16px;background:var(--tp-surface);border:1px solid var(--tp-line);border-radius:var(--tp-radius);
}
.tp-f3c-collection-media {
 display:flex;align-items:center;justify-content:center;aspect-ratio:4/3;overflow:hidden;
 width:100%;background:var(--tp-surface);border-radius:calc(var(--tp-radius) / 2);
}
.tp-f3c-collection-media>.tpim-frame {
 margin:0!important;flex:none;
 width:min(100%,calc(100% * var(--d-ratio) / (4 / 3)));
 background:var(--tp-surface);border-radius:0;
}
.tp-featured .tp-f3c-collection-card>h3 {
 margin:0!important;font-size:1rem;line-height:1.5;min-height:3em;overflow-wrap:anywhere;
}
.tp-f3c-collection-card>h3 a {display:block;color:var(--tp-navy);text-underline-offset:.2em;}
.tp-f3c-collection-card:focus-within {border-color:var(--tp-blue);}
/* Native Image blocks can be added by the owner without changing department identity. */
.tp-dept-grid>.tp-dept {margin-block:0!important;min-width:0;}
.tp-dept>.wp-block-image,.tp-dept>.tp-dept__media {
 margin:0 0 12px!important;aspect-ratio:4/3;width:100%;overflow:hidden;
}
.tp-dept>.wp-block-image img,.tp-dept__media>img {
 width:100%;height:100%;display:block;object-fit:contain;
}
@media(max-width:1023px){
 .tp-featured .tp-f3c-category-collections{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;}
}
@media(max-width:781px){
 .tp-f3c-collection-media>.tpim-frame{width:min(100%,calc(100% * var(--m-ratio) / (4 / 3)));}
}
@media(max-width:599px){
 .tp-featured .tp-f3c-category-collections{gap:12px;}
 .tp-featured .tp-f3c-category-collections>.tp-f3c-collection-card{padding:12px;gap:12px;}
 .tp-featured .tp-f3c-collection-card>h3{font-size:.9375rem;min-height:4.5em;}
}
