/**
 * Signal Pack Global Components — E-commerce Utilities
 * Uses existing brand CSS variables with safe fallbacks (same pattern
 * as the other components in this plugin). Depends on buttons.css for
 * .spgc-btn-* used inside the cookie banner / confirm dialog / empty states.
 */

/* ---------- Breadcrumbs ---------- */
.spgc-breadcrumbs {
	display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
	font-size: 12.5px; color: var(--grey-text, #55536b); margin: 0 0 24px;
}
.spgc-breadcrumbs a { color: inherit; text-decoration: none; }
.spgc-breadcrumbs a:hover { color: var(--navy, #2C2A78); }
.spgc-breadcrumbs .spgc-sep { color: var(--line, rgba(23, 22, 46, 0.10)); }
.spgc-breadcrumbs .spgc-current { color: var(--ink, #17162e); font-weight: 600; }

/* ---------- Pagination ---------- */
.spgc-pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 32px 0; }
.spgc-pagination a, .spgc-pagination span {
	width: 36px; height: 36px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
	font-size: 13px; font-weight: 600; color: var(--ink, #17162e); border: 1px solid transparent; text-decoration: none;
}
.spgc-pagination a:hover { border-color: var(--line, rgba(23, 22, 46, 0.10)); }
.spgc-pagination .spgc-is-current { background: var(--navy, #2C2A78); color: #fff; }
.spgc-pagination .spgc-is-disabled { color: #a8a6b8; }

/* ---------- Filters / Sort ---------- */
.spgc-filter-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.spgc-filter-pill-btn {
	display: inline-flex; align-items: center; gap: 6px;
	border: 1px solid var(--line, rgba(23, 22, 46, 0.10)); border-radius: 999px;
	padding: 8px 16px; font-size: 12.5px; font-weight: 600; background: none; cursor: pointer; color: var(--ink, #17162e);
}
.spgc-filter-pill-btn:hover { border-color: var(--navy, #2C2A78); }
.spgc-filter-group { margin-bottom: 22px; }
.spgc-filter-group h5 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--navy, #2C2A78); margin: 0 0 12px; }
.spgc-sort-select { width: auto; min-width: 160px; }

/* ---------- Price / MOQ display ---------- */
.spgc-price-display { font-weight: 800; font-size: 16px; color: var(--navy, #2C2A78); }
.spgc-price-display .spgc-strike { font-size: 12px; font-weight: 600; color: var(--grey-text, #55536b); text-decoration: line-through; margin-right: 6px; }
.spgc-moq-display { font-size: 11.5px; color: var(--grey-text, #55536b); }

/* ---------- Stock badge ---------- */
.spgc-stock-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; }
.spgc-stock-badge.spgc-in-stock { color: #1e8e5a; }
.spgc-stock-badge.spgc-low-stock { color: #b98400; }
.spgc-stock-badge.spgc-out-of-stock { color: #c8151f; }
.spgc-stock-badge .spgc-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Tabs ---------- */
.spgc-tabs { border-bottom: 1px solid var(--line, rgba(23, 22, 46, 0.10)); display: flex; gap: 8px; overflow-x: auto; }
.spgc-tab {
	padding: 14px 4px; margin-right: 22px; font-size: 13.5px; font-weight: 600;
	color: var(--grey-text, #55536b); border: none; background: none; border-bottom: 2px solid transparent;
	white-space: nowrap; cursor: pointer;
}
.spgc-tab:hover { color: var(--ink, #17162e); }
.spgc-tab.spgc-is-active { color: var(--navy, #2C2A78); border-bottom-color: var(--red, #E31E2A); }
.spgc-tab-panel { display: none; padding-top: 20px; }
.spgc-tab-panel.spgc-is-active { display: block; }

/* ---------- Accordion ---------- */
.spgc-accordion-item { border-bottom: 1px solid var(--line, rgba(23, 22, 46, 0.10)); }
.spgc-accordion-trigger {
	width: 100%; display: flex; justify-content: space-between; align-items: center;
	padding: 18px 4px; font-weight: 700; font-size: 15px; text-align: left;
	background: none; border: none; cursor: pointer; color: var(--ink, #17162e);
}
.spgc-accordion-trigger .spgc-caret { transition: transform 0.2s ease; color: var(--red, #E31E2A); }
.spgc-accordion-trigger[aria-expanded="true"] .spgc-caret { transform: rotate(45deg); }
.spgc-accordion-panel { display: none; padding: 0 4px 20px; font-size: 13.5px; color: var(--grey-text, #55536b); line-height: 1.65; }
.spgc-accordion-panel.spgc-is-open { display: block; }

/* ---------- Modal ---------- */
.spgc-modal-overlay {
	position: fixed; inset: 0; background: rgba(23, 22, 46, 0.55); z-index: 9300;
	display: none; align-items: center; justify-content: center; padding: 20px;
}
.spgc-modal-overlay.spgc-is-open { display: flex; }
.spgc-modal { background: var(--paper, #ffffff); border-radius: 10px; max-width: 480px; width: 100%; padding: 28px; box-shadow: 0 18px 40px rgba(23, 22, 46, 0.14); }
.spgc-modal-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.spgc-modal-head h3 { font-size: 18px; margin: 0; }
.spgc-modal-body { font-size: 13.5px; color: var(--grey-text, #55536b); line-height: 1.6; margin-bottom: 22px; }
.spgc-modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.spgc-confirm-dialog .spgc-modal { max-width: 400px; text-align: center; }
.spgc-confirm-dialog .spgc-modal-actions { justify-content: center; }

/* ---------- Generic drawer ---------- */
.spgc-drawer {
	position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 92vw;
	background: var(--paper, #ffffff); z-index: 9201; transform: translateX(100%);
	transition: transform 0.28s ease; box-shadow: 0 18px 40px rgba(23, 22, 46, 0.14);
	display: flex; flex-direction: column;
}
.spgc-drawer.spgc-is-open { transform: translateX(0); }
.spgc-drawer.spgc-drawer--left { right: auto; left: 0; transform: translateX(-100%); }
.spgc-drawer.spgc-drawer--left.spgc-is-open { transform: translateX(0); }

/* ---------- Tooltip ---------- */
.spgc-tooltip { position: relative; display: inline-flex; }
.spgc-tooltip .spgc-tooltip-bubble {
	position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px);
	background: var(--ink, #17162e); color: #fff; font-size: 11.5px; padding: 6px 10px; border-radius: 4px;
	white-space: nowrap; opacity: 0; visibility: hidden;
	transition: opacity 0.2s ease, transform 0.2s ease; z-index: 9400; pointer-events: none;
}
.spgc-tooltip:hover .spgc-tooltip-bubble, .spgc-tooltip:focus-within .spgc-tooltip-bubble {
	opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}

/* ---------- Alert ---------- */
.spgc-alert { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 6px; font-size: 13px; line-height: 1.5; }
.spgc-alert-info { background: #eef0fb; color: var(--navy, #2C2A78); }
.spgc-alert-success { background: #e9f7ef; color: #1e8e5a; }
.spgc-alert-error { background: #fdecec; color: #c8151f; }
.spgc-alert-warning { background: #fff8e6; color: #b98400; }

/* ---------- Toast ---------- */
.spgc-toast-stack { position: fixed; top: 24px; right: 24px; z-index: 9500; display: flex; flex-direction: column; gap: 10px; }
.spgc-toast {
	min-width: 280px; max-width: 360px; background: var(--ink, #17162e); color: #fff; border-radius: 6px;
	padding: 14px 16px; box-shadow: 0 16px 34px rgba(23, 22, 46, 0.10); font-size: 13px;
	animation: spgc-toast-in 0.28s ease;
}
.spgc-toast.spgc-toast-success { background: #1e8e5a; }
.spgc-toast.spgc-toast-error { background: #c8151f; }
@keyframes spgc-toast-in {
	from { opacity: 0; transform: translateY(-8px); }
	to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 480px) {
	.spgc-toast-stack { left: 16px; right: 16px; top: 16px; }
	.spgc-toast { min-width: 0; max-width: none; }
}

/* ---------- Loading skeleton ---------- */
.spgc-skeleton {
	background: linear-gradient(90deg, var(--grey-bg, #f6f6f9) 25%, var(--grey-alt, #eef0f5) 37%, var(--grey-bg, #f6f6f9) 63%);
	background-size: 400% 100%; animation: spgc-util-skeleton 1.4s ease infinite; border-radius: 4px;
}
.spgc-skeleton-text { height: 12px; margin-bottom: 8px; }
.spgc-skeleton-text.spgc-short { width: 40%; }
@keyframes spgc-util-skeleton {
	0% { background-position: 100% 50%; }
	100% { background-position: 0 50%; }
}

/* ---------- Empty / error / success full-block states ---------- */
.spgc-state-block { text-align: center; padding: 60px 20px; }
.spgc-state-block svg { width: 44px; height: 44px; margin: 0 auto 16px; }
.spgc-state-block h4 { margin: 0 0 8px; }
.spgc-state-block p { color: var(--grey-text, #55536b); font-size: 13.5px; max-width: 360px; margin: 0 auto 20px; }
.spgc-state-block.spgc-is-empty svg { stroke: var(--grey-text, #55536b); }
.spgc-state-block.spgc-is-error svg { stroke: #c8151f; }
.spgc-state-block.spgc-is-success svg { stroke: #1e8e5a; }

/* ---------- Cookie consent banner ---------- */
.spgc-cookie-banner {
	position: fixed; left: 20px; right: 20px; bottom: 20px; max-width: 520px;
	background: var(--ink, #17162e); color: #fff; border-radius: 10px; padding: 20px 22px;
	box-shadow: 0 18px 40px rgba(23, 22, 46, 0.14); z-index: 9450; display: none; gap: 14px; flex-direction: column;
}
.spgc-cookie-banner.spgc-is-visible { display: flex; }
.spgc-cookie-banner p { font-size: 12.5px; color: rgba(255, 255, 255, 0.8); line-height: 1.6; margin: 0; }
.spgc-cookie-banner .spgc-cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Back to top ---------- */
.spgc-back-to-top {
	position: fixed; right: 24px; bottom: 96px; width: 44px; height: 44px; border-radius: 50%;
	background: var(--navy, #2C2A78); color: #fff; border: none; cursor: pointer;
	display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(23, 22, 46, 0.06);
	opacity: 0; visibility: hidden; transform: translateY(8px); transition: all 0.2s ease; z-index: 8800;
}
.spgc-back-to-top.spgc-is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.spgc-back-to-top:hover { background: var(--red, #E31E2A); }
.spgc-back-to-top svg { width: 18px; height: 18px; stroke: #fff; }
@media (max-width: 880px) { .spgc-back-to-top { right: 16px; bottom: 150px; } }
