/*!
 * ComprasGuate delivery picker — header pill, modal, banners, ETA badges.
 * (v1.2.0)
 *
 * Reads --c-* tokens from the theme; falls back to literal values so the
 * plugin still looks correct on any other theme.
 */

/* =============================================================================
   HEADER PILL
   ============================================================================= */
.cg-delivery-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px;
	background: #FFFBEB;
	border: 1px solid #FBBF24;
	border-radius: 999px;
	color: #7C2D12;
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	max-width: none;
	white-space: nowrap;
	transition: background 0.15s, border-color 0.15s;
}
.cg-delivery-pill:hover { background: #FEF3C7; border-color: #F59E0B; }
.cg-delivery-pill-label { font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; color: #92400E; text-transform: uppercase; display: block; }
.cg-delivery-pill-loc {
	display: block;
	white-space: nowrap;
	font-size: 12px;
	margin-top: 2px;
}
.cg-delivery-pill-caret { margin-left: 4px; opacity: 0.7; }
.cg-delivery-pill-icon { display: inline-flex; align-items: center; }

/* Shared: outlined pin SVG inherits the parent's currentColor stroke. */
.cg-delivery-pin-svg { display: inline-block; vertical-align: middle; }

/* =============================================================================
   MOBILE PIN VARIANT
   On screens ≤900px the full pill is hidden and a single 📍 icon appears in
   its place. Tapping the icon shows a small popup with the current location
   and a "Cambiar ubicación" button that opens the picker modal.
   ============================================================================= */
.cg-delivery-mini { display: none; position: relative; }

.cg-delivery-mini-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 999px;
	background: #FFFBEB;
	border: 1px solid #FBBF24;
	color: #7C2D12;
	cursor: pointer;
	padding: 0;
	transition: background 0.15s, border-color 0.15s;
}
.cg-delivery-mini-btn:hover,
.cg-delivery-mini-btn[aria-expanded="true"] {
	background: #FEF3C7;
	border-color: #F59E0B;
}
.cg-delivery-mini-icon { font-size: 16px; line-height: 1; }

.cg-delivery-mini-popup {
	position: absolute;
	top: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%);
	min-width: 220px;
	max-width: 280px;
	background: #fff;
	border: 1px solid #E5E7EB;
	border-radius: 10px;
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
	padding: 14px 16px;
	z-index: 5000;
	color: #111827;
}
.cg-delivery-mini-popup[hidden] { display: none; }

.cg-delivery-mini-popup-arrow {
	position: absolute;
	top: -7px;
	left: 50%;
	transform: translateX(-50%) rotate(45deg);
	width: 12px;
	height: 12px;
	background: #fff;
	border-top: 1px solid #E5E7EB;
	border-left: 1px solid #E5E7EB;
}

.cg-delivery-mini-popup-label {
	margin: 0 0 4px;
	font-size: 9.5px;
	font-weight: 700;
	letter-spacing: 0.06em;
	color: #92400E;
	text-transform: uppercase;
}
.cg-delivery-mini-popup-loc {
	margin: 0;
	font-size: 14px;
	font-weight: 800;
	color: #111827;
	display: flex;
	align-items: center;
	gap: 6px;
}
.cg-delivery-mini-popup-pin { color: #7C2D12; display: inline-flex; }
.cg-delivery-mini-popup-flag { font-size: 16px; }
.cg-delivery-mini-popup-eta {
	margin: 4px 0 12px;
	font-size: 12px;
	color: #6B7280;
}
.cg-delivery-mini-popup-change {
	display: block;
	width: 100%;
	background: #FBBF24;
	color: #7C2D12;
	border: 0;
	border-radius: 6px;
	padding: 9px 14px;
	font-size: 12px;
	font-weight: 800;
	cursor: pointer;
	text-align: center;
	transition: background 0.15s;
}
.cg-delivery-mini-popup-change:hover { background: #F59E0B; }

@media (max-width: 900px) {
	.cg-delivery-pill { display: none !important; }
	.cg-delivery-mini { display: inline-block; }
}
@media (max-width: 640px) {
	.cg-delivery-pill-loc {
		max-width: 56vw;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
}

/* =============================================================================
   MODAL
   ============================================================================= */
.cg-delivery-modal {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.45);
	display: none;
	align-items: flex-start;
	justify-content: center;
	z-index: 999999;
	padding: 80px 16px 16px;
	overflow-y: auto;
}
.cg-delivery-modal.is-open { display: flex; }

.cg-delivery-modal-card {
	background: #fff;
	width: 100%;
	max-width: 620px;
	border-radius: 14px;
	box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
	overflow: hidden;
}

.cg-delivery-modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 22px;
	border-bottom: 1px solid #E5E7EB;
}
.cg-delivery-modal-head h2 {
	margin: 0;
	font-size: 16px;
	font-weight: 800;
	color: #111827;
}
.cg-delivery-modal-close {
	background: none;
	border: 0;
	font-size: 22px;
	line-height: 1;
	color: #9CA3AF;
	cursor: pointer;
	padding: 2px 8px;
}

.cg-delivery-modal-body {
	padding: 18px 22px;
}
.cg-delivery-section-label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	color: #6B7280;
	margin: 0 0 8px;
	text-transform: uppercase;
}

.cg-delivery-country-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
}
.cg-delivery-country-chip {
	display: flex;
	align-items: center;
	gap: 6px;
	background: #fff;
	border: 1px solid #E5E7EB;
	border-radius: 6px;
	padding: 9px 12px;
	font-size: 12px;
	color: #111827;
	cursor: pointer;
	text-align: left;
	transition: background 0.12s, border-color 0.12s;
}
.cg-delivery-country-chip:hover { background: #F9FAFB; }
.cg-delivery-country-chip.is-active {
	background: #EFF6FF;
	border-color: #1e73be;
	color: #1e73be;
	font-weight: 700;
}

.cg-delivery-city-block { margin-top: 18px; }
.cg-delivery-city-search {
	width: 100%;
	border: 1px solid #E5E7EB;
	border-radius: 6px;
	padding: 9px 12px;
	font-size: 12.5px;
	margin-bottom: 8px;
	box-sizing: border-box;
}
.cg-delivery-city-select {
	max-height: 220px;
	overflow-y: auto;
	border: 1px solid #E5E7EB;
	border-radius: 6px;
}
.cg-delivery-city-opt {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 10px 14px;
	background: none;
	border: 0;
	border-bottom: 1px solid #F3F4F6;
	font-size: 12.5px;
	color: #111827;
	cursor: pointer;
	text-align: left;
}
.cg-delivery-city-opt:last-child { border-bottom: 0; }
.cg-delivery-city-opt:hover { background: #F9FAFB; }
.cg-delivery-city-opt.is-active {
	background: #EFF6FF;
	color: #1e73be;
	font-weight: 700;
}
.cg-delivery-city-eta { font-size: 11px; color: #6B7280; }
.cg-delivery-city-opt.is-active .cg-delivery-city-eta { color: #1e73be; }
.cg-delivery-city-loading,
.cg-delivery-city-empty,
.cg-delivery-city-error {
	padding: 14px 16px;
	font-size: 12px;
	color: #6B7280;
}
.cg-delivery-city-error { color: #B91C1C; }

.cg-delivery-helper {
	margin: 14px 0 0;
	font-size: 11px;
	color: #6B7280;
}

/* =============================================================================
   v1.3.0 — CHECKOUT METHOD PICKER
   Renders above WC payment block. One vendor group per cart vendor. One
   radio-card per method.
   ============================================================================= */
.cgmp-checkout-methods {
	background: #fff;
	border: 1px solid #E5E7EB;
	border-radius: 10px;
	padding: 18px 20px;
	margin: 0 0 22px;
}
.cgmp-checkout-methods-title {
	margin: 0 0 4px;
	font-size: 16px;
	font-weight: 800;
	color: #111827;
}
.cgmp-checkout-methods-sub {
	margin: 0 0 14px;
	font-size: 12.5px;
	color: #6B7280;
}
.cgmp-checkout-vendor {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #F3F4F6;
}
.cgmp-checkout-vendor:first-of-type {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}
.cgmp-checkout-vendor-name {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 700;
	color: #111827;
}
.cgmp-checkout-vendor-name strong { color: #1e73be; }
.cgmp-checkout-vendor-meta {
	font-weight: 500;
	color: #6B7280;
	margin-left: 4px;
}

.cgmp-checkout-method {
	display: grid;
	grid-template-columns: auto 36px 1fr auto;
	grid-template-rows: auto auto;
	column-gap: 12px;
	align-items: center;
	padding: 12px 14px;
	border: 1px solid #E5E7EB;
	border-radius: 8px;
	margin-bottom: 8px;
	cursor: pointer;
	background: #fff;
	transition: border-color 0.12s, background 0.12s;
}
.cgmp-checkout-method:hover { border-color: #BFDBFE; }
.cgmp-checkout-method input[type="radio"] {
	grid-row: 1 / span 2;
	grid-column: 1;
	margin: 0;
	accent-color: #1e73be;
	transform: scale(1.1);
}
.cgmp-checkout-method-icon {
	grid-row: 1 / span 2;
	grid-column: 2;
	font-size: 18px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 8px;
	background: #F9FAFB;
	border: 1px solid #E5E7EB;
}
.cgmp-checkout-method-body { grid-row: 1 / span 2; grid-column: 3; }
.cgmp-checkout-method-label {
	display: block;
	font-size: 13px;
	font-weight: 800;
	color: #111827;
}
.cgmp-checkout-method-desc {
	display: block;
	font-size: 11.5px;
	color: #6B7280;
	margin-top: 2px;
}
.cgmp-checkout-method-cost {
	grid-row: 1;
	grid-column: 4;
	font-size: 13px;
	font-weight: 800;
	color: #111827;
	text-align: right;
}
.cgmp-checkout-method-cost strong { color: #16A34A; }
.cgmp-checkout-method-eta {
	grid-row: 2;
	grid-column: 4;
	font-size: 11px;
	color: #6B7280;
	text-align: right;
}
.cgmp-checkout-method:has(input:checked) {
	border-color: #1e73be;
	border-width: 2px;
	background: #EFF6FF;
	padding: 11px 13px; /* compensate for thicker border */
}

/* Tint variants — color the icon background by method category. */
.cgmp-checkout-method--tint-green  .cgmp-checkout-method-icon { background: #ECFDF5; border-color: #86EFAC; }
.cgmp-checkout-method--tint-yellow .cgmp-checkout-method-icon { background: #FFFBEB; border-color: #FCD34D; }
.cgmp-checkout-method--tint-blue   .cgmp-checkout-method-icon { background: #1e73be; border-color: #1e73be; color: #fff; font-weight: 800; font-size: 11px; }

.cgmp-checkout-no-methods {
	padding: 12px 14px;
	background: #FEF2F2;
	border: 1px solid #FCA5A5;
	border-radius: 8px;
	color: #991B1B;
	font-size: 12.5px;
}

@media (max-width: 640px) {
	.cgmp-checkout-method { grid-template-columns: auto 32px 1fr; }
	.cgmp-checkout-method-cost,
	.cgmp-checkout-method-eta { grid-column: 1 / -1; text-align: left; margin-top: 6px; }
	.cgmp-checkout-method-cost { font-size: 14px; }
}

.cg-delivery-modal-foot {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	padding: 14px 22px;
	background: #F9FAFB;
	border-top: 1px solid #E5E7EB;
}
.cg-delivery-btn {
	border: 0;
	border-radius: 6px;
	padding: 9px 18px;
	font-size: 12.5px;
	font-weight: 800;
	cursor: pointer;
	transition: background 0.15s, opacity 0.15s;
}
.cg-delivery-btn--cancel {
	background: #fff;
	border: 1px solid #E5E7EB;
	color: #6B7280;
}
.cg-delivery-btn--confirm {
	background: #FBBF24;
	color: #7C2D12;
}
.cg-delivery-btn--confirm:hover { background: #F59E0B; }
.cg-delivery-btn:disabled { opacity: 0.6; cursor: wait; }

@media (max-width: 640px) {
	.cg-delivery-country-grid { grid-template-columns: repeat(2, 1fr); }
	.cg-delivery-modal { padding-top: 24px; }
	.cg-delivery-modal-card { border-radius: 10px; }
}

/* =============================================================================
   CART + CHECKOUT BANNER
   ============================================================================= */
.cg-delivery-banner {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #FFFBEB;
	border: 1px solid #FCD34D;
	border-radius: 8px;
	padding: 12px 16px;
	margin: 0 0 18px;
}
.cg-delivery-banner-icon { font-size: 16px; }
.cg-delivery-banner-body { flex: 1; min-width: 0; }
.cg-delivery-banner-label {
	display: block;
	font-size: 9.5px;
	font-weight: 700;
	letter-spacing: 0.06em;
	color: #92400E;
	text-transform: uppercase;
}
.cg-delivery-banner-loc {
	display: block;
	font-size: 13px;
	font-weight: 700;
	color: #7C2D12;
	margin-top: 1px;
}
.cg-delivery-banner-country,
.cg-delivery-banner-eta {
	font-weight: 500;
	opacity: 0.8;
}
.cg-delivery-banner-change {
	background: #fff;
	border: 1px solid #FBBF24;
	border-radius: 999px;
	padding: 6px 14px;
	font-size: 11.5px;
	font-weight: 700;
	color: #7C2D12;
	cursor: pointer;
	white-space: nowrap;
}
.cg-delivery-banner-change:hover { background: #FEF3C7; }

/* =============================================================================
   PRODUCT-LOOP ETA BADGE
   ============================================================================= */
.cg-delivery-badge {
	display: inline-block;
	padding: 3px 8px;
	border-radius: 10px;
	font-size: 10.5px;
	font-weight: 700;
	line-height: 1.4;
	margin-top: 6px;
	white-space: nowrap;
}
.cg-delivery-badge--fast     { background: #ECFDF5; color: #15803D; border: 1px solid #86EFAC; }
.cg-delivery-badge--local    { background: #EFF6FF; color: #1e73be; border: 1px solid #BFDBFE; }
.cg-delivery-badge--regional { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }
.cg-delivery-badge--intl     { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }
.cg-delivery-badge--unavail  { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }

/* =============================================================================
   v1.4.0 — PRODUCT PAGE DELIVERY WIDGET
   Sits between price/description and add-to-cart on every product detail page.
   ============================================================================= */
.cgmp-product-delivery {
	background: #FFFBEB;
	border: 1px solid #FCD34D;
	border-radius: 10px;
	padding: 14px 16px;
	margin: 18px 0;
}
.cgmp-product-delivery-row {
	display: flex;
	align-items: center;
	gap: 12px;
}
.cgmp-product-delivery-icon { color: #7C2D12; display: inline-flex; flex-shrink: 0; }
.cgmp-product-delivery-body { flex: 1; min-width: 0; line-height: 1.25; }
.cgmp-product-delivery-label {
	display: block;
	font-size: 9.5px;
	font-weight: 700;
	letter-spacing: 0.06em;
	color: #92400E;
	text-transform: uppercase;
}
.cgmp-product-delivery-loc {
	display: block;
	font-size: 13px;
	font-weight: 800;
	color: #7C2D12;
	margin-top: 2px;
}
.cgmp-product-delivery-change {
	background: #fff;
	border: 1px solid #FBBF24;
	border-radius: 999px;
	padding: 6px 14px;
	font-size: 11.5px;
	font-weight: 700;
	color: #7C2D12;
	cursor: pointer;
	white-space: nowrap;
}
.cgmp-product-delivery-change:hover { background: #FEF3C7; }

.cgmp-product-delivery-eta {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px dashed #FCD34D;
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12.5px;
	color: #7C2D12;
}
.cgmp-product-delivery-eta-icon { font-size: 16px; }
.cgmp-product-delivery-cost {
	margin-left: auto;
	background: #fff;
	border: 1px solid #FBBF24;
	border-radius: 6px;
	padding: 3px 10px;
	font-size: 12.5px;
	font-weight: 800;
	color: #7C2D12;
}

.cgmp-product-delivery-warning {
	margin-top: 10px;
	padding: 8px 12px;
	background: #FEE2E2;
	border: 1px solid #FCA5A5;
	border-radius: 6px;
	font-size: 11.5px;
	color: #991B1B;
}
