/* =========================================================
   GHN Cart Drawer – Design Tokens
   ========================================================= */
:root {
	--ghn-color-primary:       #2d5a27;
	--ghn-color-primary-dark:  #1a3a18;
	--ghn-color-card-bg:       #f5f5f0;
	--ghn-color-footer-bg:     #ededea;
	--ghn-color-border:        #e0e0d8;
	--ghn-color-text:          #1a1a1a;
	--ghn-color-text-muted:    #6b6b60;
	--ghn-color-overlay:       rgba(0, 0, 0, 0.50);
	--ghn-color-btn-checkout:  #1a3a18;
	--ghn-color-price-regular: #999990;
	--ghn-color-badge-bg:      #2d5a27;
	--ghn-radius-card:         12px;
	--ghn-radius-pill:         999px;
	--ghn-drawer-width:        420px;
	--ghn-drawer-z:            999999;
	--ghn-transition:          0.3s ease;
}

/* =========================================================
   Overlay
   ========================================================= */
#ghn-cart-overlay {
	position: fixed;
	inset: 0;
	background: var(--ghn-color-overlay);
	z-index: calc(var(--ghn-drawer-z) - 1);
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--ghn-transition);
}

#ghn-cart-overlay.is-visible {
	opacity: 1;
	pointer-events: all;
}

/* =========================================================
   Drawer Panel
   ========================================================= */
.ghn-cart-drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: var(--ghn-drawer-width);
	max-width: 100vw;
	background: #fff;
	z-index: var(--ghn-drawer-z);
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform var(--ghn-transition);
	box-shadow: -4px 0 32px rgba(0, 0, 0, 0.12);
}

.ghn-cart-drawer.is-open {
	transform: translateX(0);
}

/* Scroll lock */
body.ghn-drawer-open {
	overflow: hidden;
}

/* =========================================================
   Header
   ========================================================= */
.ghn-cart-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 22px 20px 18px;
	border-bottom: 1px solid var(--ghn-color-border);
	flex-shrink: 0;
}

.ghn-cart-drawer__title {
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--ghn-color-text);
	margin: 0;
	line-height: 1;
}

.ghn-cart-drawer__close {
	background: none;
	border: none;
	cursor: pointer;
	padding: 6px;
	color: var(--ghn-color-text-muted);
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: color 0.2s, background 0.2s;
}

.ghn-cart-drawer__close:hover {
	color: var(--ghn-color-text);
	background: var(--ghn-color-card-bg);
}

/* =========================================================
   Shipping Meter
   ========================================================= */
.ghn-shipping-meter {
	padding: 14px 20px 12px;
	border-bottom: 1px solid var(--ghn-color-border);
	flex-shrink: 0;
}

.ghn-shipping-meter__header {
	font-size: 0.82rem;
	color: var(--ghn-color-text);
	margin: 0 0 8px;
}

.ghn-shipping-meter__bar {
	height: 6px;
	background: var(--ghn-color-border);
	border-radius: var(--ghn-radius-pill);
	overflow: hidden;
	margin-bottom: 8px;
}

.ghn-shipping-meter__fill {
	height: 100%;
	background: var(--ghn-color-primary);
	border-radius: var(--ghn-radius-pill);
	transition: width 0.5s ease;
}

.ghn-shipping-meter__status {
	font-size: 0.82rem;
	color: var(--ghn-color-text-muted);
	margin: 0;
}

.ghn-shipping-meter__status.is-reached {
	color: var(--ghn-color-primary);
	font-weight: 600;
}

/* =========================================================
   Items Scroll Area
   ========================================================= */
.ghn-cart-drawer__items {
	flex: 1;
	overflow-y: auto;
	padding: 14px 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	-webkit-overflow-scrolling: touch;
}

/* =========================================================
   Empty Cart
   ========================================================= */
.ghn-cart-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	padding: 40px 20px;
	text-align: center;
	color: var(--ghn-color-text-muted);
}

/* =========================================================
   Cart Item Card
   ========================================================= */
.ghn-cart-item {
	display: flex;
	gap: 12px;
	background: var(--ghn-color-card-bg);
	border-radius: var(--ghn-radius-card);
	padding: 12px;
	position: relative;
	transition: opacity 0.2s;
}

.ghn-cart-item.is-loading {
	opacity: 0.5;
	pointer-events: none;
}

/* Image */
.ghn-cart-item__image {
	flex-shrink: 0;
	width: 80px;
	height: 80px;
	border-radius: 8px;
	overflow: hidden;
	background: #e8e8e2;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ghn-cart-item__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Details */
.ghn-cart-item__details {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
}

/* Name row */
.ghn-cart-item__name-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
}

.ghn-cart-item__name {
	font-weight: 700;
	font-size: 0.875rem;
	color: var(--ghn-color-text);
	line-height: 1.3;
	flex: 1;
	min-width: 0;
}

.ghn-cart-item__name a {
	color: inherit;
	text-decoration: none;
}

.ghn-cart-item__name a:hover {
	text-decoration: underline;
}

/* Meta (variation data) */
.ghn-cart-item__meta {
	font-size: 0.78rem;
	color: var(--ghn-color-text-muted);
	line-height: 1.4;
}

.ghn-cart-item__meta dl,
.ghn-cart-item__meta dt,
.ghn-cart-item__meta dd {
	margin: 0;
	display: inline;
}

.ghn-cart-item__meta dd::after {
	content: '';
	display: block;
}

/* Subscription */
.ghn-cart-item__subscription {
	margin-top: 2px;
}

.ghn-subscription-badge {
	display: inline-block;
	font-size: 0.75rem;
	border-radius: var(--ghn-radius-pill);
	border: 1px solid var(--ghn-color-primary);
	color: var(--ghn-color-primary);
	padding: 3px 12px;
	white-space: nowrap;
}

/* Subscription select (variable subscription dropdown) */
.ghn-subscription-select-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.ghn-subscription-select {
	appearance: none;
	-webkit-appearance: none;
	background: #f0f0eb;
	border: 1px solid var(--ghn-color-border);
	border-radius: var(--ghn-radius-pill);
	padding: 5px 32px 5px 14px;
	font-size: 0.78rem;
	color: var(--ghn-color-text);
	cursor: pointer;
	font-family: inherit;
	transition: border-color 0.2s;
	min-width: 160px;
}

.ghn-subscription-select:focus {
	outline: 2px solid var(--ghn-color-primary);
	outline-offset: 2px;
	border-color: var(--ghn-color-primary);
}

.ghn-subscription-select-chevron {
	position: absolute;
	right: 10px;
	pointer-events: none;
	color: var(--ghn-color-text-muted);
	display: flex;
	align-items: center;
}

/* Bottom row: qty + price */
.ghn-cart-item__bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: 4px;
}

/* Qty Control */
.ghn-qty-control {
	display: inline-flex;
	align-items: center;
	border-radius: var(--ghn-radius-pill);
	border: 1px solid var(--ghn-color-border);
	background: #fff;
	overflow: hidden;
}

.ghn-qty-control__btn {
	background: none;
	border: none;
	width: 30px;
	height: 30px;
	font-size: 1rem;
	cursor: pointer;
	color: var(--ghn-color-text);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s;
	flex-shrink: 0;
}

.ghn-qty-control__btn:hover {
	background: var(--ghn-color-card-bg);
}

.ghn-qty-control__value {
	min-width: 26px;
	text-align: center;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--ghn-color-text);
	padding: 0 2px;
	user-select: none;
}

/* Remove button */
.ghn-item__remove {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--ghn-color-text-muted);
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s;
	flex-shrink: 0;
}

.ghn-item__remove:hover {
	color: #c0392b;
}

/* Pricing */
.ghn-cart-item__pricing {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.ghn-price--regular {
	text-decoration: line-through;
	color: var(--ghn-color-price-regular);
	font-size: 0.78rem;
}

.ghn-price--badge {
	font-size: 0.72rem;
	background: var(--ghn-color-badge-bg);
	color: #fff;
	border-radius: var(--ghn-radius-pill);
	padding: 1px 6px;
	font-weight: 600;
}

.ghn-price--sale {
	font-weight: 700;
	font-size: 0.9rem;
	color: var(--ghn-color-text);
}

/* =========================================================
   Footer
   ========================================================= */
.ghn-cart-drawer__footer {
	background: var(--ghn-color-footer-bg);
	border-top: 1px solid var(--ghn-color-border);
	padding: 16px 20px 24px;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ghn-footer__row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.875rem;
	color: var(--ghn-color-text);
}

.ghn-footer__row--savings {
	color: var(--ghn-color-primary);
	font-weight: 600;
}

.ghn-footer__savings-value {
	font-weight: 600;
}

.ghn-footer__row--subtotal {
	font-weight: 700;
	font-size: 0.95rem;
}

.ghn-footer__subtotal-value {
	font-weight: 700;
}

.ghn-footer__buttons {
	display: flex;
	gap: 8px;
}

/* =========================================================
   Buttons
   ========================================================= */
.ghn-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 11px 18px;
	border-radius: var(--ghn-radius-pill);
	font-size: 0.85rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.2s, border-color 0.2s, color 0.2s;
	border: 2px solid transparent;
	line-height: 1;
	white-space: nowrap;
}

.ghn-btn--solid {
	background: var(--ghn-color-primary);
	color: #fff !important;
	border-color: var(--ghn-color-primary);
	flex: 1;
}

.ghn-btn--solid:hover {
	background: var(--ghn-color-primary-dark);
	border-color: var(--ghn-color-primary-dark);
	color: #fff !important;
}

.ghn-btn--outline {
	background: transparent;
	color: var(--ghn-color-text) !important;
	border-color: var(--ghn-color-border);
	flex: 1;
}

.ghn-btn--outline:hover {
	border-color: var(--ghn-color-text);
	background: transparent;
}

.ghn-btn--checkout {
	width: 100%;
	background: var(--ghn-color-btn-checkout);
	color: #fff !important;
	border-color: var(--ghn-color-btn-checkout);
}

.ghn-btn--checkout:hover {
	background: #0d1f0b;
	border-color: #0d1f0b;
	color: #fff !important;
}

/* =========================================================
   Coupon Section
   ========================================================= */
.ghn-coupon-section {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--ghn-color-border);
}

/* Applied coupon tags */
.ghn-applied-coupons {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.ghn-coupon-tag {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: #e8f0e5;
	border: 1px solid var(--ghn-color-primary);
	border-radius: var(--ghn-radius-pill);
	padding: 3px 8px 3px 10px;
	font-size: 0.75rem;
	color: var(--ghn-color-primary);
	font-weight: 600;
	letter-spacing: 0.02em;
}

.ghn-coupon-tag__remove {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--ghn-color-primary);
	font-size: 0.95rem;
	line-height: 1;
	padding: 0 1px;
	display: flex;
	align-items: center;
	opacity: 0.65;
	transition: opacity 0.15s;
	margin-left: 1px;
}

.ghn-coupon-tag__remove:hover {
	opacity: 1;
}

/* Coupon input form */
.ghn-coupon-form__row {
	display: flex;
	gap: 6px;
	align-items: center;
}

.ghn-coupon-form__input {
	flex: 1;
	border: 1px solid var(--ghn-color-border);
	border-radius: var(--ghn-radius-pill);
	padding: 8px 14px;
	font-size: 0.82rem;
	font-family: inherit;
	color: var(--ghn-color-text);
	background: #fff;
	transition: border-color 0.2s;
	min-width: 0;
	height: 38px;
}

.ghn-coupon-form__input:focus {
	outline: none;
	border-color: var(--ghn-color-primary);
}

.ghn-coupon-form__input::placeholder {
	color: var(--ghn-color-text-muted);
}

.ghn-coupon-form__btn {
	background: var(--ghn-color-primary);
	color: #fff;
	border: none;
	border-radius: var(--ghn-radius-pill);
	padding: 0 18px;
	font-size: 0.82rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.2s;
	flex-shrink: 0;
	height: 38px;
}

.ghn-coupon-form__btn:hover {
	background: var(--ghn-color-primary-dark);
}

.ghn-coupon-form__btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.ghn-coupon-form__message {
	font-size: 0.78rem;
	margin: 0;
	padding: 0 4px;
}

.ghn-coupon-form__message.is-error {
	color: #c0392b;
}

.ghn-coupon-form__message.is-success {
	color: var(--ghn-color-primary);
}

/* Coupon discount row in totals */
.ghn-footer__row--coupon {
	color: var(--ghn-color-primary);
}

.ghn-footer__coupon-value {
	font-weight: 600;
	color: var(--ghn-color-primary);
}

/* =========================================================
   Cart Launcher (shortcode)
   ========================================================= */
.ghn-cart-launcher {
	display: inline-flex;
	align-items: center;
}

.ghn-cart-launcher__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px 2px;
	color: #fff;
	line-height: 1;
	transition: opacity 0.2s;
	font-family: inherit;
}

.ghn-cart-launcher__btn:hover {
	opacity: 0.75;
}

/* Icon wrapper holds the SVG + count badge */
.ghn-cart-launcher__icon-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.ghn-cart-launcher__count {
	position: absolute;
	top: -6px;
	right: -8px;
	background: var(--ghn-color-primary);
	color: #fff;
	font-size: 0.6rem;
	font-weight: 700;
	line-height: 1;
	min-width: 17px;
	height: 17px;
	border-radius: var(--ghn-radius-pill);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 4px;
	font-family: sans-serif;
}

/* Price text next to the icon */
.ghn-cart-launcher__price {
	font-size: 0.9rem;
	font-weight: 600;
	white-space: nowrap;
}

.ghn-cart-launcher__price .woocommerce-Price-currencySymbol {
	font-size: inherit;
}

/* =========================================================
   Mobile
   ========================================================= */
@media (max-width: 480px) {
	:root {
		--ghn-drawer-width: 100vw;
	}

	.ghn-cart-drawer__title {
		font-size: 1.15rem;
	}
}
