/* =========================================================================
   RealWorld English — theme additions.
   Only markup with no source equivalent (WooCommerce / WordPress output),
   functional state hooks and motion parity live here. Compiled source
   styles remain in app.css.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Base functional helpers
   ---------------------------------------------------------------------- */

/* Fixed header + logged-in admin bar (Customizer preview and wp-admin bar). */
body.admin-bar .site-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .site-header {
		top: 46px;
	}
}

/* Dark sections follow Customizer navy/teal tokens (overrides compiled defaults). */
.dark-section {
	background: linear-gradient(
		150deg,
		hsl(var(--navy)) 0%,
		hsl(var(--navy) / 0.92) 55%,
		hsl(var(--teal)) 100%
	);
}

/* Pointer on interactive controls */
a[href],
button:not(:disabled),
input[type="button"]:not(:disabled),
input[type="submit"]:not(:disabled),
input[type="reset"]:not(:disabled),
label[for],
select,
summary,
.theme-nav-link,
.theme-shop-filter,
.theme-product-thumb,
.theme-faq-toggle,
.theme-cart-button,
[data-cart-open],
[data-cart-close],
[data-cart-remove] {
	cursor: pointer;
}

[hidden] {
	display: none !important;
}

.site-logo-img {
	height: var(--logo-height, 40px) !important;
	width: auto !important;
	display: block;
}

.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 !important;
	width: 1px;
	word-wrap: normal !important;
}

/* -------------------------------------------------------------------------
   2. Hero entrance animations (source: framer-motion variants)
   ---------------------------------------------------------------------- */

@keyframes theme-hero-badge {
	from { opacity: 0; transform: translateY(-10px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes theme-hero-title {
	from { opacity: 0; transform: translateY(60px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes theme-hero-sub {
	from { opacity: 0; transform: translateY(30px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes theme-hero-cta {
	from { opacity: 0; transform: translateY(30px); }
	to { opacity: 1; transform: translateY(0); }
}

.hero-anim {
	opacity: 0;
	animation-fill-mode: forwards;
	animation-timing-function: cubic-bezier(0.25, 0.4, 0.25, 1);
}

.hero-anim-1 {
	animation-name: theme-hero-badge;
	animation-duration: 0.8s;
	animation-delay: 0.2s;
}

.hero-anim-2 {
	animation-name: theme-hero-title;
	animation-duration: 0.9s;
	animation-delay: 0.4s;
}

.hero-anim-3 {
	animation-name: theme-hero-sub;
	animation-duration: 0.8s;
	animation-delay: 0.9s;
	animation-timing-function: ease;
}

.hero-anim-4 {
	animation-name: theme-hero-cta;
	animation-duration: 0.7s;
	animation-delay: 1.1s;
	animation-timing-function: ease;
}

/* -------------------------------------------------------------------------
   3. Scroll reveals (source: framer-motion whileInView)
   ---------------------------------------------------------------------- */

.reveal-item {
	opacity: 0;
	transform: translateY(30px);
	transition-property: opacity, transform;
	transition-duration: 0.6s;
	transition-timing-function: cubic-bezier(0.25, 0.4, 0.25, 1);
}

.reveal-item.reveal-slow {
	transition-duration: 0.7s;
}

.reveal-item.is-visible {
	opacity: 1;
	transform: none;
}

.reveal-delay-0 { transition-delay: 0s; }
.reveal-delay-1 { transition-delay: 0.1s; }

.theme-pillars-grid > .reveal-item:nth-child(2),
.theme-values-grid > .reveal-item:nth-child(2) { transition-delay: 0.12s; }
.theme-pillars-grid > .reveal-item:nth-child(3),
.theme-values-grid > .reveal-item:nth-child(3) { transition-delay: 0.24s; }
.theme-pillars-grid > .reveal-item:nth-child(4),
.theme-values-grid > .reveal-item:nth-child(4) { transition-delay: 0.36s; }
.theme-pillars-grid > .reveal-item:nth-child(5),
.theme-values-grid > .reveal-item:nth-child(5) { transition-delay: 0.48s; }
.theme-pillars-grid > .reveal-item:nth-child(6),
.theme-values-grid > .reveal-item:nth-child(6) { transition-delay: 0.6s; }

.theme-steps-grid > .reveal-item:nth-child(2) { transition-delay: 0.1s; }
.theme-steps-grid > .reveal-item:nth-child(3) { transition-delay: 0.2s; }
.theme-steps-grid > .reveal-item:nth-child(4) { transition-delay: 0.3s; }
.theme-steps-grid > .reveal-item:nth-child(5) { transition-delay: 0.4s; }
.theme-steps-grid > .reveal-item:nth-child(6) { transition-delay: 0.5s; }
.theme-steps-grid > .reveal-item:nth-child(7) { transition-delay: 0.6s; }
.theme-steps-grid > .reveal-item:nth-child(8) { transition-delay: 0.7s; }

/* Customizer preview + no-JS fallbacks: never leave content invisible. */
body.is-customizer .reveal-item,
body.is-customizer .hero-anim {
	opacity: 1;
	transform: none;
	animation: none;
	transition: none;
}

@media (prefers-reduced-motion: reduce) {
	.hero-anim,
	.reveal-item {
		opacity: 1 !important;
		transform: none !important;
		animation: none !important;
		transition: none !important;
	}
}

/* -------------------------------------------------------------------------
   4. Motion parity for source interactions
   ---------------------------------------------------------------------- */

.theme-shop-filter {
	transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
	background-color: transparent;
	color: hsl(var(--foreground));
	border-color: hsl(var(--border));
}

.theme-shop-filter[aria-pressed='true'] {
	background-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
	border-color: hsl(var(--primary));
}

.theme-shop-filter[aria-pressed='false']:hover {
	border-color: hsl(var(--primary));
	color: hsl(var(--primary));
}

.theme-shop-filter:hover {
	transform: scale(1.04);
}

.theme-shop-filter:active {
	transform: scale(0.96);
}

.theme-product-card-wrap:hover,
.theme-course-card:hover {
	transform: translateY(-6px);
	transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* -------------------------------------------------------------------------
   5. Cart drawer + overlay
   ---------------------------------------------------------------------- */

#theme-cart-overlay {
	position: fixed;
	inset: 0;
	background: hsl(var(--foreground) / 0.2);
	z-index: 40;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

body.cart-open #theme-cart-overlay {
	opacity: 1;
	visibility: visible;
}

#theme-cart-drawer {
	visibility: hidden;
}

body.cart-open #theme-cart-drawer {
	visibility: visible;
}

#theme-cart-drawer.is-updating > * {
	opacity: 0.6;
	pointer-events: none;
}

.theme-cart-count:empty {
	display: none;
}

/* -------------------------------------------------------------------------
   6. Single product additions
   ---------------------------------------------------------------------- */

.theme-quantity-wrapper {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	border: 1px solid hsl(var(--border));
	border-radius: calc(var(--radius) - 2px);
	background: hsl(var(--background));
	padding: 0.25rem;
	height: 2.75rem;
}

.theme-quantity-wrapper button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: calc(var(--radius) - 4px);
	color: hsl(var(--foreground));
	transition: background-color 0.2s ease;
}

.theme-quantity-wrapper button:hover {
	background: hsl(var(--secondary));
}

.theme-qty-input {
	width: 3rem;
	height: 100%;
	border: 0;
	background: transparent;
	text-align: center;
	font-family: var(--font-body);
	font-size: 0.875rem;
	line-height: 1.25rem;
	color: hsl(var(--foreground));
	-moz-appearance: textfield;
	appearance: textfield;
}

.theme-qty-input::-webkit-outer-spin-button,
.theme-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.theme-qty-input:focus {
	outline: none;
}

.single-product .theme-add-to-cart-area {
	display: flex;
	align-items: stretch;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.single-product .single_add_to_cart_button,
.single-product .theme-add-variation,
.single-product .theme-add-to-cart-area .button {
	flex: 1 1 auto;
	min-width: 160px;
}

.single-product .theme-product-gallery,
.single-product .theme-product-info,
.single-product .theme-product-layout {
	min-width: 0;
	max-width: 100%;
}

.single-product .theme-product-description,
.single-product .woocommerce-product-details__short-description,
.single-product .woocommerce-variation-description,
.single-product .posted_in {
	overflow-wrap: break-word;
	word-break: break-word;
}

.single-product .theme-product-description p:last-child,
.single-product .woocommerce-product-details__short-description p:last-child {
	margin-bottom: 0;
}

.theme-product-thumbnails {
	flex-wrap: wrap;
	max-width: 100%;
}

.theme-product-thumb {
	display: block;
	width: 5.5rem;
	border: 1px solid hsl(var(--border));
	border-radius: calc(var(--radius) - 2px);
	overflow: hidden;
	background: hsl(var(--card));
	transition: border-color 0.2s ease;
}

.theme-product-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.theme-product-thumb:hover,
.theme-product-thumb.is-active {
	border-color: hsl(var(--primary));
}

/* Variation table: label above control, like the design stacks fields. */
.single-product .variations {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1.5rem;
}

.single-product .variations tbody,
.single-product .variations tbody tr,
.single-product .variations tbody td {
	display: block;
	width: 100%;
}

.single-product .variations tbody td.label {
	padding-bottom: 0.25rem;
}

.single-product .variations tbody td.label label {
	display: block;
	font-family: var(--font-body);
	font-size: 0.875rem;
	font-weight: 600;
	color: hsl(var(--foreground));
}

.single-product .variations tbody td.value {
	padding-top: 0;
	padding-bottom: 0.75rem;
}

.single-product .variations select {
	width: 100%;
	height: 2.95rem;
	padding: 0.5rem 0.75rem;
	background: hsl(var(--background));
	border: 1px solid hsl(var(--border));
	border-radius: calc(var(--radius) - 2px);
	font-family: var(--font-body);
	font-size: 0.875rem;
	color: hsl(var(--foreground));
}

.single-product .single_variation_wrap {
	margin-top: 0.5rem;
}

.single-product .woocommerce-variation-price {
	margin-bottom: 1rem;
	font-family: var(--font-display);
	font-size: 1.5rem;
	font-weight: 700;
	color: hsl(var(--primary));
}

.single-product .woocommerce-variation-availability {
	margin-bottom: 1rem;
	font-family: var(--font-body);
	font-size: 0.875rem;
	color: hsl(var(--muted-foreground));
}

/* -------------------------------------------------------------------------
   7. WooCommerce shared elements
   ---------------------------------------------------------------------- */

.theme-stock-badge {
	display: inline-block;
	padding: 0.25rem 0.6rem;
	border-radius: 9999px;
	background: hsl(var(--muted));
	color: hsl(var(--muted-foreground));
	font-family: var(--font-body);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.woocommerce-price-suffix,
.woocommerce-Price-amount {
	font-family: inherit;
}

.woocommerce ul.products li.product .price,
.woocommerce div.product p.price,
.woocommerce div.product span.price {
	color: hsl(var(--foreground));
	font-family: var(--font-display);
	font-weight: 700;
}

.woocommerce div.product p.price ins,
.woocommerce div.product span.price ins {
	text-decoration: none;
}

/* Notices: visible on shop/cart/checkout/account, hidden where the drawer covers it. */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.wc-block-components-notice-banner {
	border-radius: calc(var(--radius));
	border: 1px solid hsl(var(--border));
	background: hsl(var(--card));
	color: hsl(var(--foreground));
	font-family: var(--font-body);
	font-size: 0.875rem;
	padding: 1rem 1.25rem;
	margin-bottom: 1.5rem;
	list-style: none;
}

.woocommerce-message,
.woocommerce-info {
	border-left: 4px solid hsl(var(--primary));
}

.woocommerce-error {
	border-left: 4px solid hsl(var(--destructive));
}

.single-product .woocommerce-message,
.single-product .woocommerce-info,
#theme-cart-drawer .woocommerce-message {
	display: none;
}

/* Hide "View cart" injected after AJAX add-to-cart. */
.woocommerce-page a.added_to_cart.wc-forward,
.single-product a.added_to_cart.wc-forward,
body a.added_to_cart.wc-forward {
	display: none !important;
}

/* Disabled add-to-cart buttons (variable products until a variation is chosen). */
.single_add_to_cart_button.button:disabled,
.single_add_to_cart_button.button.disabled,
.theme-add-variation.button:disabled,
.theme-add-variation.button.disabled,
.add_to_cart_button.button:disabled,
.add_to_cart_button.button.disabled {
	cursor: not-allowed !important;
	opacity: 0.4 !important;
	pointer-events: none !important;
}

.single_add_to_cart_button.button:disabled:hover,
.single_add_to_cart_button.button.disabled:hover,
.theme-add-variation.button:disabled:hover,
.theme-add-variation.button.disabled:hover,
.add_to_cart_button.button:disabled:hover,
.add_to_cart_button.button.disabled:hover {
	opacity: 0.4 !important;
}

/* Loading states */
.ajax_add_to_cart.theme-btn-loading,
.theme-add-variation.theme-btn-loading {
	opacity: 0.6 !important;
	pointer-events: none !important;
	cursor: wait !important;
}

.single-product .single_add_to_cart_button.loading::after,
.single-product .theme-add-variation.loading::after,
.ajax_add_to_cart.loading::after {
	display: none !important;
}

/* Breadcrumbs (removed from output; rules kept for plugin callbacks). */
.woocommerce-breadcrumb {
	font-family: var(--font-body);
	font-size: 0.8125rem;
	color: hsl(var(--muted-foreground));
	margin-bottom: 1rem;
}

/* Pagination */
.theme-pagination .nav-links {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--font-body);
	font-size: 0.875rem;
}

.theme-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0 0.75rem;
	border: 1px solid hsl(var(--border));
	border-radius: calc(var(--radius) - 2px);
	color: hsl(var(--foreground));
	background: hsl(var(--background));
}

.theme-pagination .page-numbers.current {
	background: hsl(var(--primary));
	border-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
}

.theme-pagination .page-numbers:hover {
	border-color: hsl(var(--primary));
	color: hsl(var(--primary));
}

/* -------------------------------------------------------------------------
   8. WordPress content inside pages
   ---------------------------------------------------------------------- */

.entry-content > * + * {
	margin-top: 1rem;
}

.entry-content h2,
.entry-content h3 {
	font-family: var(--font-display);
	font-weight: 700;
	letter-spacing: -0.01em;
}

.entry-content a {
	color: hsl(var(--primary));
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.25rem;
	list-style: disc;
}

/* -------------------------------------------------------------------------
   9. Cart and account pages (checkout → assets/css/checkout-layout.css)
   ---------------------------------------------------------------------- */

.woocommerce-cart .entry-content,
.woocommerce-account .entry-content {
	max-width: none;
}

/* Classic WooCommerce forms (cart / account). */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce-account .woocommerce form input.input-text {
	background-color: hsl(var(--background));
	border: 1px solid hsl(var(--border));
	border-radius: calc(var(--radius) - 2px);
	color: hsl(var(--foreground));
	font-family: var(--font-body);
	font-size: 0.875rem;
	padding: 0.75rem 1rem;
}

.woocommerce form .form-row label {
	font-family: var(--font-body);
	font-size: 0.875rem;
	font-weight: 600;
	color: hsl(var(--foreground));
}

.woocommerce table.shop_table {
	border: 1px solid hsl(var(--border));
	border-radius: var(--radius);
	border-collapse: separate;
	border-spacing: 0;
	font-family: var(--font-body);
	font-size: 0.875rem;
	overflow: hidden;
}

.woocommerce table.shop_table th {
	font-family: var(--font-body);
	font-weight: 700;
	background: hsl(var(--secondary));
}

.woocommerce table.shop_table td,
.woocommerce table.shop_table th {
	border-color: hsl(var(--border));
	padding: 0.875rem 1rem;
}

.woocommerce .cart-collaterals .cart_totals,
.woocommerce-page .cart-collaterals .cart_totals {
	width: 100%;
}

.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
	background-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
	border-radius: calc(var(--radius) - 2px);
	font-family: var(--font-body);
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1;
	padding: 0.875rem 2rem;
}

.woocommerce #respond input#submit:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
	background-color: hsl(var(--primary) / 0.9);
	color: hsl(var(--primary-foreground));
}

.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt {
	background-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
}

/* -------------------------------------------------------------------------
   10. Thank you page
   ---------------------------------------------------------------------- */

body.theme-thankyou-page {
	overflow-x: hidden;
}

body.theme-thankyou-page .woocommerce-order {
	font-family: var(--font-body);
	color: hsl(var(--foreground));
}

body.theme-thankyou-page .woocommerce-order h2,
body.theme-thankyou-page .woocommerce-order-details__title,
body.theme-thankyou-page .woocommerce-column__title {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.5rem;
	padding: 0 0 1rem 0;
}

body.theme-thankyou-page .woocommerce-order-overview {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	list-style: none;
	margin: 0 0 2rem;
	padding: 0;
}

body.theme-thankyou-page .woocommerce-order-overview li {
	border: 1px solid hsl(var(--border));
	border-radius: var(--radius);
	background: hsl(var(--card));
	padding: 1rem 1.25rem;
	font-size: 0.8125rem;
	color: hsl(var(--muted-foreground));
}

body.theme-thankyou-page .woocommerce-order-overview li strong {
	display: block;
	margin-top: 0.35rem;
	font-family: var(--font-display);
	font-size: 1rem;
	color: hsl(var(--foreground));
}

body.theme-thankyou-page .woocommerce-order-details table {
	width: 100%;
	table-layout: fixed;
}

body.theme-thankyou-page .woocommerce-order-details tfoot th {
	text-align: left;
}

body.theme-thankyou-page .woocommerce-order-details tfoot td {
	text-align: right;
}

body.theme-thankyou-page .woocommerce-customer-details {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

body.theme-thankyou-page .woocommerce-customer-details address {
	max-width: 480px;
	overflow-wrap: break-word;
	border: 1px solid hsl(var(--border));
	border-radius: var(--radius);
	padding: 1.25rem;
	font-style: normal;
}

body.theme-thankyou-page .woocommerce-order .woocommerce-thankyou-order-received {
	font-family: var(--font-display);
	font-size: 1.5rem;
	font-weight: 700;
	margin-bottom: 1.5rem;
}
