/*
Theme Name:        Studio Theme
Description:       Custom theme for the Pouchsnic store, built from scratch.
Version:           1.0.0
Requires at least: 6.4
Requires PHP:      7.4
Author:            Ezzaldeen
License:           GPL-2.0-or-later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       studio-theme
WC requires at least: 9.0
*/

/* =========================================================
   Design tokens
   ========================================================= */
:root {
	/* Colors: deep black + electric blue */
	--color-bg: #05070d;
	--color-bg-elevated: #0a0e1a;
	--color-surface: #0f1424;
	--color-surface-2: #151b30;
	--color-text: #f3f6ff;
	--color-text-muted: #8d97b5;
	--color-text-subtle: #5f6987;
	--color-border: rgba(140, 170, 255, 0.12);
	--color-border-strong: rgba(140, 170, 255, 0.26);
	--color-accent: #2f6bff;
	--color-accent-hover: #4b80ff;
	--color-accent-soft: rgba(47, 107, 255, 0.14);
	--color-accent-2: #8fb6ff;
	--color-glow: rgba(47, 107, 255, 0.45);
	--color-success: #3ddc97;
	--color-danger: #ff5c7a;
	--color-on-accent: #ffffff;
	--color-warning-bg: #ffffff;
	--color-warning-text: #000000;

	--gradient-accent: linear-gradient(135deg, #2f6bff 0%, #5a8cff 55%, #9cc0ff 100%);
	--gradient-text: linear-gradient(120deg, #ffffff 0%, #c6d8ff 45%, #2f6bff 100%);
	--glow-radial: radial-gradient(60% 60% at 50% 40%, rgba(47, 107, 255, 0.28), transparent 70%);

	/* Typography */
	--font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--fs-xs: 0.75rem;
	--fs-sm: 0.875rem;
	--fs-base: 1rem;
	--fs-md: 1.125rem;
	--fs-lg: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
	--fs-xl: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
	--fs-2xl: clamp(2.25rem, 1.6rem + 3vw, 4rem);
	--fs-hero: clamp(2.75rem, 1.6rem + 5.5vw, 6.25rem);
	--fw-regular: 400;
	--fw-medium: 500;
	--fw-semibold: 600;
	--fw-bold: 700;
	--lh-tight: 1.05;
	--lh-snug: 1.25;
	--lh-body: 1.65;
	--tracking-tight: -0.035em;
	--tracking-wide: 0.14em;

	/* Spacing */
	--space-1: 0.25rem;
	--space-2: 0.5rem;
	--space-3: 0.75rem;
	--space-4: 1rem;
	--space-5: 1.5rem;
	--space-6: 2rem;
	--space-7: 3rem;
	--space-8: 4rem;
	--space-9: 6rem;
	--space-10: 8rem;
	--section-pad: clamp(4.5rem, 3rem + 7vw, 9rem);

	/* Layout */
	--container: 1280px;
	--container-narrow: 760px;
	--gutter: clamp(1rem, 4vw, 2.5rem);
	--header-height: 76px;
	--warning-bar-h: 44px; /* updated at runtime from the real bar height */
	--admin-bar-h: var(--wp-admin--admin-bar--height, 0px);
	--top-offset: calc(var(--admin-bar-h) + var(--warning-bar-h));

	/* Radii */
	--radius-xs: 6px;
	--radius-sm: 10px;
	--radius-md: 16px;
	--radius-lg: 24px;
	--radius-xl: 32px;
	--radius-pill: 999px;

	/* Shadows */
	--shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px -30px rgba(0, 0, 0, 0.8);
	--shadow-glow: 0 10px 40px -10px var(--color-glow);

	/* Layers */
	--z-header: 100;
	--z-overlay: 99;
	--z-warning: 110;
	--z-modal: 1000;

	/* Motion */
	--ease-out: cubic-bezier(0.22, 1, 0.36, 1);
	--ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
	--duration-fast: 0.2s;
	--duration-base: 0.45s;
	--duration-slow: 0.8s;
}

@media (max-width: 599px) {
	:root {
		--header-height: 64px;
		--warning-bar-h: 52px;
	}
}

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

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

body {
	margin: 0;
	padding-top: var(--warning-bar-h);
	background: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-sans);
	font-size: var(--fs-base);
	line-height: var(--lh-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 var(--space-4);
	font-family: var(--font-display);
	font-weight: var(--fw-semibold);
	line-height: var(--lh-snug);
	letter-spacing: -0.02em;
	color: var(--color-text);
}

p {
	margin: 0 0 var(--space-4);
}

a {
	color: var(--color-accent-2);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	transition: color var(--duration-fast) ease;
}

a:hover {
	color: var(--color-text);
}

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

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

:focus-visible {
	outline: 2px solid var(--color-accent-2);
	outline-offset: 3px;
}

/* =========================================================
   Layout helpers
   ========================================================= */
.container {
	width: 100%;
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.container--narrow {
	max-width: calc(var(--container-narrow) + 2 * var(--gutter));
}

.section {
	position: relative;
	padding-block: var(--section-pad);
}

.section-head {
	max-width: 720px;
	margin-bottom: var(--space-8);
}

.section-head--center {
	margin-inline: auto;
	text-align: center;
}

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	margin-bottom: var(--space-4);
	font-size: var(--fs-xs);
	font-weight: var(--fw-semibold);
	letter-spacing: var(--tracking-wide);
	text-transform: uppercase;
	color: var(--color-accent-2);
}

.eyebrow::before {
	content: "";
	width: 18px;
	height: 1px;
	background: currentColor;
}

.section-title {
	font-size: var(--fs-2xl);
	line-height: var(--lh-tight);
	letter-spacing: var(--tracking-tight);
}

.section-lead {
	font-size: var(--fs-md);
	color: var(--color-text-muted);
}

.text-gradient {
	background: var(--gradient-text);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.site-main {
	min-height: 60vh;
}

.site-main--page {
	padding-top: calc(var(--header-height) + var(--space-8));
	padding-bottom: var(--section-pad);
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
	--btn-bg: var(--color-accent);
	--btn-fg: var(--color-on-accent);
	--btn-border: transparent;
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	min-height: 48px;
	padding: 0.8rem 1.6rem;
	border: 1px solid var(--btn-border);
	border-radius: var(--radius-pill);
	background: var(--btn-bg);
	color: var(--btn-fg);
	font-family: var(--font-sans);
	font-size: var(--fs-sm);
	font-weight: var(--fw-semibold);
	letter-spacing: 0.01em;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition:
		background-color var(--duration-base) var(--ease-out),
		border-color var(--duration-base) var(--ease-out),
		box-shadow var(--duration-base) var(--ease-out),
		transform var(--duration-base) var(--ease-out),
		color var(--duration-fast) ease;
}

.btn:hover,
.btn:focus-visible {
	--btn-bg: var(--color-accent-hover);
	color: var(--btn-fg);
	box-shadow: var(--shadow-glow);
	transform: translateY(-1px);
}

.btn:active {
	transform: translateY(0);
}

.btn--ghost {
	--btn-bg: transparent;
	--btn-fg: var(--color-text);
	--btn-border: var(--color-border-strong);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
	--btn-bg: rgba(47, 107, 255, 0.1);
	--btn-border: var(--color-accent);
}

.btn--lg {
	min-height: 56px;
	padding: 1rem 2rem;
	font-size: var(--fs-base);
}

.btn--block {
	width: 100%;
}

.btn__icon {
	transition: transform var(--duration-base) var(--ease-out);
}

.btn:hover .btn__icon {
	transform: translateX(3px);
}

/* =========================================================
   Forms (base)
   ========================================================= */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="date"],
select,
textarea {
	width: 100%;
	min-height: 48px;
	padding: 0.75rem 1rem;
	border: 1px solid var(--color-border-strong);
	border-radius: var(--radius-sm);
	background: var(--color-bg-elevated);
	color: var(--color-text);
	font: inherit;
	font-size: max(16px, var(--fs-base)); /* 16px+ prevents iOS zoom on focus */
	transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

textarea {
	min-height: 140px;
	resize: vertical;
}

input::placeholder,
textarea::placeholder {
	color: var(--color-text-subtle);
}

input:focus,
select:focus,
textarea:focus {
	outline: none;
	border-color: var(--color-accent);
	box-shadow: 0 0 0 3px var(--color-accent-soft);
}

label {
	display: inline-block;
	margin-bottom: var(--space-2);
	font-size: var(--fs-sm);
	font-weight: var(--fw-medium);
	color: var(--color-text);
}

input[type="checkbox"],
input[type="radio"] {
	width: 18px;
	height: 18px;
	accent-color: var(--color-accent);
	vertical-align: middle;
}

/* =========================================================
   Prose (pages, legal text)
   ========================================================= */
.page-header {
	margin-bottom: var(--space-7);
}

.page-title {
	font-size: var(--fs-2xl);
	line-height: var(--lh-tight);
	letter-spacing: var(--tracking-tight);
}

.prose {
	color: var(--color-text-muted);
	font-size: var(--fs-md);
}

.prose h2,
.prose h3 {
	margin-top: var(--space-7);
	color: var(--color-text);
}

.prose h2 {
	font-size: var(--fs-xl);
}

.prose h3 {
	font-size: var(--fs-lg);
}

.prose strong {
	color: var(--color-text);
}

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

.prose li {
	margin-bottom: var(--space-2);
}

/* =========================================================
   Accessibility
   ========================================================= */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.skip-link:focus {
	position: fixed !important;
	top: calc(var(--top-offset) + 8px);
	left: 8px;
	z-index: var(--z-modal);
	width: auto;
	height: auto;
	padding: 0.75rem 1rem;
	clip: auto;
	border-radius: var(--radius-sm);
	background: var(--color-accent);
	color: var(--color-on-accent);
}

/* =========================================================
   Nicotine warning bar (FDA) — always visible, never animated
   ========================================================= */
.nicotine-warning-bar {
	position: fixed;
	top: var(--admin-bar-h);
	left: 0;
	right: 0;
	z-index: var(--z-warning);
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: var(--warning-bar-h);
	padding: 0.5rem var(--gutter);
	border-bottom: 2px solid var(--color-warning-text);
	background: var(--color-warning-bg);
	color: var(--color-warning-text);
	font-family: var(--font-sans);
	font-size: 15px;
	font-weight: var(--fw-bold);
	line-height: 1.3;
	text-align: center;
}

@media (max-width: 599px) {
	.nicotine-warning-bar {
		font-size: 13px;
	}
}

/* Inline variant: product pages, footer */
.nicotine-warning {
	padding: 0.85rem 1rem;
	border: 2px solid var(--color-warning-text);
	background: var(--color-warning-bg);
	color: var(--color-warning-text);
	font-size: var(--fs-sm);
	font-weight: var(--fw-bold);
	line-height: 1.4;
	text-align: center;
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* =========================================================
   404
   ========================================================= */
.error-404 {
	padding-block: var(--space-9);
	text-align: center;
}

.error-404 .eyebrow {
	justify-content: center;
}

.error-404__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--space-3);
	margin-top: var(--space-6);
}
