/*
Theme Name:   Nifty Den — Astra Child
Theme URI:    https://niftyden.com/
Description:  Child theme for Astra. Brand identity, WooCommerce conversion styling and US-market trust cues for Nifty Den — a curated store of clever problem-solving gadgets.
Author:       Nifty Den
Author URI:   https://niftyden.com/
Template:     astra
Version:      1.0.0
Requires PHP: 7.4
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  niftyden
Tags:         e-commerce, one-column, custom-logo, custom-menu, featured-images
*/

/* ==========================================================================
   1. Brand tokens
   ========================================================================== */
:root {
	--nd-ink:          #131A2B;
	--nd-ink-2:        #2A3550;
	--nd-muted:        #6B7280;

	--nd-brand:        #F5A524; /* amber — the "bright idea". Primary CTA.   */
	--nd-brand-dark:   #D98A0B;
	--nd-brand-soft:   #FEF3DC;

	--nd-teal:         #0E7C7B; /* secondary — links, trust, in-stock        */
	--nd-teal-soft:    #E3F2F1;

	--nd-cream:        #FBF8F3;
	--nd-line:         #E7E2D9;
	--nd-white:        #FFFFFF;

	--nd-success:      #1F9D55;
	--nd-sale:         #D64545;

	--nd-radius:       14px;
	--nd-radius-sm:    9px;
	--nd-shadow:       0 1px 2px rgba(19,26,43,.05), 0 8px 24px rgba(19,26,43,.07);
	--nd-shadow-lift:  0 4px 10px rgba(19,26,43,.08), 0 18px 40px rgba(19,26,43,.12);
	--nd-ease:         cubic-bezier(.4,0,.2,1);
	--nd-wrap:         1240px;
}

/* ==========================================================================
   2. Base
   ========================================================================== */
body {
	background: var(--nd-cream);
	color: var(--nd-ink-2);
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.entry-title, .site-title {
	color: var(--nd-ink);
	letter-spacing: -.018em;
}

h1, .entry-title { font-weight: 800; line-height: 1.14; }
h2 { font-weight: 800; line-height: 1.2; }
h3 { font-weight: 700; }

a { color: var(--nd-teal); text-underline-offset: 3px; }
a:hover, a:focus { color: var(--nd-ink); }

/* Visible focus ring — keyboard users and accessibility compliance. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.button:focus-visible {
	outline: 3px solid var(--nd-brand);
	outline-offset: 2px;
	border-radius: 4px;
}

.ast-container, .ast-container-fluid { max-width: var(--nd-wrap); }

/* ==========================================================================
   3. Buttons — amber CTA carries every conversion action
   ========================================================================== */
.ast-button,
.button,
button,
input[type="submit"],
.wp-block-button__link,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt {
	background: var(--nd-brand);
	border: 0;
	border-radius: var(--nd-radius-sm);
	color: var(--nd-ink);
	font-weight: 700;
	letter-spacing: .012em;
	padding: 14px 28px;
	line-height: 1.3;
	box-shadow: 0 2px 0 rgba(19,26,43,.10);
	transition: transform .16s var(--nd-ease), background .16s var(--nd-ease), box-shadow .16s var(--nd-ease);
}

.ast-button:hover,
.button:hover,
button:hover,
input[type="submit"]:hover,
.wp-block-button__link:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover {
	background: var(--nd-brand-dark);
	color: var(--nd-ink);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(217,138,11,.34);
}

.button:disabled,
.woocommerce a.button.disabled,
.woocommerce button.button:disabled,
.woocommerce button.button.disabled {
	background: var(--nd-line);
	color: var(--nd-muted);
	box-shadow: none;
	transform: none;
}

/* Outline block buttons must not inherit the amber fill above. Core's own
   is-style-outline rule already wins on specificity, but stating it here means
   the look does not depend on stylesheet order. */
.wp-block-button.is-style-outline > .wp-block-button__link,
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background) {
	background: transparent;
	border-width: 2px;
	border-style: solid;
	box-shadow: none;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: rgba(245,165,36,.14);
	box-shadow: none;
}

/* Secondary / ghost */
.nd-btn-ghost,
.woocommerce a.button.wc-forward,
.woocommerce .cart .button[name="update_cart"] {
	background: transparent;
	color: var(--nd-ink);
	box-shadow: inset 0 0 0 2px var(--nd-line);
}
.nd-btn-ghost:hover,
.woocommerce a.button.wc-forward:hover,
.woocommerce .cart .button[name="update_cart"]:hover {
	background: var(--nd-white);
	color: var(--nd-ink);
	box-shadow: inset 0 0 0 2px var(--nd-ink);
}

/* The single most important button on the site. */
.woocommerce div.product form.cart .single_add_to_cart_button {
	width: 100%;
	padding: 18px 28px;
	font-size: 1.05rem;
	text-transform: uppercase;
	letter-spacing: .04em;
}

/* ==========================================================================
   4. Announcement bar + header
   ========================================================================== */
.nd-topbar {
	background: var(--nd-ink);
	color: #E9EDF5;
	font-size: .82rem;
	font-weight: 600;
	letter-spacing: .03em;
	text-align: center;
	padding: 9px 16px;
}
.nd-topbar strong { color: var(--nd-brand); }

.site-header, .ast-primary-header-bar {
	background: var(--nd-white);
	border-bottom: 1px solid var(--nd-line);
}

.ast-site-identity .custom-logo-link img { max-height: 46px; width: auto; }

.main-header-menu > .menu-item > .menu-link {
	font-weight: 600;
	color: var(--nd-ink);
}
.main-header-menu > .menu-item > .menu-link:hover { color: var(--nd-teal); }

/* Cart count bubble */
.ast-cart-menu-wrap .count,
.ast-addon-cart-wrap .ast-cart-menu-wrap .count {
	background: var(--nd-brand);
	color: var(--nd-ink);
	font-weight: 800;
	border-color: var(--nd-brand);
}

/* ==========================================================================
   5. USP strip — the four promises, sitewide
   ========================================================================== */
.nd-usp {
	background: var(--nd-white);
	border-block: 1px solid var(--nd-line);
	padding: 22px 0;
}
.nd-usp__grid {
	max-width: var(--nd-wrap);
	margin-inline: auto;
	padding-inline: 20px;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 18px;
}
.nd-usp__item {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: .9rem;
	line-height: 1.35;
}
.nd-usp__item svg { flex: 0 0 26px; width: 26px; height: 26px; color: var(--nd-teal); }
.nd-usp__item b { display: block; color: var(--nd-ink); font-weight: 700; }
.nd-usp__item span { color: var(--nd-muted); font-size: .82rem; }

@media (max-width: 921px) { .nd-usp__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .nd-usp__grid { grid-template-columns: 1fr; gap: 14px; } }

/* ==========================================================================
   6. Product cards
   ========================================================================== */
.woocommerce ul.products li.product {
	background: var(--nd-white);
	border: 1px solid var(--nd-line);
	border-radius: var(--nd-radius);
	overflow: hidden;
	padding: 0 0 18px;
	/* Column flex + margin-top:auto on the button keeps every "Add to Cart" on
	   the same baseline no matter how many lines the title wraps to. */
	display: flex;
	flex-direction: column;
	transition: transform .2s var(--nd-ease), box-shadow .2s var(--nd-ease), border-color .2s var(--nd-ease);
}
.woocommerce ul.products li.product:hover {
	transform: translateY(-4px);
	box-shadow: var(--nd-shadow-lift);
	border-color: transparent;
}
.woocommerce ul.products li.product a img {
	margin: 0 0 14px;
	border-radius: 0;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	background: var(--nd-cream);
}
.woocommerce ul.products li.product .woocommerce-loop-product__title {
	padding: 0 16px;
	font-size: 1rem !important;
	font-weight: 700;
	color: var(--nd-ink);
	line-height: 1.35;
}
.woocommerce ul.products li.product .price {
	display: block;
	padding: 6px 16px 12px;
	color: var(--nd-ink);
	font-weight: 800;
	font-size: 1.06rem;
}
.woocommerce ul.products li.product .price del {
	color: var(--nd-muted);
	font-weight: 500;
	opacity: 1;
	margin-inline-end: 6px;
}
.woocommerce ul.products li.product .price ins {
	text-decoration: none;
	color: var(--nd-sale);
}
.woocommerce ul.products li.product .button {
	margin: auto 16px 0; /* auto top edge pins it to the bottom of the card */
	width: calc(100% - 32px);
	text-align: center;
}
.woocommerce ul.products li.product .star-rating { margin: 0 16px 8px; font-size: .78rem; }

/* Sale flash */
.woocommerce span.onsale,
.woocommerce ul.products li.product .onsale {
	background: var(--nd-sale);
	color: var(--nd-white);
	font-weight: 800;
	font-size: .74rem;
	letter-spacing: .05em;
	text-transform: uppercase;
	border-radius: 999px;
	padding: 6px 13px;
	min-height: 0;
	min-width: 0;
	line-height: 1.4;
	top: 12px;
	inset-inline-start: 12px;
	inset-inline-end: auto;
	margin: 0;
}

/* ==========================================================================
   7. Single product
   ========================================================================== */
.woocommerce div.product .product_title { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }

.woocommerce div.product p.price,
.woocommerce div.product span.price {
	color: var(--nd-ink);
	font-weight: 800;
	font-size: 1.85rem;
}
.woocommerce div.product p.price del { color: var(--nd-muted); font-size: 1.15rem; font-weight: 500; }
.woocommerce div.product p.price ins { text-decoration: none; color: var(--nd-sale); }

.woocommerce div.product .stock.in-stock {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: var(--nd-teal-soft);
	color: #0A5F5E;
	font-weight: 700;
	font-size: .86rem;
	border-radius: 999px;
	padding: 6px 14px;
}
.woocommerce div.product .stock.in-stock::before {
	content: "";
	width: 8px; height: 8px;
	border-radius: 50%;
	background: var(--nd-success);
}

.woocommerce div.product .woocommerce-tabs ul.tabs { border-bottom: 1px solid var(--nd-line); padding: 0; }
.woocommerce div.product .woocommerce-tabs ul.tabs::before { display: none; }
.woocommerce div.product .woocommerce-tabs ul.tabs li {
	background: transparent;
	border: 0;
	border-radius: 0;
	margin: 0 22px 0 0;
	padding: 0;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after { display: none; }
.woocommerce div.product .woocommerce-tabs ul.tabs li a {
	color: var(--nd-muted);
	font-weight: 700;
	padding: 12px 0;
	display: block;
	border-bottom: 3px solid transparent;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
	color: var(--nd-ink);
	border-bottom-color: var(--nd-brand);
}

/* Trust row under add-to-cart (injected by functions.php) */
.nd-trust {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px 18px;
	margin: 22px 0 6px;
	padding: 18px;
	background: var(--nd-white);
	border: 1px solid var(--nd-line);
	border-radius: var(--nd-radius);
}
.nd-trust__item {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: .86rem;
	color: var(--nd-ink-2);
	line-height: 1.4;
}
.nd-trust__item svg { flex: 0 0 20px; width: 20px; height: 20px; color: var(--nd-teal); }
@media (max-width: 544px) { .nd-trust { grid-template-columns: 1fr; } }

/* Payment icons */
.nd-pay {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 14px;
}
.nd-pay span {
	font-size: .68rem;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--nd-ink-2);
	background: var(--nd-white);
	border: 1px solid var(--nd-line);
	border-radius: 6px;
	padding: 6px 10px;
}

/* ==========================================================================
   8. Cart / checkout — reduce abandonment friction
   ========================================================================== */
.woocommerce-cart table.cart,
.woocommerce-checkout .woocommerce-checkout-review-order-table {
	background: var(--nd-white);
	border: 1px solid var(--nd-line);
	border-radius: var(--nd-radius);
	overflow: hidden;
}
.woocommerce table.shop_table th { color: var(--nd-ink); font-weight: 700; }

.woocommerce-checkout #payment {
	background: var(--nd-white);
	border: 1px solid var(--nd-line);
	border-radius: var(--nd-radius);
}
.woocommerce-checkout #payment ul.payment_methods { border-bottom: 1px solid var(--nd-line); }
.woocommerce-checkout #payment div.payment_box {
	background: var(--nd-brand-soft);
	color: var(--nd-ink-2);
}
.woocommerce-checkout #payment div.payment_box::before { border-bottom-color: var(--nd-brand-soft); }

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.select2-container--default .select2-selection--single {
	border: 1px solid var(--nd-line);
	border-radius: var(--nd-radius-sm);
	padding: 12px 14px;
	background: var(--nd-white);
	color: var(--nd-ink);
	min-height: 48px;
}
.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
	border-color: var(--nd-brand);
	box-shadow: 0 0 0 3px rgba(245,165,36,.22);
	outline: none;
}

.woocommerce-info, .woocommerce-message {
	background: var(--nd-teal-soft);
	border-top-color: var(--nd-teal);
	color: #0A5F5E;
	border-radius: var(--nd-radius-sm);
}
.woocommerce-info::before, .woocommerce-message::before { color: var(--nd-teal); }
.woocommerce-error {
	background: #FDECEC;
	border-top-color: var(--nd-sale);
	color: #8B1F1F;
	border-radius: var(--nd-radius-sm);
}

/* Checkout security note */
.nd-secure {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 14px;
	font-size: .84rem;
	color: var(--nd-muted);
}
.nd-secure svg { width: 16px; height: 16px; color: var(--nd-success); }

/* ==========================================================================
   9. Footer
   ========================================================================== */
.site-footer,
.ast-small-footer,
.site-primary-footer-wrap,
.site-below-footer-wrap {
	background: var(--nd-ink);
	color: #A9B4C8;
	border: 0;
}
.site-footer a,
.site-primary-footer-wrap a,
.site-below-footer-wrap a { color: #D5DCE8; }
.site-footer a:hover,
.site-primary-footer-wrap a:hover,
.site-below-footer-wrap a:hover { color: var(--nd-brand); }
.site-footer h2, .site-footer h3, .site-footer .widget-title,
.site-primary-footer-wrap .widget-title { color: var(--nd-white); }

/* ==========================================================================
   9b. Trust layer — guarantee band + business identity
   ========================================================================== */
.nd-guarantee {
	background: linear-gradient(180deg, var(--nd-white) 0%, var(--nd-brand-soft) 100%);
	border-top: 1px solid var(--nd-line);
	padding: 56px 20px;
}
.nd-guarantee__inner {
	max-width: 940px;
	margin-inline: auto;
	display: grid;
	grid-template-columns: 168px 1fr;
	gap: 34px;
	align-items: center;
}
.nd-guarantee__seal {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	aspect-ratio: 1;
	border-radius: 50%;
	background: var(--nd-white);
	border: 3px dashed var(--nd-brand);
	color: var(--nd-ink);
	box-shadow: var(--nd-shadow);
}
.nd-guarantee__seal svg { width: 44px; height: 44px; color: var(--nd-teal); stroke-width: 1.5; }
.nd-guarantee__seal b {
	font-size: 1.16rem;
	font-weight: 800;
	letter-spacing: -.01em;
}
.nd-guarantee__body h2 {
	font-size: clamp(1.25rem, 2.6vw, 1.7rem);
	margin: 0 0 10px;
}
.nd-guarantee__body p {
	color: var(--nd-ink-2);
	margin: 0 0 18px;
	max-width: 62ch;
	line-height: 1.65;
}
.nd-guarantee__body .button { padding: 11px 22px; font-size: .92rem; }

@media (max-width: 700px) {
	.nd-guarantee { padding: 40px 20px; }
	.nd-guarantee__inner { grid-template-columns: 1fr; gap: 24px; justify-items: center; text-align: center; }
	.nd-guarantee__seal { width: 140px; }
	.nd-guarantee__body p { margin-inline: auto; }
}

.nd-bizbar {
	background: #0D1320;
	color: #8E9BB3;
	padding: 30px 20px;
	font-size: .86rem;
	border-top: 1px solid rgba(255,255,255,.07);
}
.nd-bizbar__inner {
	max-width: var(--nd-wrap);
	margin-inline: auto;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 28px;
}
.nd-bizbar__col { display: flex; flex-direction: column; gap: 5px; }
.nd-bizbar__col b {
	color: var(--nd-white);
	font-size: .74rem;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
	margin-bottom: 5px;
}
.nd-bizbar__col a { color: #C6D0E0; }
.nd-bizbar__col a:hover { color: var(--nd-brand); }
.nd-bizbar .nd-pay { margin-top: 2px; }
.nd-bizbar .nd-pay span {
	background: rgba(255,255,255,.06);
	border-color: rgba(255,255,255,.12);
	color: #C6D0E0;
}

@media (max-width: 780px) { .nd-bizbar__inner { grid-template-columns: 1fr; gap: 22px; } }

/* Applied to WooCommerce's review meta <em> via the template override. */
.nd-verified,
.woocommerce #reviews .nd-verified {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: var(--nd-teal-soft);
	color: #0A5F5E;
	font-size: .72rem;
	font-style: normal; /* it is an <em> in the WooCommerce markup */
	font-weight: 800;
	letter-spacing: .03em;
	border-radius: 999px;
	padding: 4px 10px;
	margin-inline-start: 6px;
	vertical-align: middle;
}
.nd-verified svg { width: 13px; height: 13px; stroke-width: 2.2; flex: 0 0 13px; }

.woocommerce #reviews .woocommerce-review__dash { color: var(--nd-muted); margin-inline: 4px; }
.woocommerce #reviews .woocommerce-review__author { color: var(--nd-ink); font-weight: 700; }
.woocommerce #reviews .woocommerce-review__published-date { color: var(--nd-muted); font-size: .84rem; }
.woocommerce #reviews .star-rating { color: var(--nd-brand-dark); }
.woocommerce p.stars a { color: var(--nd-brand-dark); }

/* ==========================================================================
   10. Utility
   ========================================================================== */
.nd-badge {
	display: inline-block;
	background: var(--nd-brand-soft);
	color: #8A5B00;
	font-size: .72rem;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
	border-radius: 999px;
	padding: 5px 12px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .001ms !important;
		transition-duration: .001ms !important;
		scroll-behavior: auto !important;
	}
	.woocommerce ul.products li.product:hover,
	.button:hover { transform: none; }
}
