/*
Theme Name: GiftStoreBox Blocks
Theme URI: https://giftstorebox.com
Description: Lightweight block theme for giftstorebox.com. System fonts, no render-blocking requests, WooCommerce blocks. Pairs with the GiftStoreBox Dropship Kit plugin.
Version: 1.6.0
Requires at least: 6.4
Requires PHP: 8.0
Author: GiftStoreBox
License: GNU General Public License v2 or later
Text Domain: giftstorebox-blocks
*/

/* Palette roles: --pine (primary actions), --ribbon (prices, urgency), --kraft (gift tags). */
:root {
	--pine: var(--wp--preset--color--berry);
	--pine-dark: var(--wp--preset--color--berry-dark);
	--ribbon: var(--wp--preset--color--gold);
	--kraft: var(--wp--preset--color--kraft);
	--kraft-light: var(--wp--preset--color--blush);
	--mint: var(--wp--preset--color--soft);
	--line: var(--wp--preset--color--line);
	--ink: var(--wp--preset--color--ink);
	--muted: var(--wp--preset--color--muted);
}

:where(body) { -webkit-font-smoothing: antialiased; }
img { height: auto; max-width: 100%; }

/* ---------- Header ---------- */
.gsb-header { position: sticky; top: 0; z-index: 50; }
.gsb-header .wp-block-search { flex: 1 1 220px; max-width: 440px; min-width: 0; box-sizing: border-box; }
.gsb-header .wp-block-search__inside-wrapper { box-sizing: border-box; width: 100%; }
.gsb-header .wp-block-search__inside-wrapper { border: 2px solid var(--ink); border-radius: 999px; padding: 2px; background: #fff; }
.gsb-header .wp-block-search__input { border: 0; min-width: 0; padding: .5rem .9rem; background: transparent; }
.gsb-header .wp-block-search__button { border-radius: 999px; margin: 0; background: var(--ink); color: #fff; padding: .45rem 1.1rem; }
.gsb-header .wp-block-navigation a { padding: .2rem 0; border-bottom: 2px solid transparent; }
.gsb-header .wp-block-navigation a:hover { border-bottom-color: var(--ribbon); }
@media (max-width: 781px) {
	.gsb-header .wp-block-search { order: 10; flex-basis: 100%; max-width: none; }
}

/* ---------- Hero: headline left, gift-tag finder right ---------- */
.gsb-hero { align-items: center !important; }
.gsb-hero h1 { font-size: clamp(2.3rem, 5.6vw, 4.25rem); text-wrap: balance; margin: 0; }
.gsb-hero .gsb-lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 34ch; text-wrap: pretty; }
.gsb-promises { margin-top: 1.25rem !important; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 0; padding: 0; list-style: none; font-size: .95rem; font-weight: 600; }
.gsb-promises li { display: flex; align-items: center; gap: .45rem; }
.gsb-promises svg { width: 18px; height: 18px; flex: none; color: var(--pine); }

/* The gift tag. The punched hole and string are pure CSS. */
.gsb-tag {
	position: relative;
	background: var(--kraft-light);
	background-image: radial-gradient(rgba(120, 85, 45, .08) 1px, transparent 1px);
	background-size: 6px 6px;
	border-radius: 18px 18px 18px 18px;
	padding: 2.75rem clamp(1.25rem, 3vw, 2.25rem) 1.75rem;
	box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 18px 40px -18px rgba(60, 40, 20, .45);
	transform: rotate(-1.5deg);
	max-width: 460px;
	margin-inline: auto;
}
.gsb-tag::before { /* punched hole */
	content: ""; position: absolute; top: 16px; left: 50%; width: 18px; height: 18px; margin-left: -9px;
	border-radius: 50%; background: #fff; box-shadow: inset 0 1px 2px rgba(0,0,0,.25);
}
.gsb-tag::after { /* string */
	content: ""; position: absolute; top: -46px; left: 50%; width: 2px; height: 70px; margin-left: -1px;
	background: var(--ribbon); transform: rotate(8deg); transform-origin: bottom center; border-radius: 2px;
}
.gsb-tag .gsb-tag-title { font-family: var(--wp--preset--font-family--display); font-weight: 800; font-size: 1.35rem; margin: 0 0 1rem; text-align: center; }
@media (prefers-reduced-motion: no-preference) {
	.gsb-tag { animation: gsb-swing 1.4s ease-out 1; transform-origin: 50% -30px; }
	@keyframes gsb-swing { 0% { transform: rotate(5deg); } 45% { transform: rotate(-3.5deg); } 75% { transform: rotate(-1deg); } 100% { transform: rotate(-1.5deg); } }
}

/* ---------- Gift finder (works inside the tag and on its own page) ---------- */
.gsb-finder { display: flex; flex-wrap: wrap; gap: .85rem; align-items: flex-end; margin: 0 0 1.5rem; }
.gsb-finder label { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; font-weight: 700; flex: 1 1 170px; }
.gsb-finder select { font: inherit; font-weight: 600; padding: .75rem .85rem; border: 2px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); }
.gsb-finder button { font: inherit; font-weight: 800; padding: .85rem 1.5rem; border: 0; border-radius: 999px; background: var(--pine); color: #fff; cursor: pointer; flex: 1 1 100%; }
.gsb-finder button:hover { background: var(--pine-dark); }
.gsb-tag .gsb-finder { flex-direction: column; align-items: stretch; margin: 0; }
.gsb-tag .gsb-finder label { flex-direction: row; align-items: center; gap: .75rem; flex: none; font-family: var(--wp--preset--font-family--display); font-size: 1.15rem; }
.gsb-tag .gsb-finder label > span { width: 4.4rem; flex: none; white-space: nowrap; }
.gsb-tag .gsb-finder select { flex: 1; border-width: 0 0 2px; border-radius: 0; background: transparent; padding: .45rem .2rem; font-size: 1.05rem; }

/* ---------- Product grids ---------- */
.gsb-products ul.products { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1.75rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.gsb-products ul.products::before, .gsb-products ul.products::after { display: none !important; }
.gsb-products ul.products li.product { width: auto !important; margin: 0 !important; float: none !important; display: flex; flex-direction: column; gap: .35rem; position: relative; }
.gsb-products ul.products li.product a img { border-radius: 14px; aspect-ratio: 1; object-fit: cover; background: var(--mint); margin: 0 0 .4rem !important; transition: transform .25s ease; }
.gsb-products ul.products li.product a:hover img { transform: scale(1.03); }
.gsb-products ul.products li.product .woocommerce-loop-product__title { font-family: var(--wp--preset--font-family--system) !important; font-size: .95rem !important; font-weight: 600; line-height: 1.35; padding: 0 !important; color: var(--ink); }
.gsb-products ul.products li.product .price { color: var(--ink) !important; font-weight: 800; font-size: 1.1rem !important; }
.gsb-products ul.products li.product .price del { color: var(--muted); font-weight: 400; font-size: .85em; }
.gsb-products ul.products li.product .price ins { color: var(--ribbon); text-decoration: none; }
.gsb-products ul.products li.product .button { margin-top: auto !important; border-radius: 999px; text-align: center; background: #fff; color: var(--pine); border: 2px solid var(--pine); font-weight: 800; }
.gsb-products ul.products li.product .button:hover { background: var(--pine); color: #fff; }
.gsb-products .onsale, .woocommerce span.onsale { background: var(--ribbon) !important; color: #fff; border-radius: 999px !important; min-height: 0 !important; min-width: 0 !important; line-height: 1 !important; padding: .4rem .65rem !important; font-size: .75rem; font-weight: 800; top: .6rem !important; left: .6rem !important; right: auto !important; margin: 0 !important; }

/* ---------- Recipient tags ---------- */
.gsb-recipients { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 1rem; list-style: none; margin: 0; padding: 0; }
.gsb-recipients a {
	position: relative; display: flex; flex-direction: column; gap: .2rem; min-height: 120px; padding: 2.1rem 1rem 1rem;
	border-radius: 14px; background: var(--kraft-light); color: var(--ink); text-decoration: none;
	font-family: var(--wp--preset--font-family--display); font-weight: 800; font-size: 1.1rem; overflow: hidden;
}
.gsb-recipients a::before { content: ""; position: absolute; top: .7rem; left: 1rem; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: inset 0 1px 2px rgba(0,0,0,.25); }
.gsb-recipients a span { font-family: var(--wp--preset--font-family--system); font-weight: 500; font-size: .85rem; color: var(--muted); }
.gsb-recipients a img { position: absolute; right: -12px; bottom: -12px; width: 70px; height: 70px; object-fit: cover; border-radius: 12px; transform: rotate(8deg); box-shadow: 0 6px 16px -6px rgba(0,0,0,.35); }
.gsb-recipients a.has-img { padding-right: 58px; }
.gsb-recipients a:hover, .gsb-recipients a:focus-visible { background: var(--kraft); }

/* ---------- Budget ribbons ---------- */
.gsb-chips { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; margin: 0; padding: 0; }
.gsb-chips a { display: inline-block; padding: .65rem 1.2rem; border-radius: 999px; background: #fff; border: 2px solid var(--ink); color: var(--ink); text-decoration: none; font-weight: 800; font-size: .95rem; }
.gsb-chips a:hover, .gsb-chips a[aria-current="page"] { background: var(--ribbon); border-color: var(--ribbon); color: #fff; }

/* ---------- How it works (a real sequence, so it is numbered) ---------- */
.gsb-steps { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.gsb-steps li { counter-increment: step; position: relative; padding-top: 3.2rem; }
.gsb-steps li::before { content: counter(step); position: absolute; top: 0; left: 0; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 50%; background: var(--pine); color: #fff; font-weight: 800; font-family: var(--wp--preset--font-family--display); }
.gsb-steps strong { display: block; font-family: var(--wp--preset--font-family--display); font-size: 1.15rem; margin-bottom: .25rem; }
.gsb-steps p { margin: 0; color: var(--muted); }

/* ---------- FAQ ---------- */
.gsb-faq details { border-bottom: 1px solid var(--line); padding: 1.1rem 0; }
.gsb-faq summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.gsb-faq summary::-webkit-details-marker { display: none; }
.gsb-faq summary::after { content: "+"; font-weight: 800; font-size: 1.3rem; line-height: 1; color: var(--pine); }
.gsb-faq details[open] summary::after { content: "−"; }
.gsb-faq details p { margin: .6rem 0 0; color: var(--muted); max-width: 70ch; }

/* ---------- Product page extras from the plugin ---------- */
.gsb-trust { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem 1rem; list-style: none; margin: 1.25rem 0; padding: 1rem; border-radius: 14px; background: var(--mint); font-size: .9rem; font-weight: 600; }
.gsb-trust li { display: flex; gap: .5rem; align-items: center; }
.gsb-trust svg { width: 18px; height: 18px; flex: none; color: var(--pine); }
.gsb-for { margin-top: .75rem; font-size: .95rem; }
.gsb-for a { font-weight: 700; }
.gsb-delivery { border-radius: 12px; border-left-color: var(--pine) !important; background: var(--mint) !important; }
.gsb-sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: none; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -12px rgba(0,0,0,.2); }
.gsb-sticky-cta .gsb-sticky-price { font-weight: 800; font-size: 1.1rem; }
.gsb-sticky-cta button { font: inherit; font-weight: 800; border: 0; border-radius: 999px; padding: .8rem 1.4rem; background: var(--pine); color: #fff; }
@media (max-width: 781px) { .gsb-sticky-cta.is-visible { display: flex; } }

/* WooCommerce single product buttons in our colours */
.single-product .single_add_to_cart_button, .wc-block-components-button:not(.is-link) { background: var(--pine) !important; color: #fff !important; border-radius: 999px !important; font-weight: 800 !important; }
.single-product .product_title { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
.single-product .price { color: var(--ink); font-weight: 800; }

/* ---------- Breadcrumbs ---------- */
.gsb-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: 0 0 1rem; padding: 0; font-size: .875rem; color: var(--muted); }
.gsb-breadcrumbs li + li::before { content: "/"; margin-right: .35rem; color: var(--line); }
.gsb-breadcrumbs a { color: var(--muted); }

.gsb-guide { max-width: 68ch; }
.gsb-guide h2 { font-size: 1.5rem; margin-bottom: .75rem; }
.gsb-guide p { color: var(--muted); }

/* ---------- Footer ---------- */
.gsb-payments { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.gsb-payments li { font-size: .75rem; font-weight: 700; padding: .3rem .55rem; border-radius: 6px; background: rgba(255,255,255,.1); }

/* ---------- Small screens (kept last so it wins over the base rules) ---------- */
@media (max-width: 600px) {
	.gsb-products ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem .85rem; }
	.gsb-products ul.products li.product .button { padding: .55rem .5rem; font-size: .85rem; }
	.gsb-recipients { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
	.gsb-recipients a { min-height: 96px; font-size: 1rem; }
	.gsb-tag { transform: none; animation: none; margin-top: 1.5rem; }
	.gsb-tag::after { top: -22px; height: 40px; }
}


/* Focus visibility for keyboard users */
:where(a, button, input, select, summary):focus-visible { outline: 3px solid var(--ribbon); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- Focused checkout ---------- */
.gsb-co-header .wp-block-site-title { font-size: 1.35rem; margin: 0; }
.gsb-co-secure { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-weight: 700; color: var(--pine); font-size: .95rem; }
.gsb-co-back { margin: 0; font-size: .9rem; }
.gsb-co-back a { color: inherit; }
@media (max-width: 600px) { .gsb-co-secure span { display: none; } }
.gsb-co-main .wc-block-checkout { margin-top: 0; }
.gsb-co-footer a { color: inherit; }
.wc-block-components-checkout-place-order-button { min-height: 56px; font-size: 1.05rem !important; }
.wc-block-components-text-input input, .wc-block-components-combobox .components-combobox-control__input, .wc-blocks-components-select__select { border-radius: 10px !important; }
.wc-block-checkout__sidebar .wc-block-components-order-summary-item__image img { border-radius: 8px; }

/* Social links and category menu */
.gsb-follow{font-size:.9rem;margin-top:.75rem}.gsb-follow a{color:inherit;text-decoration:underline}
.gsb-header .wp-block-navigation__submenu-container{border-radius:12px;padding:.4rem 0;box-shadow:0 10px 30px rgba(0,0,0,.12)}
.gsb-header .wp-block-navigation__submenu-container a{padding:.35rem 1rem}

/* ---------- Shop by who it's for: round photo row ---------- */
.gsb-people { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 1.25rem .75rem; list-style: none; margin: 0; padding: 0; }
.gsb-people a { display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; color: var(--ink); gap: .2rem; }
.gsb-people__img { display: block; width: 100%; max-width: 132px; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--kraft-light); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--kraft); transition: transform .2s ease, box-shadow .2s ease; margin-bottom: .55rem; }
.gsb-people__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gsb-people__name { font-weight: 800; font-size: 1rem; line-height: 1.2; }
.gsb-people__count { font-size: .8rem; color: var(--muted); }
.gsb-people a:hover .gsb-people__img, .gsb-people a:focus-visible .gsb-people__img { transform: translateY(-3px); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--pine); }
.gsb-people a:focus-visible { outline: none; }
.gsb-people a:focus-visible .gsb-people__name { text-decoration: underline; }

/* ---------- Shop by category: photo cards ---------- */
.gsb-catgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; list-style: none; margin: 0; padding: 0; }
.gsb-catgrid a { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.gsb-catgrid__img { display: block; aspect-ratio: 4 / 3; background: var(--kraft-light); overflow: hidden; }
.gsb-catgrid__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.gsb-catgrid__text { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; padding: .8rem .95rem .9rem; }
.gsb-catgrid__name { font-weight: 800; font-size: 1rem; line-height: 1.25; }
.gsb-catgrid__count { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.gsb-catgrid a:hover, .gsb-catgrid a:focus-visible { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(0,0,0,.45); border-color: var(--kraft); outline: none; }
.gsb-catgrid a:hover img { transform: scale(1.04); }

@media (max-width: 1000px) {
	.gsb-catgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 781px) {
	/* One swipeable row of people on phones. */
	.gsb-people { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: .9rem; padding: .4rem 16px .6rem; margin: 0 -16px; scrollbar-width: none; }
	.gsb-people::-webkit-scrollbar { display: none; }
	.gsb-people li { flex: 0 0 92px; scroll-snap-align: start; }
	.gsb-people__name { font-size: .9rem; }
	.gsb-catgrid { gap: .6rem; }
	.gsb-catgrid a { border-radius: 14px; }
	.gsb-catgrid__text { flex-direction: column; gap: .1rem; padding: .55rem .6rem .65rem; }
	.gsb-catgrid__name { font-size: .85rem; }
	.gsb-catgrid__count { font-size: .72rem; }
	.gsb-catgrid__img { aspect-ratio: 1; }
}
