/* Free Gifts for WooCommerce */
:root {
	--fgw-accent: #16a34a;
	--fgw-accent-text: #ffffff;
	--fgw-bg: #f0fdf4;
	--fgw-card: #ffffff;
	--fgw-border: #e5e7eb;
	--fgw-text: #111827;
	--fgw-muted: #6b7280;
}

.fgw-block {
	margin: 0 0 20px;
	padding: 16px;
	border: 1px solid #bbf7d0;
	border: 1px solid color-mix(in srgb, var(--fgw-accent) 30%, #fff);
	border-radius: 14px;
	background: var(--fgw-bg);
	background: linear-gradient(180deg, var(--fgw-bg), var(--fgw-card));
	width: 100%;
	box-sizing: border-box;
	color: var(--fgw-text);
}
.fgw-block *,
.fgw-modal * { box-sizing: border-box; }

.fgw-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.fgw-head__icon {
	display: inline-flex; align-items: center; justify-content: center;
	width: 42px; height: 42px; flex: 0 0 42px;
	font-size: 22px; border-radius: 50%;
	background: var(--fgw-accent); color: var(--fgw-accent-text);
	box-shadow: 0 4px 10px rgba(0, 0, 0, .18);
}
.fgw-head__title { font-size: 17px; font-weight: 700; line-height: 1.25; }
.fgw-head__sub { font-size: 13px; color: var(--fgw-muted); margin-top: 2px; }

/* Gift cards: horizontal (picture on the left, details on the right) */
.fgw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }

.fgw-card {
	position: relative;
	display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: center;
	padding: 10px; border: 2px solid var(--fgw-border); border-radius: 12px;
	background: var(--fgw-card); cursor: pointer; text-align: left;
	transition: border-color .15s, box-shadow .15s, transform .15s;
}
.fgw-card:hover {
	border-color: #86efac;
	border-color: color-mix(in srgb, var(--fgw-accent) 55%, #fff);
	box-shadow: 0 6px 16px rgba(0, 0, 0, .08); transform: translateY(-1px);
}
.fgw-card:focus-visible { outline: 3px solid var(--fgw-accent); outline-offset: 2px; }
.fgw-card.is-selected {
	border-color: var(--fgw-accent);
	box-shadow: 0 0 0 3px rgba(22, 163, 74, .18);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--fgw-accent) 22%, transparent);
}

.fgw-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }

.fgw-ribbon {
	position: absolute; top: 14px; left: 14px; z-index: 2;
	padding: 2px 7px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
	color: var(--fgw-accent-text); background: var(--fgw-accent); border-radius: 999px;
}
.fgw-check {
	position: absolute; top: 8px; right: 8px; z-index: 2;
	display: none; align-items: center; justify-content: center;
	width: 24px; height: 24px; font-size: 14px; font-weight: 700;
	color: var(--fgw-accent-text); background: var(--fgw-accent); border-radius: 50%;
}
.fgw-card.is-selected .fgw-check { display: inline-flex; }

.fgw-card__img { aspect-ratio: 1 / 1; overflow: hidden; border-radius: 8px; background: #f9fafb; }
.fgw-card__img img { display: block; width: 100%; height: 100%; object-fit: cover; margin: 0; }

.fgw-card__info { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding-right: 22px; }
.fgw-card__name { font-size: 15px; font-weight: 600; line-height: 1.3; }
.fgw-card__price { font-size: 13px; }
.fgw-card__price del { color: var(--fgw-muted); margin-right: 4px; }
.fgw-card__price strong { color: var(--fgw-accent); font-weight: 700; }

.fgw-view {
	margin-top: 4px; padding: 6px 12px; width: auto;
	font-size: 13px; font-weight: 600; line-height: 1.2;
	color: var(--fgw-accent); background: transparent; cursor: pointer;
	border: 1px solid var(--fgw-accent); border-radius: 8px;
	transition: background .15s, color .15s;
}
.fgw-view:hover { background: var(--fgw-accent); color: var(--fgw-accent-text); }

.fgw-status { margin-top: 12px; font-size: 13px; color: var(--fgw-muted); }
.fgw-status.is-active { color: var(--fgw-accent); font-weight: 600; }

/* Pop-up */
html.fgw-lock { overflow: hidden; }
.fgw-modal { position: fixed; inset: 0; z-index: 999999; display: flex; align-items: center; justify-content: center; padding: 16px; color: var(--fgw-text); }
.fgw-modal[hidden] { display: none; }
.fgw-modal__overlay { position: absolute; inset: 0; background: rgba(17, 24, 39, .6); backdrop-filter: blur(2px); }
.fgw-modal__dialog {
	position: relative; display: flex; flex-direction: column;
	width: 100%; max-width: 720px; max-height: 90vh;
	background: var(--fgw-card); border-radius: 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
	animation: fgw-pop .18s ease-out; overflow: hidden;
}
@keyframes fgw-pop { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
.fgw-modal__close {
	position: absolute; top: 10px; right: 10px; z-index: 3;
	width: 36px; height: 36px; padding: 0; font-size: 24px; line-height: 1;
	color: #111827; background: #fff; border: 1px solid #e5e7eb; border-radius: 50%; cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}
.fgw-modal__close:hover { background: #f3f4f6; }
.fgw-modal__body { padding: 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.fgw-modal__footer { padding: 14px 20px; border-top: 1px solid var(--fgw-border); background: rgba(0, 0, 0, .02); }
.fgw-modal__choose {
	width: 100%; padding: 12px 16px; font-size: 15px; font-weight: 700;
	color: var(--fgw-accent-text); background: var(--fgw-accent); border: 0; border-radius: 10px; cursor: pointer;
}
.fgw-modal__choose:hover { filter: brightness(.92); }

.fgw-d { display: grid; grid-template-columns: 240px 1fr; gap: 20px; }
.fgw-d__img img { display: block; width: 100%; height: auto; border-radius: 12px; margin: 0; }
.fgw-d__title { margin: 0 0 6px; padding-right: 36px; font-size: 20px; line-height: 1.25; color: var(--fgw-text); }
.fgw-d__price { margin-bottom: 12px; font-size: 15px; }
.fgw-d__price del { color: var(--fgw-muted); margin-right: 6px; }
.fgw-d__price strong { color: var(--fgw-accent); }
.fgw-d__short, .fgw-d__desc { font-size: 14px; line-height: 1.55; color: var(--fgw-text); }
.fgw-d__short p, .fgw-d__desc p { margin: 0 0 10px; }
.fgw-d__attrs h4 { margin: 14px 0 6px; font-size: 15px; color: var(--fgw-text); }
.fgw-d__attrs table { width: 100%; font-size: 13px; border-collapse: collapse; }
.fgw-d__attrs th, .fgw-d__attrs td { padding: 6px 8px; border-bottom: 1px solid var(--fgw-border); text-align: left; vertical-align: top; }
.fgw-d__attrs th { width: 38%; font-weight: 600; }
.fgw-d__attrs p { margin: 0; }

/* Pop-up image gallery */
.fgw-gal { min-width: 0; }
.fgw-gal__stage { position: relative; }
.fgw-gal__track {
	display: flex; overflow-x: auto; overflow-y: hidden;
	scroll-snap-type: x mandatory; scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch; scrollbar-width: none;
	border-radius: 12px; background: #f9fafb;
}
.fgw-gal__track::-webkit-scrollbar { display: none; }
.fgw-gal__track:focus-visible { outline: 3px solid var(--fgw-accent); outline-offset: 2px; }
.fgw-gal__slide {
	flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always;
	aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
}
.fgw-gal__slide img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 0; margin: 0; }

.fgw-gal__nav {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
	width: 34px; height: 34px; padding: 0; font-size: 24px; line-height: 1;
	display: flex; align-items: center; justify-content: center;
	color: #111827; background: rgba(255, 255, 255, .92); border: 1px solid #e5e7eb; border-radius: 50%;
	cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
	transition: opacity .15s;
}
.fgw-gal__nav:hover { background: #fff; }
.fgw-gal__nav[disabled] { opacity: .35; cursor: default; }
.fgw-gal__prev { left: 8px; }
.fgw-gal__next { right: 8px; }

.fgw-gal__thumbs { position: relative; display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.fgw-gal__thumb {
	flex: 0 0 52px; width: 52px; height: 52px; padding: 0; overflow: hidden;
	border: 2px solid transparent; border-radius: 8px; background: #f9fafb; cursor: pointer; opacity: .7;
	transition: border-color .15s, opacity .15s;
}
.fgw-gal__thumb:hover { opacity: 1; }
.fgw-gal__thumb.is-active { border-color: var(--fgw-accent); opacity: 1; }
.fgw-gal__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; margin: 0; }

/* Cart */
.fgw-free { color: var(--fgw-accent); }
.fgw-qty { font-weight: 600; }

@media (max-width: 600px) {
	.fgw-block { padding: 12px; }
	.fgw-grid { grid-template-columns: 1fr; gap: 10px; }
	.fgw-card { grid-template-columns: 84px minmax(0, 1fr); }
	.fgw-d { grid-template-columns: 1fr; gap: 14px; }
	.fgw-modal { padding: 10px; align-items: flex-end; }
	.fgw-modal__dialog { max-height: 92vh; border-radius: 16px 16px 12px 12px; }
}
