/**
 * GravityShop Fields — Frontend Styles
 *
 * Sections:
 * 1. Upsell Card
 * 2. Order Summary
 * 3. Image Choice
 */

/* ═══════════════════════════════════════════
   1. UPSELL CARD
   ═══════════════════════════════════════════ */

.gsf-upsell-card {
	display: flex;
	gap: 16px;
	padding: 16px;
	border: 2px solid #e5e7eb;
	border-radius: 12px;
	background: #fff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gsf-upsell-card:hover {
	border-color: #d1d5db;
}

.gsf-upsell-card.gsf-upsell-added {
	border-color: var(--gs-brand-color, #2563eb);
	box-shadow: 0 0 0 1px var(--gs-brand-color, #2563eb);
}

.gsf-upsell-image {
	flex: 0 0 80px;
	width: 80px;
	height: 80px;
	border-radius: 8px;
	overflow: hidden;
}

.gsf-upsell-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.gsf-upsell-content {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.gsf-upsell-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
}

.gsf-upsell-title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	color: #111827;
}

.gsf-upsell-pricing {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
	white-space: nowrap;
}

.gsf-price-original {
	text-decoration: line-through;
	color: #9ca3af;
	font-size: 13px;
}

.gsf-price-sale {
	font-weight: 600;
	font-size: 15px;
	color: #111827;
}

.gsf-upsell-desc {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	color: #6b7280;
}

.gsf-upsell-toggle {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 16px;
	border: 1.5px solid #d1d5db;
	border-radius: 8px;
	background: #fff;
	color: #374151;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s ease;
	line-height: 1;
}

.gsf-upsell-toggle:hover {
	border-color: #9ca3af;
	background: #f9fafb;
}

.gsf-upsell-toggle.gsf-added {
	border-color: var(--gs-brand-color, #2563eb);
	background: var(--gs-brand-color, #2563eb);
	color: #fff;
}

.gsf-upsell-toggle.gsf-added:hover {
	opacity: 0.9;
}

/* Hide the product inputs */
.ginput_container_gs_upsell .gform_hidden {
	display: none !important;
}

/* ═══════════════════════════════════════════
   2. ORDER SUMMARY
   ═══════════════════════════════════════════ */

.gsf-order-summary {
	padding: 20px;
	border: 2px solid #e5e7eb;
	border-radius: 12px;
	background: #f9fafb;
}

.gsf-summary-lines {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.gsf-summary-line {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
}

.gsf-line-name {
	font-size: 14px;
	color: #374151;
}

.gsf-line-price {
	font-size: 14px;
	font-weight: 500;
	color: #111827;
	white-space: nowrap;
}

.gsf-summary-divider {
	height: 1px;
	background: #e5e7eb;
	margin: 14px 0;
}

.gsf-summary-total {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.gsf-summary-total-label {
	font-size: 15px;
	font-weight: 600;
	color: #111827;
}

.gsf-summary-total-price {
	font-size: 18px;
	font-weight: 700;
	color: #111827;
}

.gsf-summary-savings {
	margin-top: 10px;
	text-align: right;
}

.gsf-savings-badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 6px;
	background: #ecfdf5;
	color: #059669;
	font-size: 13px;
	font-weight: 500;
}

/* Empty state */
.gsf-summary-empty {
	text-align: center;
	padding: 8px 0;
	color: #9ca3af;
	font-size: 14px;
}

/* ═══════════════════════════════════════════
   3. IMAGE CHOICE
   ═══════════════════════════════════════════ */

.gsf-image-choices {
	display: grid;
	gap: 12px;
}

.gsf-image-choices.gsf-cols-2 {
	grid-template-columns: repeat(2, 1fr);
}

.gsf-image-choices.gsf-cols-3 {
	grid-template-columns: repeat(3, 1fr);
}

.gsf-image-choices.gsf-cols-4 {
	grid-template-columns: repeat(4, 1fr);
}

.gsf-choice-card {
	position: relative;
	display: flex;
	flex-direction: column;
	border: 2px solid #e5e7eb;
	border-radius: 12px;
	background: #fff;
	overflow: hidden;
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gsf-choice-card:hover {
	border-color: #d1d5db;
}

.gsf-choice-card.gsf-choice-selected {
	border-color: var(--gs-brand-color, #2563eb);
	box-shadow: 0 0 0 1px var(--gs-brand-color, #2563eb);
}

.gsf-choice-input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.gsf-choice-image {
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #f3f4f6;
}

.gsf-choice-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.gsf-choice-content {
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.gsf-choice-label {
	font-size: 14px;
	font-weight: 600;
	color: #111827;
	line-height: 1.3;
}

.gsf-choice-price {
	font-size: 13px;
	font-weight: 500;
	color: #6b7280;
}

.gsf-choice-check {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 2px solid #d1d5db;
	background: #fff;
	transition: all 0.15s ease;
}

.gsf-choice-card.gsf-choice-selected .gsf-choice-check {
	border-color: var(--gs-brand-color, #2563eb);
	background: var(--gs-brand-color, #2563eb);
}

.gsf-choice-card.gsf-choice-selected .gsf-choice-check::after {
	content: '';
	position: absolute;
	top: 4px;
	left: 6px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 600px) {

	.gsf-upsell-card {
		flex-direction: column;
	}

	.gsf-upsell-image {
		width: 100%;
		height: 160px;
		flex: none;
	}

	.gsf-image-choices.gsf-cols-3,
	.gsf-image-choices.gsf-cols-4 {
		grid-template-columns: repeat(2, 1fr);
	}
}
