/* =========================================================================
 * GlobeMarket — Compare devices (Figma 559:23916, modal 580:25893)
 * Markup: page-compare.php. Behaviour: assets/js/gm-compare.js.
 * ====================================================================== */

.gm-cmp { font-family: var(--gm-font-sans); color: var(--gm-color-text-primary); }
.gm-cmp p, .gm-cmp h1, .gm-cmp h2 { margin: 0; }
.gm-cmp ul { margin: 0; padding: 0; list-style: none; }

/* ---------- Hero (559:23969) ---------- */
.gm-cmp-hero { padding: 80px 0; background: var(--gm-color-bg-surface); }
.gm-cmp-crumbs { display: flex; align-items: center; gap: 4px; height: 32px; padding: 4px 0; font-size: 14px; line-height: 20px; }
.gm-cmp-crumbs a { font-weight: 500; color: var(--gm-color-text-secondary); text-decoration: none; transition: color var(--gm-dur-fast, .15s) ease; }
.gm-cmp-crumbs a:hover { color: var(--gm-color-action-secondary-default); text-decoration: underline; }
.gm-cmp-crumbs span { font-weight: 600; color: var(--gm-color-text-primary); }
.gm-cmp-crumbs img { display: block; width: 24px; height: 24px; }
.gm-cmp-hero__info { display: flex; flex-direction: column; gap: var(--gm-spacing-lg); padding: 24px 0; }
.gm-cmp-hero__title { font-size: 40px; line-height: 48px; font-weight: 700; letter-spacing: -.6px; color: #0a0a0a; }
.gm-cmp-hero__intro { font-size: 18px; line-height: 28px; font-weight: 400; color: #62676c; }

/* ---------- Toolbar (559:24390) ---------- */
.gm-cmp-toolbar { padding: 16px 0; background: #f5f7f8; }
.gm-cmp-toolbar__count { font-size: 16px; line-height: normal; font-weight: 700; color: #0a0a0a; }

/* ---------- Cards (559:24600) ---------- */
.gm-cmp-cards { padding: 80px 0; background: var(--gm-color-bg-subtle); }
.gm-cmp-cards__row { display: flex; flex-wrap: wrap; gap: 29px; }
.gm-cmp-slot { display: contents; }
.gm-cmp-card {
	position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
	width: 300px; height: 346px; background: var(--gm-color-bg-surface); border-radius: var(--gm-radius-md);
	filter: drop-shadow(0 2px 2px rgba(17, 15, 21, .05));
	animation: gm-cmp-in var(--gm-dur, .25s) var(--gm-ease, ease) backwards;
	transition: transform var(--gm-dur, .25s) var(--gm-ease, ease), filter var(--gm-dur, .25s) ease, opacity var(--gm-dur, .25s) ease;
}
.gm-cmp-card:hover { transform: translateY(-4px); filter: drop-shadow(0 10px 18px rgba(17, 15, 21, .08)); }
.gm-cmp-card.is-removing { opacity: 0; transform: scale(.96); }
@keyframes gm-cmp-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.gm-cmp-card__media { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 200px; padding: 18px 18px 0; }
.gm-cmp-card__img { display: flex; align-items: flex-start; justify-content: center; width: 150px; height: 150px; padding: 0 14.063px; overflow: hidden; }
.gm-cmp-card__img img { width: 120.85px; height: 150px; max-width: none; object-fit: cover; transition: transform .4s var(--gm-ease, ease); }
.gm-cmp-card:hover .gm-cmp-card__img img { transform: scale(1.04); }
.gm-cmp-card__body { display: flex; flex-direction: column; gap: 14px; width: 100%; height: 138px; padding: 0 18px 24px; }
.gm-cmp-card__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; line-height: 28px; font-weight: 700; color: var(--gm-color-text-primary); text-decoration: none; }
.gm-cmp-card__title:hover { color: var(--gm-color-action-secondary-default); }
.gm-cmp-card__meta { font-size: 12px; line-height: 16px; color: var(--gm-color-text-muted); }

/* Remove: a quiet round button in the corner (no Figma frame; user approved). */
.gm-cmp-card__remove {
	position: absolute; top: 12px; right: 12px; z-index: 1;
	display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0;
	border: 0; border-radius: 999px; background: var(--gm-color-bg-subtle); cursor: pointer;
	transition: background-color var(--gm-dur-fast, .15s) ease, transform var(--gm-dur-fast, .15s) ease;
}
.gm-cmp-card__remove img { display: block; width: 20px; height: 20px; }
.gm-cmp-card__remove:hover { background: #e8ebed; transform: scale(1.06); }
.gm-cmp-card__remove:active { transform: scale(.94); }
.gm-cmp-card__remove:focus-visible { outline: none; box-shadow: var(--gm-focus-ring); }

/* "Add a device" slot (559:24504) */
.gm-cmp-card--add { justify-content: center; gap: 0; padding: 0; border: 0; font: inherit; cursor: pointer; }
.gm-cmp-card--add:focus-visible { outline: none; box-shadow: var(--gm-focus-ring); }
.gm-cmp-card__add { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 132px; padding: 12px; }
.gm-cmp-card__add img { display: block; width: 32px; height: 32px; transition: transform var(--gm-dur, .25s) var(--gm-ease, ease); }
.gm-cmp-card--add:hover .gm-cmp-card__add img { transform: scale(1.12); }
.gm-cmp-card__add span { font-size: 18px; line-height: 28px; font-weight: 600; color: #000; white-space: nowrap; }

/* ---------- Details: table + help band (559:23999) ---------- */
.gm-cmp-details { padding: 80px 0 56px; background: var(--gm-color-bg-canvas, #fff); }
.gm-cmp-details__in { max-width: 1200px; margin: 0 auto; }

/* Sticky device header (838:6129) */
.gm-cmp-head {
	position: sticky; top: 0; z-index: 5;
	display: grid; grid-template-columns: 240px repeat(var(--gm-cols, 4), minmax(0, 1fr)); align-items: center;
	padding: 12px 0; background: #fff; border-bottom: 2px solid #d5d9dc;
}
.gm-cmp-head__label { display: flex; flex-direction: column; gap: 2px; padding: 0 16px; line-height: normal; font-weight: 700; white-space: nowrap; }
.gm-cmp-head__label span { font-size: 11px; letter-spacing: .6px; color: #62676c; }
.gm-cmp-head__label b { font-size: 14px; color: #0a0a0a; }
.gm-cmp-head__dev { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0 16px; }
.gm-cmp-head__add { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 0; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.gm-cmp-head__add:focus-visible { outline: none; box-shadow: var(--gm-focus-ring); border-radius: 6px; }
.gm-cmp-head__thumb { display: flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 42px; overflow: hidden; border-radius: 6px; background: #f5f7f8; }
.gm-cmp-head__thumb img { width: 28.2px; height: 35px; max-width: none; object-fit: cover; }
.gm-cmp-head__thumb.is-empty, .gm-cmp-group__thumb.is-empty { border: 1px dashed #d5d9dc; background: #fafbfc; }
.gm-cmp-head__add:hover .gm-cmp-head__thumb { border-color: #a6a9ad; }
.gm-cmp-head__t { display: flex; flex: 1; flex-direction: column; gap: 1px; min-width: 0; line-height: normal; }
.gm-cmp-head__t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; color: #0a0a0a; }
.gm-cmp-head__t span { font-size: 12px; font-weight: 500; color: #62676c; }
.gm-cmp-head__dev.is-empty b { color: #62676c; }

/* Section header (832:11292): title + note, then each device again */
.gm-cmp-group { display: grid; grid-template-columns: 240px repeat(var(--gm-cols, 4), minmax(0, 1fr)); align-items: center; padding: 10px 0; background: #f0f2f4; }
.gm-cmp-group__label { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 0 16px; line-height: normal; }
.gm-cmp-group__title { font-size: 15px; font-weight: 700; color: #0a0a0a; }
.gm-cmp-group__note { font-size: 11px; font-weight: 500; color: #62676c; }
.gm-cmp-group__dev { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 16px; }
.gm-cmp-group__dev > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: normal; font-weight: 700; color: #2f3137; }
.gm-cmp-group__dev.is-empty > span:last-child { color: #62676c; }
.gm-cmp-group__thumb { display: flex; align-items: center; justify-content: center; flex: none; width: 20px; height: 24px; overflow: hidden; border: 1px solid #d5d9dc; border-radius: 4px; background: #fff; }
.gm-cmp-group__thumb img { width: 17.7px; height: 22px; max-width: none; object-fit: cover; }

.gm-cmp-row { display: grid; grid-template-columns: 240px repeat(var(--gm-cols, 4), minmax(0, 1fr)); border-bottom: 1px solid #e8ebed; }
.gm-cmp-row__val.is-empty { color: #c3c7cb; }
.gm-cmp-row > * { padding: 16px; font-size: 14px; line-height: normal; font-weight: 500; overflow-wrap: anywhere; }
.gm-cmp-row__label { color: #62676c; }
.gm-cmp-row__val { color: #0a0a0a; transition: background-color var(--gm-dur, .25s) ease; }
.gm-cmp-row__val.is-best { background: #fff9f3; font-weight: 700; color: #b54708; }
.gm-cmp-row__dev { display: none; }

.gm-cmp-need { padding: 28px; border: 1px dashed var(--gm-color-border-default); border-radius: 12px; margin-bottom: 24px; font-size: 16px; line-height: 24px; font-weight: 500; color: #62676c; text-align: center; }
.gm-cmp-need[hidden], .gm-cmp-table[hidden] { display: none; }

.gm-cmp-help { display: flex; align-items: center; gap: 24px; padding: 28px; background: #f5f7f8; border-radius: 12px; }
.gm-cmp-help__copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 4px; }
.gm-cmp-help__title { font-size: 18px; line-height: normal; font-weight: 700; color: #0a0a0a; }
.gm-cmp-help__text { font-size: 14px; line-height: 20px; font-weight: 400; color: #62676c; }
.gm-cmp-help__link { flex: none; font-size: 14px; line-height: normal; font-weight: 700; color: var(--gm-color-text-brand, #b45300); text-decoration: none; white-space: pre; }
.gm-cmp-help__link span { display: inline-block; transition: transform var(--gm-dur, .25s) var(--gm-ease, ease); }
.gm-cmp-help__link:hover { text-decoration: underline; color: var(--gm-color-text-brand, #b45300); }
.gm-cmp-help__link:hover span { transform: translateX(3px); }
.gm-cmp-help__link:focus-visible { outline: none; box-shadow: var(--gm-focus-ring); border-radius: 4px; }

/* ---------- Add a device modal (580:25891) ---------- */
.gm-cmp-scrim { position: fixed; inset: 0; z-index: 1002; background: rgba(0, 0, 0, .5); opacity: 0; transition: opacity var(--gm-dur, .25s) ease; }
.gm-cmp-scrim.is-open { opacity: 1; }
.gm-cmp-modal {
	position: fixed; left: 50%; top: 50%; z-index: 1003;
	display: flex; flex-direction: column; width: 760px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); overflow: hidden;
	background: #fff; border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .18);
	opacity: 0; transform: translate(-50%, calc(-50% + 12px)) scale(.98);
	transition: opacity var(--gm-dur, .25s) ease, transform var(--gm-dur, .25s) var(--gm-ease, ease);
}
.gm-cmp-modal.is-open { opacity: 1; transform: translate(-50%, -50%); }
.gm-cmp-modal[hidden], .gm-cmp-scrim[hidden] { display: none; }
html.gm-cmp-lock, html.gm-cmp-lock body { overflow: hidden; }

.gm-cmp-modal__head { display: flex; flex-direction: column; gap: 6px; padding: 24px 24px 20px; }
.gm-cmp-modal__top { display: flex; align-items: flex-start; gap: 12px; }
.gm-cmp-modal__title { flex: 1; min-width: 0; font-size: 20px; line-height: normal; font-weight: 700; letter-spacing: 0; color: #000; }
.gm-cmp-modal__close { position: relative; flex: none; width: 20px; height: 20px; padding: 0; border: 0; background: none; cursor: pointer; }
.gm-cmp-modal__close::before { content: ""; position: absolute; inset: -12px; border-radius: 999px; transition: background-color var(--gm-dur-fast, .15s) ease; }
.gm-cmp-modal__close:hover::before { background: var(--gm-color-bg-subtle); }
.gm-cmp-modal__close img { position: relative; display: block; }
.gm-cmp-modal__close:focus-visible { outline: none; box-shadow: var(--gm-focus-ring); border-radius: 4px; }
.gm-cmp-modal__sub { font-size: 14px; line-height: 20px; font-weight: 400; color: #62676c; }

.gm-cmp-modal__search { padding: 0 24px 16px; }
.gm-cmp-field {
	display: flex; align-items: center; gap: var(--gm-spacing-sm); height: 48px; margin: 0; padding: 0 var(--gm-spacing-lg);
	background: var(--gm-color-bg-surface); border: 1px solid var(--gm-color-border-default); border-radius: 12px; cursor: text;
	transition: border-color var(--gm-dur-fast, .15s) ease, box-shadow var(--gm-dur-fast, .15s) ease;
}
.gm-cmp-field:hover { border-color: var(--gm-color-border-strong); }
.gm-cmp-field:focus-within { border-color: var(--gm-color-border-focus); box-shadow: var(--gm-focus-ring); }
.gm-cmp-field img { display: block; flex: none; width: 24px; height: 24px; }
.gm-cmp-field input {
	flex: 1; min-width: 0; height: 100%; margin: 0; padding: 0; border: 0; outline: 0; box-shadow: none; background: none;
	font: 400 16px/24px var(--gm-font-sans); color: var(--gm-color-text-primary);
}
.gm-cmp-field input::placeholder { color: #62676c; opacity: 1; }
.gm-cmp-field input::-webkit-search-cancel-button { cursor: pointer; }

.gm-cmp-tabs { display: flex; gap: 24px; padding: 0 24px; border-bottom: 1px solid #e8ebed; }
.gm-cmp-tab {
	position: relative; padding: 0 0 12px; border: 0; background: none; cursor: pointer;
	font: 500 15px/20px var(--gm-font-sans); color: #62676c; white-space: nowrap; transition: color var(--gm-dur-fast, .15s) ease;
}
.gm-cmp-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: #ff7a00; opacity: 0; transform: scaleX(.6); transition: opacity var(--gm-dur, .25s) ease, transform var(--gm-dur, .25s) var(--gm-ease, ease); }
.gm-cmp-tab:hover { color: #0a0a0a; }
.gm-cmp-tab.is-active { font-weight: 700; color: #0a0a0a; }
.gm-cmp-tab.is-active::after { opacity: 1; transform: none; }
.gm-cmp-tab:focus-visible { outline: none; box-shadow: var(--gm-focus-ring); border-radius: 4px; }

.gm-cmp-list { flex: 1 1 auto; min-height: 0; max-height: 324px; overflow-y: auto; overscroll-behavior: contain; }
.gm-cmp-item { border-bottom: 1px solid #e8ebed; }
.gm-cmp-item label { display: flex; align-items: center; gap: 16px; margin: 0; padding: 14px 24px; cursor: pointer; transition: background-color var(--gm-dur-fast, .15s) ease; }
.gm-cmp-item label:hover { background: #fafbfc; }
.gm-cmp-item.is-disabled label { cursor: not-allowed; }
.gm-cmp-item.is-disabled label:hover { background: none; }
.gm-cmp-item.is-disabled .gm-cmp-item__text, .gm-cmp-item.is-disabled .gm-cmp-item__price, .gm-cmp-item.is-disabled .gm-cmp-item__thumb { opacity: .5; }

/* Checkbox (580:25693): 44px target, 24px box drawn like check_box_outline_blank. */
.gm-cmp-check { position: relative; flex: none; width: 44px; height: 44px; }
.gm-cmp-check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.gm-cmp-check span { position: absolute; left: 10px; top: 10px; width: 24px; height: 24px; background: url(../images/gm/ic-checkbox-blank.svg) no-repeat 0 0 / 24px 24px; border-radius: 3px; }
.gm-cmp-check span::before { content: ""; position: absolute; inset: 3px; border-radius: 2px; background: #ff7a00; opacity: 0; transform: scale(.6); transition: opacity var(--gm-dur-fast, .15s) ease, transform var(--gm-dur-fast, .15s) var(--gm-ease, ease); }
.gm-cmp-check span::after {
	content: ""; position: absolute; left: 9px; top: 5px; width: 5px; height: 11px;
	border: solid #0a0a0a; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform var(--gm-dur-fast, .15s) var(--gm-ease, ease);
}
.gm-cmp-check input:checked + span::before { opacity: 1; transform: none; }
.gm-cmp-check input:checked + span::after { transform: rotate(45deg) scale(1); }
.gm-cmp-check input:focus-visible + span { box-shadow: var(--gm-focus-ring); }

.gm-cmp-item__thumb { display: flex; align-items: center; justify-content: center; flex: none; width: 52px; height: 52px; overflow: hidden; border-radius: 6px; background: #f0f2f4; }
.gm-cmp-item__thumb img { width: 34px; height: 42px; max-width: none; object-fit: cover; }
.gm-cmp-item__text { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 3px; line-height: normal; }
.gm-cmp-item__name { font-size: 15px; font-weight: 700; color: #0a0a0a; }
.gm-cmp-item__spec { font-size: 13px; font-weight: 500; color: #62676c; white-space: pre-wrap; }
.gm-cmp-item__price { flex: none; font-size: 16px; line-height: normal; font-weight: 700; color: #0a0a0a; white-space: nowrap; }
.gm-cmp-item__tag { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; color: #62676c; text-align: right; }

.gm-cmp-empty { padding: 40px 24px; font-size: 14px; line-height: 20px; color: #62676c; text-align: center; }
.gm-cmp-empty a { font-weight: 700; color: var(--gm-color-text-brand, #b45300); }

.gm-cmp-modal__foot { display: flex; align-items: center; gap: 16px; padding: 18px 24px; background: #f7f9fa; }
.gm-cmp-modal__picked { flex: 1; min-width: 0; font-size: 14px; line-height: normal; font-weight: 500; color: #62676c; }
.gm-cmp-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none; width: 180px; height: 48px; padding: 0 16px;
	border: 1px solid transparent; border-radius: 12px; font: 600 16px/24px var(--gm-font-sans); cursor: pointer;
	transition: background-color var(--gm-dur-fast, .15s) ease, border-color var(--gm-dur-fast, .15s) ease, box-shadow var(--gm-dur, .25s) var(--gm-ease, ease), transform var(--gm-dur-fast, .15s) ease;
}
.gm-cmp-btn--ghost { background: transparent; border-color: var(--gm-color-border-strong); color: #0a0a0a; letter-spacing: .1px; line-height: 20px; }
.gm-cmp-btn--ghost:hover { background: #fff; border-color: #0a0a0a; }
.gm-cmp-btn--primary { background: var(--gm-color-action-primary-default); color: var(--gm-color-action-primary-text); }
.gm-cmp-btn--primary:hover { background: #f06f00; box-shadow: 0 6px 16px rgba(255, 122, 0, .28); transform: translateY(-1px); }
.gm-cmp-btn--primary[disabled] { background: var(--gm-color-action-disabled-bg); color: var(--gm-color-action-disabled-text); box-shadow: none; transform: none; cursor: not-allowed; }
.gm-cmp-btn:focus-visible { outline: none; box-shadow: var(--gm-focus-ring); }

/* ---------- Mobile: everything stacks vertically ---------- */
@media (max-width: 1100px) {
	.gm-cmp-cards__row { gap: 20px; }
	.gm-cmp-card { width: calc((100% - 20px) / 2); }
}
@media (max-width: 767px) {
	.gm-cmp-hero { padding: 48px 0 32px; }
	.gm-cmp-hero__title { font-size: 32px; line-height: 40px; }
	.gm-cmp-hero__intro { font-size: 16px; line-height: 24px; }
	.gm-cmp-cards { padding: 32px 0; }
	.gm-cmp-cards__row { flex-direction: column; gap: 16px; }
	.gm-cmp-card { width: 100%; }
	.gm-cmp-card--add { height: 120px; }
	.gm-cmp-details { padding: 32px 0 40px; }

	/* Each spec becomes a block: its name, then one line per device (each line names its device,
	 * so the sticky device header, the section-header devices and empty slots are not needed). */
	.gm-cmp-head, .gm-cmp-group__dev, .gm-cmp-row__val.is-empty { display: none; }
	.gm-cmp-group { display: block; padding: 14px 0; }
	.gm-cmp-row { display: flex; flex-direction: column; padding: 12px 0; }
	.gm-cmp-row > * { padding: 6px 16px; }
	.gm-cmp-row__label { font-weight: 700; color: #0a0a0a; }
	.gm-cmp-row__val { display: flex; gap: 12px; justify-content: space-between; }
	.gm-cmp-row__dev { display: block; flex: none; max-width: 45%; font-weight: 500; color: #62676c; }
	.gm-cmp-row__val.is-best .gm-cmp-row__dev { color: #b54708; font-weight: 500; }
	.gm-cmp-row__txt { text-align: right; }

	.gm-cmp-help { flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px; }
	.gm-cmp-help__link { white-space: normal; }

	.gm-cmp-modal { top: auto; bottom: 0; width: 100%; max-width: none; max-height: 92vh; border-radius: 16px 16px 0 0; transform: translate(-50%, 24px); }
	.gm-cmp-modal.is-open { transform: translate(-50%, 0); }
	.gm-cmp-modal__head { padding: 20px 16px 16px; }
	.gm-cmp-modal__search { padding: 0 16px 12px; }
	.gm-cmp-tabs { gap: 20px; padding: 0 16px; overflow-x: auto; }
	.gm-cmp-list { max-height: none; }
	.gm-cmp-item label { gap: 10px; padding: 12px 16px; }
	.gm-cmp-check { width: 32px; }
	.gm-cmp-check span { left: 4px; }
	.gm-cmp-modal__foot { flex-wrap: wrap; gap: 10px; padding: 14px 16px; }
	.gm-cmp-modal__picked { flex-basis: 100%; }
	.gm-cmp-btn { flex: 1; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
	.gm-cmp-card, .gm-cmp-modal, .gm-cmp-scrim, .gm-cmp-card__img img, .gm-cmp-card__add img { transition: none; animation: none; }
	.gm-cmp-card:hover, .gm-cmp-card:hover .gm-cmp-card__img img { transform: none; }
}
