/**
 * Theme Name: TTC Spectra One Child
 * Theme URI: https://thetrendcollective.in/
 * Description: Child theme for the Spectra One full-site-editing (block)
 * theme. Holds The Trend Collective customizations so the parent theme is
 * never edited.
 * Author: The Trend Collective
 * Template: spectra-one
 * Version: 1.0.0
 * License: GNU General Public License v2 or later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: ttc-spectra-one-child
 * Tags: full-site-editing, e-commerce
 */

/*
 * CSS overrides for The Trend Collective.
 *
 * This file is enqueued by functions.php after the parent theme's stylesheets
 * (the parent enqueues its own styles from its functions.php, which still runs
 * for a child theme). For most global design changes, prefer theme.json; use
 * this file only for small targeted overrides.
 */

/*
 * The Spectra One header logo image is replaced with a "The Trend Collective"
 * text wordmark (see functions.php). Style that wordmark in Comic Sans, white
 * so it stays legible on the purple foreground header background.
 */
.ttc-site-title {
	margin: 0;
	line-height: 1.2;
}

.ttc-site-title a,
.ttc-site-title a:hover,
.ttc-site-title a:focus {
	font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", "Comic Neue", cursive;
	font-size: 1.5rem;
	font-weight: 700;
	color: #ffffff;
	text-decoration: none;
	white-space: nowrap;
}

/*
 * Header CTA: WooCommerce auto-injects the Customer Account block into
 * block-theme headers as an "icon only" glyph drawn with `currentColor`, which
 * is invisible against the purple header. functions.php renders it as a button
 * instead; style that button like the parent theme's inverse "Get Started"
 * CTA (white fill, dark label, 6px radius). Padding and typography come from
 * the global `.wp-element-button` styles, so only the colours differ here.
 */
.ttc-header-login-button {
	margin: 0;
}

.ttc-header-login-button .wp-element-button,
.ttc-header-login-button .wp-element-button:hover,
.ttc-header-login-button .wp-element-button:focus {
	color: #1f2937;
	background: #ffffff;
	border-radius: 6px;
}

/*
 * Header account/cart arrangement: WooCommerce hooks the Mini-Cart directly
 * after the Customer Account block. Both are direct children of the header's
 * flex row, so flex `order` places the cart to the left of the Login button.
 */
header.wp-block-template-part .wc-block-mini-cart {
	order: 1;
}

header.wp-block-template-part .ttc-header-login-button {
	order: 2;
}

/*
 * The mini-cart icon is an SVG painted with `fill="currentColor"`, so it
 * inherits the dark body colour and is hard to see on the purple header.
 * Colour it white and size it up (WooCommerce's default is 1.5em) so it sits
 * at the same visual weight as the Login button and nav links.
 */
header.wp-block-template-part .wc-block-mini-cart__button {
	color: #ffffff;
}

header.wp-block-template-part .wc-block-mini-cart__icon {
	height: 2em;
	width: 2em;
}

/*
 * The count badge's colours are computed by WooCommerce's front-end JS from
 * the button's computed styles (badge background = button colour, badge text =
 * button background). With a white button colour that would leave the number
 * on a white disc with transparent text, so pin the badge explicitly to a
 * white disc with a purple number.
 */
header.wp-block-template-part .wc-block-mini-cart__badge {
	background-color: #ffffff;
	color: var(--wp--preset--color--foreground);
}

/*
 * Quantity stepper ( − / + ) for the Add-to-cart CTA.
 *
 * These rules mirror WooCommerce's own `wc-block-components-quantity-selector`
 * component CSS (see `add-to-cart-with-options-quantity-selector-style.css` in
 * the WooCommerce plugin) so the loop CTA rendered by the child theme looks
 * identical to the stepper used by the Cart block. We keep a copy here so the
 * loop CTA is styled consistently even if the header mini-cart ever stops
 * loading the block stylesheet.
 */
.wc-block-components-quantity-selector {
	border-radius: 4px;
	box-sizing: content-box;
	display: flex;
	margin: 0 0 0.25em;
	position: relative;
	width: 107px;
}

.wc-block-components-quantity-selector:after {
	border: 1px solid;
	border-radius: 4px;
	bottom: 0;
	content: "";
	left: 0;
	opacity: 0.3;
	pointer-events: none;
	position: absolute;
	right: 0;
	top: 0;
}

.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input {
	appearance: textfield;
	background: transparent;
	border: 0;
	box-shadow: none;
	color: currentColor;
	flex: 1 1 auto;
	font-size: 1em;
	font-weight: 600;
	line-height: 1;
	margin: 0;
	min-width: 40px;
	order: 2;
	padding: 0.4em 0;
	text-align: center;
	vertical-align: middle;
}

.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input:focus {
	box-shadow: inset 0 0 1px 1px currentColor;
	outline: none;
}

.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input:disabled {
	opacity: 0.6;
}

.wc-block-components-quantity-selector input::-webkit-inner-spin-button,
.wc-block-components-quantity-selector input::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
	background: none transparent;
	border: 0;
	box-shadow: none;
	color: currentColor;
	cursor: pointer;
	font-size: 0.9em;
	font-style: normal;
	font-weight: 400;
	margin: 0;
	min-width: 30px;
	opacity: 0.6;
	padding: 0;
	text-align: center;
	text-decoration: none;
}

.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus {
	box-shadow: inset 0 0 1px 1px currentColor;
	outline: none;
}

.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus,
.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:hover {
	opacity: 1;
}

.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:disabled {
	box-shadow: none;
	cursor: default;
	opacity: 0.6;
}

.wc-block-components-quantity-selector > .wc-block-components-quantity-selector__button--minus {
	border-radius: 4px 0 0 4px;
	order: 1;
}

.wc-block-components-quantity-selector > .wc-block-components-quantity-selector__button--plus {
	border-radius: 0 4px 4px 0;
	order: 3;
}

.wc-block-components-quantity-selector[hidden] {
	display: none;
}

/*
 * Loop Add-to-cart CTA: sit the stepper and the button side by side in the
 * product card, centred, matching the old product-button alignment.
 */
.ttc-loop-add-to-cart {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.ttc-loop-add-to-cart .wc-block-components-quantity-selector {
	margin: 0;
}
