/* ==========================================================================
   Grandpa's Garden — design system + theme components
   Change the brand in one place: the variables below.
   ========================================================================== */

:root {
	--gg-forest: #173f27;      /* deep green — headings, dark sections */
	--gg-green: #1f6b3a;       /* primary — buttons, links */
	--gg-green-hover: #175a30;
	--gg-leaf: #4f9a3a;        /* accents, success */
	--gg-spice: #a4511f;       /* nutmeg brown — sale, highlights */
	--gg-gold: #c9a24b;        /* premium accent */
	--gg-cream: #faf6ec;       /* soft section background */
	--gg-sand: #efe6d0;        /* borders on cream, tiles */
	--gg-ink: #1d2520;         /* body text */
	--gg-muted: #5d6a61;       /* secondary text */
	--gg-line: #e4e0d4;        /* borders */
	--gg-white: #ffffff;
	--gg-danger: #b3261e;

	--gg-font-head: "Fraunces", Georgia, "Times New Roman", serif;
	--gg-font-body: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	--gg-radius: 14px;
	--gg-radius-sm: 10px;
	--gg-radius-pill: 999px;
	--gg-shadow: 0 1px 2px rgba(23, 63, 39, .06), 0 8px 24px rgba(23, 63, 39, .08);
	--gg-shadow-lg: 0 24px 60px rgba(23, 63, 39, .18);
	--gg-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
body.gg-theme {
	font-family: var(--gg-font-body);
	color: var(--gg-ink);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
body.gg-theme a { color: var(--gg-green); }
body.gg-theme a:hover { color: var(--gg-green-hover); }

body.gg-theme .woocommerce h1,
body.gg-theme .woocommerce h2,
body.gg-theme .woocommerce h3,
body.gg-theme .woocommerce-page h1.page-title,
body.gg-theme .page-header .entry-title,
body.gg-theme .product_title {
	font-family: var(--gg-font-head);
	color: var(--gg-forest);
	letter-spacing: -.01em;
	font-weight: 600;
}

:where(body.gg-theme) :focus-visible {
	outline: 2px solid var(--gg-gold);
	outline-offset: 2px;
}

.gg-icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: middle; }

/* ---------- Buttons ---------- */
.gg-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .55em;
	padding: .9em 1.6em;
	border-radius: var(--gg-radius-pill);
	background: var(--gg-green); color: #fff !important;
	font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none;
	border: 0; cursor: pointer;
	transition: background .2s, transform .2s var(--gg-ease), box-shadow .2s;
}
.gg-btn:hover { background: var(--gg-green-hover); transform: translateY(-1px); box-shadow: var(--gg-shadow); }
.gg-btn--wa { background: #1fa855; }
.gg-btn--wa:hover { background: #178a45; }

/* ---------- Trust badges ---------- */
.gg-trust { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.gg-trust__item { display: flex; align-items: center; gap: 12px; margin: 0; }
.gg-trust__icon {
	display: grid; place-items: center; flex: none;
	width: 42px; height: 42px; border-radius: 50%;
	background: var(--gg-cream); color: var(--gg-green);
	border: 1px solid var(--gg-sand);
}
.gg-trust__icon .gg-icon { width: 20px; height: 20px; }
.gg-trust__body { display: flex; flex-direction: column; line-height: 1.3; }
.gg-trust__body strong { font-size: 14px; color: var(--gg-forest); font-weight: 600; }
.gg-trust__body small { font-size: 12.5px; color: var(--gg-muted); }

.gg-trust--compact {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin: 22px 0 6px;
	padding: 16px;
	background: var(--gg-cream);
	border: 1px solid var(--gg-sand);
	border-radius: var(--gg-radius);
}
.gg-trust--compact .gg-trust__icon { background: #fff; }
.gg-trust--grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.gg-trust--grid .gg-trust__icon { width: 54px; height: 54px; }
.gg-trust--grid .gg-trust__icon .gg-icon { width: 24px; height: 24px; }
.gg-trust--grid .gg-trust__body strong { font-size: 15.5px; }
@media (max-width: 900px) { .gg-trust--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .gg-trust--compact { grid-template-columns: 1fr; } }

/* ---------- Free-shipping bar ---------- */
.gg-ship-bar { margin: 0 0 20px; padding: 14px 16px; border-radius: var(--gg-radius-sm); background: var(--gg-cream); border: 1px solid var(--gg-sand); }
.gg-ship-bar--off { display: none; }
.gg-ship-bar__msg { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14px; color: var(--gg-ink); }
.gg-ship-bar__msg .gg-icon { color: var(--gg-green); }
.gg-ship-bar__msg strong { color: var(--gg-green); }
.gg-ship-bar__track { height: 8px; border-radius: 8px; background: #fff; border: 1px solid var(--gg-sand); overflow: hidden; }
.gg-ship-bar__track span { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--gg-leaf), var(--gg-green)); transition: width .5s var(--gg-ease); }
.gg-ship-bar.is-done { background: #eef7ea; border-color: #cfe6c6; }

/* ---------- Header cart icon [gg_cart_icon] ---------- */
.gg-cart-icon { position: relative; display: inline-flex; align-items: center; gap: 8px; color: var(--gg-forest) !important; text-decoration: none; font-weight: 500; }
.gg-cart-icon .gg-icon { width: 24px; height: 24px; }
.gg-cart-icon .gg-cart-count { position: absolute; top: -8px; left: 14px; }
.gg-cart-count {
	display: inline-grid; place-items: center;
	min-width: 20px; height: 20px; padding: 0 6px;
	border-radius: var(--gg-radius-pill);
	background: var(--gg-spice); color: #fff;
	font: 600 11px/1 var(--gg-font-body);
}
.gg-cart-count[data-count="0"] { background: var(--gg-muted); }

/* ---------- Floating cart button ---------- */
.gg-cart-fab {
	position: fixed; right: 20px; bottom: 20px; z-index: 9990;
	width: 58px; height: 58px; border-radius: 50%;
	display: grid; place-items: center;
	background: var(--gg-green); color: #fff; border: 0; cursor: pointer;
	box-shadow: var(--gg-shadow-lg);
	transition: transform .2s var(--gg-ease), background .2s, bottom .3s var(--gg-ease);
}
.gg-cart-fab:hover { background: var(--gg-green-hover); transform: scale(1.05); }
.gg-cart-fab .gg-icon { width: 26px; height: 26px; }
.gg-cart-fab .gg-cart-count { position: absolute; top: -2px; right: -2px; border: 2px solid #fff; height: 24px; min-width: 24px; }
.gg-cart-fab .gg-cart-count[data-count="0"] { display: none; }
body.gg-sticky-atc-on .gg-cart-fab,
body.gg-sticky-atc-on .gg-wa-float { bottom: 96px; }

/* ---------- Slide-out drawer ---------- */
.gg-drawer-overlay {
	position: fixed; inset: 0; z-index: 99998;
	background: rgba(17, 33, 23, .45);
	opacity: 0; transition: opacity .3s;
	backdrop-filter: blur(2px);
}
body.gg-drawer-open .gg-drawer-overlay { opacity: 1; }
body.gg-drawer-open { overflow: hidden; }

body.gg-theme .gg-drawer {
	position: fixed; top: 0; right: 0; bottom: 0; z-index: 99999;
	width: min(420px, 100vw);
	display: flex; flex-direction: column;
	background: #fff; box-shadow: var(--gg-shadow-lg);
	transform: translateX(100%); transition: transform .35s var(--gg-ease);
	visibility: hidden;
	outline: none;
}
body.gg-drawer-open .gg-drawer { transform: none; visibility: visible; }
.gg-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--gg-line); }
.gg-drawer__head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font: 600 22px/1.2 var(--gg-font-head); color: var(--gg-forest); }
.gg-drawer__close { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid var(--gg-line); background: #fff; color: var(--gg-ink); cursor: pointer; }
.gg-drawer__close:hover { background: var(--gg-cream); color: var(--gg-ink); }
body.gg-theme .gg-drawer > .gg-ship-bar { margin: 16px 22px 0; }
.gg-drawer__body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
body.gg-theme .gg-drawer .widget_shopping_cart_content { display: flex; flex-direction: column; flex: 1; }

/* Mini cart items */
body.gg-theme .gg-drawer .woocommerce-mini-cart { list-style: none; margin: 0; padding: 8px 22px; flex: 1; }
body.gg-theme .gg-drawer .woocommerce-mini-cart-item {
	position: relative; display: grid; grid-template-columns: 72px 1fr; column-gap: 14px;
	padding: 16px 32px 16px 0 !important; margin: 0; border-bottom: 1px solid var(--gg-line);
	font-size: 14px; line-height: 1.4; transition: opacity .2s;
}
body.gg-theme .gg-drawer .woocommerce-mini-cart-item.is-removing { opacity: .4; }
body.gg-theme .gg-drawer .woocommerce-mini-cart-item > a:not(.remove) { grid-row: span 2; display: contents; color: var(--gg-forest); font-weight: 600; text-decoration: none; }
body.gg-theme .gg-drawer .woocommerce-mini-cart-item img {
	grid-row: 1 / span 3; width: 72px !important; height: 72px !important; object-fit: contain; padding: 4px; margin: 0 !important; float: none !important;
	border-radius: var(--gg-radius-sm); background: var(--gg-cream); border: 1px solid var(--gg-line);
}
body.gg-theme .gg-drawer .woocommerce-mini-cart-item .quantity { grid-column: 2; color: var(--gg-muted); font-size: 13px; margin-top: 4px; }
body.gg-theme .gg-drawer .woocommerce-mini-cart-item .quantity .amount { color: var(--gg-ink); font-weight: 600; }
body.gg-theme .gg-drawer .woocommerce-mini-cart-item .remove {
	position: absolute; top: 14px; right: 0; left: auto !important;
	display: grid !important; place-items: center; width: 26px; height: 26px; border-radius: 50%;
	color: var(--gg-muted) !important; background: var(--gg-cream); font-size: 18px; line-height: 1; text-decoration: none;
}
body.gg-theme .gg-drawer .woocommerce-mini-cart-item .remove:hover { background: #fde8e6; color: var(--gg-danger) !important; }
body.gg-theme .gg-drawer .woocommerce-mini-cart__total {
	display: flex; justify-content: space-between; align-items: center;
	margin: 0; padding: 18px 22px 10px; border-top: 1px solid var(--gg-line); font-size: 16px;
}
body.gg-theme .gg-drawer .woocommerce-mini-cart__total strong { font-weight: 500; color: var(--gg-muted); }
body.gg-theme .gg-drawer .woocommerce-mini-cart__total .amount { font: 700 20px/1 var(--gg-font-body); color: var(--gg-forest); }
body.gg-theme .gg-drawer .woocommerce-mini-cart__buttons { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin: 0; padding: 6px 22px 22px; }
body.gg-theme .gg-drawer .woocommerce-mini-cart__buttons .button {
	margin: 0 !important; text-align: center; padding: 14px 10px !important; border-radius: var(--gg-radius-pill) !important;
	background: #fff !important; color: var(--gg-forest) !important; border: 1.5px solid var(--gg-forest) !important; font-weight: 600 !important;
}
body.gg-theme .gg-drawer .woocommerce-mini-cart__buttons .button.checkout { background: var(--gg-green) !important; border-color: var(--gg-green) !important; color: #fff !important; }
body.gg-theme .gg-drawer .woocommerce-mini-cart__buttons .button.checkout:hover { background: var(--gg-green-hover) !important; }
body.gg-theme .gg-drawer .woocommerce-mini-cart__empty-message { margin: 40px 22px 14px; text-align: center; color: var(--gg-muted); font-size: 15px; }
.gg-drawer__empty-cta { text-align: center; margin: 0 22px; }
.gg-drawer__empty-cta .button { border-radius: var(--gg-radius-pill) !important; background: var(--gg-green) !important; color: #fff !important; padding: 12px 26px !important; }

/* ---------- WhatsApp ---------- */
.gg-wa-float {
	position: fixed; left: 20px; bottom: 20px; z-index: 9990;
	display: inline-flex; align-items: center; gap: 10px;
	padding: 12px 18px 12px 14px; border-radius: var(--gg-radius-pill);
	background: #1fa855; color: #fff !important; text-decoration: none; font-weight: 600; font-size: 14px;
	box-shadow: var(--gg-shadow-lg); transition: transform .2s var(--gg-ease), bottom .3s var(--gg-ease);
}
.gg-wa-float:hover { transform: translateY(-2px); background: #178a45; }
.gg-wa-float .gg-icon { width: 24px; height: 24px; }
@media (max-width: 600px) { .gg-wa-float { padding: 14px; } .gg-wa-float span { display: none; } }

.gg-wa-inline { display: inline-flex; align-items: center; gap: 8px; margin: 6px 0 18px; font-size: 14px; font-weight: 500; color: #178a45 !important; text-decoration: none; }
.gg-wa-inline:hover { text-decoration: underline; }

/* ---------- Sticky add to cart ---------- */
.gg-sticky-atc {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 9980;
	background: rgba(255, 255, 255, .97); backdrop-filter: blur(8px);
	border-top: 1px solid var(--gg-line); box-shadow: 0 -8px 30px rgba(23, 63, 39, .1);
	transform: translateY(110%); transition: transform .3s var(--gg-ease);
}
.gg-sticky-atc.is-visible { transform: none; }
.gg-sticky-atc__inner { max-width: 1140px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.gg-sticky-atc__product { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gg-sticky-atc__product img { width: 52px; height: 52px; object-fit: cover; border-radius: var(--gg-radius-sm); background: var(--gg-cream); }
.gg-sticky-atc__product strong { display: block; color: var(--gg-forest); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gg-sticky-atc__price { font-size: 14px; }
.gg-sticky-atc__price del { color: var(--gg-muted); margin-right: 4px; }
.gg-sticky-atc__price ins { text-decoration: none; font-weight: 700; color: var(--gg-spice); }
.gg-sticky-atc__btn.button { display: inline-flex !important; align-items: center; gap: 8px; white-space: nowrap; }
@media (max-width: 600px) {
	.gg-sticky-atc__product img { display: none; }
	.gg-sticky-atc__product strong { font-size: 14px; max-width: 46vw; }
}

/* ---------- Category tiles [gg_category_tiles] ---------- */
.gg-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 20px; }
.gg-cat {
	display: flex; flex-direction: column; overflow: hidden;
	border-radius: var(--gg-radius); background: #fff; border: 1px solid var(--gg-line);
	text-decoration: none; transition: transform .25s var(--gg-ease), box-shadow .25s;
}
.gg-cat:hover { transform: translateY(-4px); box-shadow: var(--gg-shadow); }
.gg-cat__img { display: block; aspect-ratio: 1; background: var(--gg-cream); overflow: hidden; }
.gg-cat__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--gg-ease); }
.gg-cat:hover .gg-cat__img img { transform: scale(1.06); }
.gg-cat__body { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px 16px; }
.gg-cat__body strong { color: var(--gg-forest); font: 600 17px/1.25 var(--gg-font-head); }
.gg-cat__body small { color: var(--gg-muted); font-size: 13px; }

.gg-admin-hint { padding: 12px 16px; border: 1px dashed var(--gg-gold); border-radius: var(--gg-radius-sm); background: #fffaf0; color: var(--gg-ink); font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
	.gg-drawer, .gg-sticky-atc, .gg-cat, .gg-cat__img img, .gg-btn { transition: none !important; }
}
