/*
Theme Name: Estelle Shop
Theme URI: https://shop.estellewalters.com
Author: Maravian
Author URI: https://maravian.com
Description: A dark, editorial WooCommerce storefront for shop.estellewalters.com. Mirrors the estellewalters.com brand system (deep black canvas, warm gold accent, serif display type) and is built for selling digital, downloadable products.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: estelle-shop
Tags: e-commerce, dark, one-column, custom-menu, featured-images, translation-ready
*/

/* -------------------------------------------------------------------------
 * 1. Design tokens
 *
 * Lifted from the estellewalters.com Tailwind theme so the two properties read
 * as one brand. Anything colour-related below should reference a token rather
 * than hard-code a hex value.
 * ---------------------------------------------------------------------- */

:root {
	color-scheme: dark;

	--ew-background: #0f0f0f;
	--ew-foreground: #fafafa;
	--ew-card: #1a1a1a;
	--ew-secondary: #1f1f1f;
	--ew-muted: #2a2a2a;
	--ew-muted-foreground: #a0a0a0;
	--ew-accent: #d4a574;
	--ew-accent-dark: #b8956a;
	--ew-accent-foreground: #0f0f0f;
	--ew-destructive: #ff6b6b;
	--ew-success: #7ec9a0;
	--ew-border: #2a2a2a;

	--ew-radius: 0.625rem;
	--ew-radius-sm: 0.375rem;
	--ew-radius-lg: 0.875rem;

	--ew-font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--ew-font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
	--ew-font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

	--ew-wrap: 72rem;
	--ew-wrap-narrow: 48rem;
	--ew-gutter: 1rem;
	--ew-header-height: 4rem;

	--ew-shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
	--ew-transition: 200ms ease;
}

@media (min-width: 640px) {
	:root { --ew-gutter: 1.5rem; }
}

@media (min-width: 1024px) {
	:root { --ew-gutter: 2rem; }
}

/* -------------------------------------------------------------------------
 * 2. Reset + base
 * ---------------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--ew-header-height) + 1rem);
}

body {
	margin: 0;
	background-color: var(--ew-background);
	color: var(--ew-foreground);
	font-family: var(--ew-font-sans);
	font-size: 1rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--ew-font-serif);
	font-weight: 600;
	line-height: 1.15;
	margin: 0 0 0.75rem;
	text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p { margin: 0 0 1rem; }

a {
	color: var(--ew-accent);
	text-decoration: none;
	transition: color var(--ew-transition);
}

a:hover,
a:focus-visible { color: var(--ew-accent-dark); }

img,
svg,
video {
	max-width: 100%;
	height: auto;
	display: block;
}

hr {
	border: 0;
	border-top: 1px solid var(--ew-border);
	margin: 2.5rem 0;
}

ul, ol { padding-left: 1.25rem; }

blockquote {
	margin: 1.5rem 0;
	padding: 0.25rem 0 0.25rem 1.25rem;
	border-left: 2px solid var(--ew-accent);
	color: var(--ew-muted-foreground);
	font-family: var(--ew-font-serif);
	font-style: italic;
}

code, pre { font-family: var(--ew-font-mono); font-size: 0.875em; }

:focus-visible {
	outline: 2px solid var(--ew-accent);
	outline-offset: 2px;
	border-radius: var(--ew-radius-sm);
}

::selection {
	background: var(--ew-accent);
	color: var(--ew-accent-foreground);
}

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999;
	background: var(--ew-accent);
	color: var(--ew-accent-foreground);
	padding: 0.75rem 1.25rem;
	border-radius: 0 0 var(--ew-radius) 0;
	font-weight: 600;
}

.skip-link:focus {
	left: 0;
	color: var(--ew-accent-foreground);
}

/* -------------------------------------------------------------------------
 * 3. Layout primitives
 * ---------------------------------------------------------------------- */

.ew-wrap {
	width: 100%;
	max-width: var(--ew-wrap);
	margin-inline: auto;
	padding-inline: var(--ew-gutter);
}

.ew-wrap--narrow { max-width: var(--ew-wrap-narrow); }

.ew-site { display: flex; flex-direction: column; min-height: 100vh; }

.ew-main { flex: 1 0 auto; padding-block: 3rem 5rem; }

/* Pages that open with a full-bleed hero supply their own top spacing. */
.ew-has-hero .ew-main { padding-top: 0; }

.ew-section { padding-block: 4rem; }

.ew-section--muted { background: rgba(31, 31, 31, 0.4); }

.ew-eyebrow {
	color: var(--ew-accent);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	margin: 0 0 0.75rem;
}

.ew-section-header { margin-bottom: 3rem; }
.ew-section-header--center { text-align: center; }

.ew-section-header p {
	color: var(--ew-muted-foreground);
	max-width: 42rem;
	margin-inline: auto;
}

.ew-lede {
	font-size: 1.125rem;
	color: var(--ew-muted-foreground);
	line-height: 1.7;
}

/* -------------------------------------------------------------------------
 * 4. Buttons
 * ---------------------------------------------------------------------- */

.ew-btn,
.woocommerce .button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.wp-element-button,
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.75rem 1.5rem;
	border: 1px solid transparent;
	border-radius: var(--ew-radius);
	background: var(--ew-accent);
	color: var(--ew-accent-foreground);
	font-family: var(--ew-font-sans);
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: transform var(--ew-transition), background-color var(--ew-transition),
		color var(--ew-transition), border-color var(--ew-transition);
}

.ew-btn:hover,
.woocommerce .button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.wp-element-button:hover,
.wp-block-button__link:hover {
	background: var(--ew-foreground);
	color: var(--ew-accent);
	transform: translateY(-1px);
}

.ew-btn:active,
.woocommerce .button:active { transform: translateY(0) scale(0.98); }

.ew-btn--outline,
.woocommerce a.button.ew-btn--outline {
	background: transparent;
	border-color: var(--ew-accent);
	color: var(--ew-accent);
}

.ew-btn--outline:hover,
.woocommerce a.button.ew-btn--outline:hover {
	background: rgba(212, 165, 116, 0.1);
	border-color: var(--ew-foreground);
	color: var(--ew-accent);
}

.ew-btn--ghost {
	background: var(--ew-secondary);
	color: var(--ew-foreground);
	border-color: var(--ew-border);
}

.ew-btn--ghost:hover {
	background: var(--ew-muted);
	color: var(--ew-foreground);
}

.ew-btn--lg { padding: 1rem 2rem; font-size: 1rem; }
.ew-btn--sm { padding: 0.5rem 0.875rem; font-size: 0.75rem; border-radius: var(--ew-radius-sm); }
.ew-btn--full { width: 100%; }

.ew-btn[disabled],
.woocommerce .button[disabled],
.woocommerce .button.disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

/* -------------------------------------------------------------------------
 * 5. Forms
 * ---------------------------------------------------------------------- */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="date"],
select,
textarea,
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
	width: 100%;
	padding: 0.75rem 0.875rem;
	background: var(--ew-secondary);
	border: 1px solid var(--ew-border);
	border-radius: var(--ew-radius);
	color: var(--ew-foreground);
	font-family: var(--ew-font-sans);
	font-size: 0.9375rem;
	line-height: 1.4;
	transition: border-color var(--ew-transition), box-shadow var(--ew-transition);
	appearance: none;
}

textarea { min-height: 8rem; resize: vertical; }

input::placeholder,
textarea::placeholder { color: #6b6b6b; }

input:focus,
select:focus,
textarea:focus,
.woocommerce form .form-row input.input-text:focus {
	outline: none;
	border-color: var(--ew-accent);
	box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.15);
}

label,
.woocommerce form .form-row label {
	display: block;
	margin-bottom: 0.375rem;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--ew-foreground);
}

.required { color: var(--ew-accent); text-decoration: none; }

input[type="checkbox"],
input[type="radio"] {
	width: auto;
	accent-color: var(--ew-accent);
	margin-right: 0.5rem;
}

/* -------------------------------------------------------------------------
 * 6. Header
 * ---------------------------------------------------------------------- */

.ew-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(15, 15, 15, 0.85);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--ew-border);
}

.ew-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: var(--ew-header-height);
	gap: 1rem;
}

.ew-brand {
	display: inline-flex;
	align-items: baseline;
	font-family: var(--ew-font-serif);
	font-size: 1.25rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--ew-foreground);
	white-space: nowrap;
}

.ew-brand:hover { color: var(--ew-foreground); }
.ew-brand__dot { color: var(--ew-accent); }

.ew-brand__suffix {
	margin-left: 0.5rem;
	padding-left: 0.5rem;
	border-left: 1px solid var(--ew-border);
	font-family: var(--ew-font-sans);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--ew-muted-foreground);
}

.ew-nav { display: none; }

@media (min-width: 900px) {
	.ew-nav { display: flex; align-items: center; gap: 2rem; }
}

.ew-nav ul {
	display: flex;
	align-items: center;
	gap: 2rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ew-nav a {
	font-size: 0.875rem;
	color: var(--ew-muted-foreground);
	transition: color var(--ew-transition), transform var(--ew-transition);
	display: inline-block;
}

.ew-nav a:hover,
.ew-nav .current-menu-item > a,
.ew-nav .current_page_item > a {
	color: var(--ew-foreground);
	transform: translateY(-2px);
}

/* Links that leave for the main brand site get a subtle outbound marker. */
.ew-nav a[data-external="1"]::after,
.ew-mobile-nav a[data-external="1"]::after {
	content: "\2197";
	font-size: 0.75em;
	margin-left: 0.25rem;
	opacity: 0.6;
}

.ew-header__actions {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.ew-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
	width: 2.5rem;
	height: 2.5rem;
	border: 1px solid transparent;
	border-radius: var(--ew-radius);
	background: transparent;
	color: var(--ew-muted-foreground);
	cursor: pointer;
	transition: background-color var(--ew-transition), color var(--ew-transition);
}

.ew-icon-btn:hover {
	background: var(--ew-muted);
	color: var(--ew-foreground);
}

.ew-cart-count {
	position: absolute;
	top: 0.125rem;
	right: 0.125rem;
	min-width: 1.125rem;
	height: 1.125rem;
	padding: 0 0.25rem;
	border-radius: 999px;
	background: var(--ew-accent);
	color: var(--ew-accent-foreground);
	font-size: 0.625rem;
	font-weight: 700;
	line-height: 1.125rem;
	text-align: center;
}

.ew-cart-count[hidden] { display: none; }

.ew-menu-toggle { display: inline-flex; }

/* The toggle holds both glyphs; aria-expanded decides which one shows. */
.ew-menu-toggle svg + svg { display: none; }
.ew-menu-toggle[aria-expanded="true"] svg:first-of-type { display: none; }
.ew-menu-toggle[aria-expanded="true"] svg + svg { display: block; }

@media (min-width: 900px) {
	.ew-menu-toggle { display: none; }
}

.ew-mobile-nav {
	display: none;
	border-top: 1px solid var(--ew-border);
	padding-block: 0.75rem 1.25rem;
}

.ew-mobile-nav.is-open { display: block; }

@media (min-width: 900px) {
	.ew-mobile-nav.is-open { display: none; }
}

.ew-mobile-nav ul { list-style: none; margin: 0; padding: 0; }

.ew-mobile-nav a {
	display: block;
	padding: 0.625rem 0;
	font-size: 0.9375rem;
	color: var(--ew-muted-foreground);
}

.ew-mobile-nav a:hover { color: var(--ew-foreground); }

/* Strip that points visitors back to the main brand site. */
.ew-topbar {
	background: var(--ew-secondary);
	border-bottom: 1px solid var(--ew-border);
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	color: var(--ew-muted-foreground);
}

.ew-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	/* Wrapping matters here: without it the two phrases set a min-content width
	   wider than a phone, which widens the whole document rather than just this
	   bar. */
	flex-wrap: wrap;
	gap: 0.25rem 0.5rem;
	min-height: 2.25rem;
	padding-block: 0.375rem;
	text-align: center;
}

.ew-topbar a { color: var(--ew-accent); font-weight: 600; }

/* -------------------------------------------------------------------------
 * 7. Footer
 * ---------------------------------------------------------------------- */

.ew-footer {
	background: var(--ew-secondary);
	border-top: 1px solid var(--ew-border);
	padding-block: 3rem 2rem;
	margin-top: auto;
}

.ew-footer__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2.5rem;
	margin-bottom: 3rem;
}

@media (min-width: 768px) {
	.ew-footer__grid { grid-template-columns: repeat(3, 1fr); gap: 3rem; }
}

.ew-footer h3 { font-size: 1.125rem; margin-bottom: 0.5rem; }

.ew-footer h4 {
	font-family: var(--ew-font-sans);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	margin-bottom: 1rem;
}

.ew-footer p,
.ew-footer li { font-size: 0.875rem; color: var(--ew-muted-foreground); }

.ew-footer ul { list-style: none; margin: 0; padding: 0; }
.ew-footer li + li { margin-top: 0.5rem; }

.ew-footer ul a { color: var(--ew-muted-foreground); }
.ew-footer ul a:hover { color: var(--ew-foreground); }

.ew-footer__social { display: flex; gap: 1rem; }

.ew-footer__social a {
	color: var(--ew-muted-foreground);
	transition: color var(--ew-transition), transform var(--ew-transition);
	display: inline-flex;
}

.ew-footer__social a:hover { color: var(--ew-accent); transform: scale(1.15); }

.ew-footer__bottom {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	padding-top: 2rem;
	border-top: 1px solid var(--ew-border);
	font-size: 0.8125rem;
	color: var(--ew-muted-foreground);
	text-align: center;
}

@media (min-width: 640px) {
	.ew-footer__bottom { flex-direction: row; justify-content: space-between; text-align: left; }
}

.ew-footer__bottom-links { display: flex; gap: 1.5rem; }
.ew-footer__bottom-links a { color: var(--ew-muted-foreground); }
.ew-footer__bottom-links a:hover { color: var(--ew-foreground); }

.ew-trust {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1.5rem;
	padding-block: 1.5rem;
	border-top: 1px solid var(--ew-border);
	color: var(--ew-muted-foreground);
	font-size: 0.75rem;
}

.ew-trust span { display: inline-flex; align-items: center; gap: 0.4rem; }
.ew-trust svg { color: var(--ew-accent); flex: none; }

/* -------------------------------------------------------------------------
 * 8. Editorial content (pages, posts, 404)
 * ---------------------------------------------------------------------- */

.ew-page-header {
	padding-block: 3rem 2rem;
	border-bottom: 1px solid var(--ew-border);
	margin-bottom: 3rem;
}

.ew-page-header--center { text-align: center; }

.ew-entry-content > * + * { margin-top: 1.25rem; }
.ew-entry-content h2 { margin-top: 2.5rem; }
.ew-entry-content h3 { margin-top: 2rem; }

.ew-entry-content img { border-radius: var(--ew-radius); }

.ew-entry-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.ew-entry-content th,
.ew-entry-content td {
	padding: 0.75rem;
	border-bottom: 1px solid var(--ew-border);
	text-align: left;
}

/* Standalone notice the theme renders itself, where a WooCommerce notice would
   not survive (e.g. above the block-based Cart). */
.ew-notice {
	margin-bottom: 2rem;
	padding: 1.25rem 1.5rem;
	border: 1px solid var(--ew-border);
	border-left: 3px solid var(--ew-accent);
	border-radius: var(--ew-radius);
	background: var(--ew-card);
}

.ew-notice p { font-size: 0.9375rem; color: var(--ew-muted-foreground); }
.ew-notice p:first-child { color: var(--ew-foreground); }
.ew-notice p:last-child { margin-bottom: 0; }

.ew-404 { text-align: center; padding-block: 5rem; }
.ew-404 .ew-eyebrow { font-size: 0.875rem; }

.ew-breadcrumb,
.woocommerce .woocommerce-breadcrumb {
	font-size: 0.8125rem;
	color: var(--ew-muted-foreground);
	margin-bottom: 1.5rem;
}

.woocommerce .woocommerce-breadcrumb a { color: var(--ew-muted-foreground); }
.woocommerce .woocommerce-breadcrumb a:hover { color: var(--ew-accent); }

/* Pagination */
.ew-pagination,
.woocommerce nav.woocommerce-pagination {
	display: flex;
	justify-content: center;
	margin-top: 3rem;
}

.woocommerce nav.woocommerce-pagination ul {
	display: flex;
	gap: 0.5rem;
	border: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.woocommerce nav.woocommerce-pagination ul li { border: 0; margin: 0; overflow: visible; }

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.5rem;
	border: 1px solid var(--ew-border);
	border-radius: var(--ew-radius);
	background: var(--ew-card);
	color: var(--ew-muted-foreground);
	font-size: 0.875rem;
}

.woocommerce nav.woocommerce-pagination ul li a:hover,
.woocommerce nav.woocommerce-pagination ul li span.current {
	background: var(--ew-accent);
	border-color: var(--ew-accent);
	color: var(--ew-accent-foreground);
}
