/**
 * Porto — TrustedTech · child styles
 * ---------------------------------------------------------------------------
 * SAFE LAYER.
 *
 * Everything here either styles markup this child theme outputs itself
 * (.ttp-*), or targets classes WooCommerce core emits (ul.products, .price,
 * .onsale) which every WooCommerce theme carries. None of it depends on
 * Porto's internal markup, so a Porto update cannot break it.
 *
 * Porto-specific selectors live in porto-overrides.css — the one file that
 * makes assumptions.
 *
 * Colour tokens are injected inline from PHP (inc/config.php). When no primary
 * colour is set in the Customiser, --ttp-primary resolves to Porto's own
 * --porto-primary-color, so this layer follows Porto's palette by default
 * instead of fighting it.
 * ---------------------------------------------------------------------------
 */

/* ==========================================================================
   1. Shared primitives
   ========================================================================== */

.ttp-icon {
	display: inline-block;
	vertical-align: middle;
	fill: none;
	flex-shrink: 0;
}

/* ==========================================================================
   2. VAT note
   ========================================================================== */

.ttp-vat-note {
	display: block;
	margin-top: 2px;
	font-size: 11px;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0;
	color: var(--ttp-muted, #64748b);
	text-transform: none;
}

/* Inside the single-product price block it reads better inline-ish. */
.single-product .summary .ttp-vat-note {
	font-size: 12px;
	margin-top: 4px;
}

/* ==========================================================================
   3. Stock indicator
   ========================================================================== */

.ttp-stock {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-top: 4px;
	font-size: 11px;
	font-weight: 650;
	line-height: 1.4;
}

.ttp-stock::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
	flex-shrink: 0;
}

.ttp-stock--in { color: var(--ttp-success, #059669); }
.ttp-stock--low { color: var(--ttp-deal, #f59e0b); }
.ttp-stock--out { color: var(--ttp-muted, #94a3b8); }

/* ==========================================================================
   4. Discount badge
   ========================================================================== */

/*
 * Scoped with .ttp so it only applies once this child theme is active, and
 * written to sit on top of whatever positioning Porto already gives .onsale
 * rather than re-positioning it — that's Porto's job and it varies by card
 * layout.
 */
.ttp .onsale.ttp-onsale {
	background: var(--ttp-deal, #f59e0b);
	color: #1a1206;
	font-weight: 800;
	letter-spacing: 0.02em;
	font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   5. Free-delivery progress
   ========================================================================== */

.ttp-free-ship {
	padding: 14px 16px;
	margin-bottom: 20px;
	background: rgb(var(--ttp-primary-rgb, 29 78 216) / 0.08);
	border-radius: 10px;
	font-size: 14px;
	line-height: 1.5;
}

.ttp-free-ship__text {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	color: var(--ttp-ink, #0b1220);
}

.ttp-free-ship__text .ttp-icon {
	color: var(--ttp-primary, #1d4ed8);
	margin-top: 2px;
}

.ttp-free-ship__text strong { color: var(--ttp-ink, #0b1220); font-weight: 700; }

.ttp-free-ship__bar {
	height: 6px;
	margin-top: 10px;
	background: rgb(var(--ttp-primary-rgb, 29 78 216) / 0.18);
	border-radius: 999px;
	overflow: hidden;
}

.ttp-free-ship__fill {
	height: 100%;
	background: var(--ttp-primary, #1d4ed8);
	border-radius: 999px;
	transition: width 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.ttp-free-ship--met { background: var(--ttp-success-soft, #e6f6f1); }
.ttp-free-ship--met .ttp-free-ship__text,
.ttp-free-ship--met .ttp-free-ship__text strong { color: #065f46; }
.ttp-free-ship--met .ttp-free-ship__text .ttp-icon { color: var(--ttp-success, #059669); }
.ttp-free-ship--met .ttp-free-ship__bar { background: rgb(5 150 105 / 0.2); }
.ttp-free-ship--met .ttp-free-ship__fill { background: var(--ttp-success, #059669); }

@media (prefers-reduced-motion: reduce) {
	.ttp-free-ship__fill { transition: none; }
}

/* ==========================================================================
   6. Product trust badges
   ========================================================================== */

.ttp-product-trust {
	display: grid;
	gap: 10px;
	margin: 22px 0 0;
	padding: 18px;
	list-style: none;
	background: var(--ttp-canvas, #f6f8fb);
	border: 1px dashed var(--ttp-border, #e2e8f0);
	border-radius: 10px;
}

.ttp-product-trust li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--ttp-muted, #64748b);
	list-style: none;
}

.ttp-product-trust li::before { content: none; } /* Porto adds list bullets */
.ttp-product-trust .ttp-icon { color: var(--ttp-success, #059669); margin-top: 1px; }
.ttp-product-trust strong { color: var(--ttp-ink, #0b1220); font-weight: 650; }

/* ==========================================================================
   7. Checkout reassurance
   ========================================================================== */

.ttp-checkout-secure {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 12px 14px;
	margin-bottom: 16px;
	background: var(--ttp-canvas, #f6f8fb);
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--ttp-muted, #64748b);
}

.ttp-checkout-secure .ttp-icon { color: var(--ttp-success, #059669); margin-top: 2px; }

/* ==========================================================================
   8. Payment badges
   ========================================================================== */

/*
 * The bar is appended at the end of <body> and pulled into the footer visually.
 * Hooking wp_footer rather than a Porto footer hook keeps it working across
 * every footer layout and the footer builder.
 */
.ttp-payments-bar {
	padding: 18px 20px 24px;
	background: transparent;
	text-align: center;
}

.ttp-payments {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.ttp-payments__item {
	display: inline-grid;
	place-items: center;
	height: 30px;
	min-width: 52px;
	padding-inline: 10px;
	background: #fff;
	border: 1px solid rgb(0 0 0 / 0.08);
	border-radius: 5px;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.03em;
	line-height: 1;
	color: #1f2937;
	text-transform: uppercase;
	white-space: nowrap;
}

/* ==========================================================================
   9. Product card styling (opt-in via the Customiser)
   ========================================================================== */

/*
 * Only applies when a card style is chosen — "Leave Porto's styling alone" is
 * the escape hatch, and it simply produces no body class for these to match.
 */
.ttp-cards-elevated ul.products li.product {
	background: var(--ttp-surface, #fff);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgb(var(--ttp-ink-rgb, 11 18 32) / 0.06),
		0 2px 8px rgb(var(--ttp-ink-rgb, 11 18 32) / 0.05);
	transition: box-shadow 0.24s ease, transform 0.24s ease;
}

.ttp-cards-elevated ul.products li.product:hover {
	box-shadow: 0 4px 8px rgb(var(--ttp-ink-rgb, 11 18 32) / 0.06),
		0 16px 36px rgb(var(--ttp-ink-rgb, 11 18 32) / 0.11);
	transform: translateY(-3px);
}

.ttp-cards-bordered ul.products li.product {
	background: var(--ttp-surface, #fff);
	border: 1px solid var(--ttp-border, #e2e8f0);
	border-radius: 12px;
	overflow: hidden;
	transition: border-color 0.2s ease;
}

.ttp-cards-bordered ul.products li.product:hover {
	border-color: var(--ttp-primary, #1d4ed8);
}

@media (prefers-reduced-motion: reduce) {
	.ttp-cards-elevated ul.products li.product,
	.ttp-cards-elevated ul.products li.product:hover { transition: none; transform: none; }
}

/* Keep card content clear of the rounded edge. */
.ttp-cards-elevated ul.products li.product > *:not(.ttp-onsale),
.ttp-cards-bordered ul.products li.product > *:not(.ttp-onsale) {
	max-width: 100%;
}

/* ==========================================================================
   10. Tabular prices
   ========================================================================== */

/*
 * Lining figures so prices in a grid align down the column. Cheap, and it makes
 * a price list look considered rather than accidental.
 */
.ttp .price,
.ttp .amount,
.ttp .woocommerce-Price-amount {
	font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   11. Your customisations
   --------------------------------------------------------------------------
   Add site-specific CSS below this line. Kept at the bottom so it wins over
   everything above without needing !important, and so an update to this theme
   never touches your work.
   ========================================================================== */
