/* Nivoda Connector: front-end styles.
   Everything is scoped to .nvc-app. Restyle by overriding the custom properties below
   (Divi > Theme Options > Custom CSS, or the page's own CSS). */

.nvc-app {
	--nvc-ink: #16181d;
	--nvc-muted: #656b76;
	--nvc-line: #e3e5e9;
	--nvc-soft: #f4f5f7;
	--nvc-surface: #ffffff;
	--nvc-button: #16181d;
	--nvc-button-ink: #ffffff;
	--nvc-focus: #3b5bdb;
	--nvc-deal: #c0392b;
	--nvc-good: #1f7a4d;
	--nvc-good-soft: #e6f4ec;
	--nvc-radius: 6px;
	--nvc-gap: 14px;

	color: var(--nvc-ink);
	font-size: 14px;
	line-height: 1.45;
	box-sizing: border-box;
	width: 100%;
}
.nvc-app *, .nvc-app *::before, .nvc-app *::after { box-sizing: border-box; }
.nvc-app button, .nvc-app select, .nvc-app input { font: inherit; color: inherit; }
.nvc-app :focus-visible { outline: 2px solid var(--nvc-focus); outline-offset: 2px; }

/* Heading row */
.nvc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.nvc-title { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 600; }
.nvc-count { color: var(--nvc-muted); font-size: 13px; margin-left: 8px; font-weight: 400; }
.nvc-view { display: inline-flex; border: 1px solid var(--nvc-line); border-radius: var(--nvc-radius); overflow: hidden; }
.nvc-view button { border: 0; background: var(--nvc-surface); padding: 6px 12px; cursor: pointer; font-size: 13px; }
.nvc-view button[aria-pressed="true"] { background: var(--nvc-ink); color: var(--nvc-button-ink); }

/* Toolbar */
.nvc-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--nvc-line); border-bottom: 1px solid var(--nvc-line); margin-bottom: 16px; }
.nvc-toolbar .nvc-spacer { flex: 1 1 auto; }
.nvc-btn, .nvc-pop > summary {
	display: inline-flex; align-items: center; gap: 6px; list-style: none;
	border: 1px solid var(--nvc-line); background: var(--nvc-surface); color: var(--nvc-ink);
	border-radius: var(--nvc-radius); padding: 6px 12px; font-size: 13px; cursor: pointer; line-height: 1.3;
}
.nvc-pop > summary::-webkit-details-marker { display: none; }
.nvc-btn:hover, .nvc-pop > summary:hover { border-color: #b9bdc6; }
.nvc-btn[aria-pressed="true"], .nvc-btn[aria-expanded="true"] { background: var(--nvc-ink); border-color: var(--nvc-ink); color: var(--nvc-button-ink); }
.nvc-pop { position: relative; }
.nvc-pop[open] > summary { border-color: var(--nvc-ink); }
.nvc-pop-body { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 260px; background: var(--nvc-surface); border: 1px solid var(--nvc-line); border-radius: var(--nvc-radius); padding: 12px; box-shadow: 0 8px 24px rgba(20, 22, 30, .12); }
.nvc-range { display: flex; align-items: center; gap: 8px; }
.nvc-range input { width: 100%; min-width: 0; border: 1px solid var(--nvc-line); border-radius: 4px; padding: 6px 8px; background: var(--nvc-surface); }
.nvc-sort { border: 1px solid var(--nvc-line); border-radius: var(--nvc-radius); padding: 6px 28px 6px 10px; background: var(--nvc-surface); font-size: 13px; }

/* Filter panel */
.nvc-panel { border: 1px solid var(--nvc-line); border-radius: var(--nvc-radius); padding: 16px; margin-bottom: 16px; background: var(--nvc-soft); display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px 24px; }
.nvc-panel[hidden] { display: none; }
.nvc-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.nvc-group > legend { font-weight: 600; font-size: 13px; padding: 0; margin-bottom: 8px; }
.nvc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nvc-chip { position: relative; }
.nvc-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.nvc-chip span { display: inline-block; min-width: 34px; text-align: center; border: 1px solid var(--nvc-line); background: var(--nvc-surface); border-radius: 4px; padding: 4px 9px; font-size: 13px; }
.nvc-chip input:checked + span { background: var(--nvc-ink); border-color: var(--nvc-ink); color: var(--nvc-button-ink); }
.nvc-chip input:focus-visible + span { outline: 2px solid var(--nvc-focus); outline-offset: 2px; }
.nvc-panel-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.nvc-link { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; color: var(--nvc-muted); }

/* Grid */
.nvc-grid { display: grid; grid-template-columns: repeat(var(--nvc-cols, 5), minmax(0, 1fr)); gap: var(--nvc-gap); transition: opacity .15s; }
.nvc-app[aria-busy="true"] .nvc-grid { opacity: .45; }
@media (max-width: 1400px) { .nvc-grid { grid-template-columns: repeat(min(var(--nvc-cols, 5), 4), minmax(0, 1fr)); } }
@media (max-width: 1100px) { .nvc-grid { grid-template-columns: repeat(min(var(--nvc-cols, 5), 3), minmax(0, 1fr)); } }
@media (max-width: 780px)  { .nvc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
@media (max-width: 420px)  { .nvc-grid { grid-template-columns: minmax(0, 1fr); } }

.nvc-card { display: flex; flex-direction: column; border: 1px solid var(--nvc-line); border-radius: var(--nvc-radius); background: var(--nvc-surface); overflow: hidden; }
.nvc-media { display: block; width: 100%; aspect-ratio: 1 / 1; background: var(--nvc-soft); border: 0; padding: 0; cursor: pointer; position: relative; }
.nvc-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nvc-noimg { width: 100%; height: 100%; display: grid; place-items: center; color: var(--nvc-muted); font-size: 13px; }
.nvc-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.nvc-name { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.3; }
.nvc-name button { all: unset; cursor: pointer; }
.nvc-name button:hover { text-decoration: underline; }
.nvc-name button:focus-visible { outline: 2px solid var(--nvc-focus); outline-offset: 2px; }
.nvc-metrics { display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--nvc-muted); font-size: 12px; }
.nvc-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.nvc-badge { border-radius: 3px; padding: 2px 6px; font-size: 11.5px; background: var(--nvc-soft); color: var(--nvc-ink); }
.nvc-badge.is-good { background: var(--nvc-good-soft); color: var(--nvc-good); }
.nvc-facts { margin: 0; padding: 0; list-style: none; color: var(--nvc-muted); font-size: 12px; display: grid; gap: 2px; }
.nvc-price-row { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding-top: 4px; }
.nvc-price-label { color: var(--nvc-muted); font-size: 11.5px; }
.nvc-price { font-size: 16px; font-weight: 700; line-height: 1.2; }
.nvc-price-sub { color: var(--nvc-muted); font-size: 12px; }
.nvc-deal { color: var(--nvc-deal); font-weight: 600; font-size: 13px; }
.nvc-add { width: 100%; border: 0; border-radius: var(--nvc-radius); background: var(--nvc-button); color: var(--nvc-button-ink); padding: 9px 12px; cursor: pointer; font-weight: 500; }
.nvc-add:hover:not(:disabled) { filter: brightness(1.25); }
.nvc-add:disabled { opacity: .6; cursor: default; }

/* List view */
.nvc-app.is-list .nvc-grid { grid-template-columns: minmax(0, 1fr); }
.nvc-app.is-list .nvc-card { flex-direction: row; }
.nvc-app.is-list .nvc-media { width: 160px; flex: 0 0 160px; aspect-ratio: 1 / 1; }
@media (max-width: 560px) { .nvc-app.is-list .nvc-media { width: 110px; flex-basis: 110px; } }

/* States */
.nvc-msg { grid-column: 1 / -1; padding: 40px 12px; text-align: center; color: var(--nvc-muted); }
.nvc-msg strong { display: block; color: var(--nvc-ink); font-size: 15px; margin-bottom: 4px; }
.nvc-skel { border-radius: var(--nvc-radius); background: linear-gradient(100deg, var(--nvc-soft) 30%, #eceef1 50%, var(--nvc-soft) 70%); background-size: 200% 100%; animation: nvc-shimmer 1.4s linear infinite; aspect-ratio: 3 / 4; }
@keyframes nvc-shimmer { to { background-position: -200% 0; } }

/* Pager */
.nvc-pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 22px; }
.nvc-pager .nvc-btn:disabled { opacity: .45; cursor: default; }

/* Toast */
.nvc-toast { position: fixed; z-index: 9999; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(92vw, 460px); background: var(--nvc-ink); color: #fff; border-radius: var(--nvc-radius); padding: 12px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); display: flex; gap: 14px; align-items: center; }
.nvc-toast[hidden] { display: none; }
.nvc-toast a { color: #fff; text-decoration: underline; white-space: nowrap; }

/* Detail dialog */
.nvc-dialog { border: 0; padding: 0; border-radius: 10px; width: min(920px, 94vw); max-height: 92vh; color: var(--nvc-ink); background: var(--nvc-surface); }
.nvc-dialog::backdrop { background: rgba(15, 17, 22, .55); }
.nvc-dialog-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); max-height: 92vh; overflow: auto; }
@media (max-width: 720px) { .nvc-dialog-inner { grid-template-columns: minmax(0, 1fr); } }
.nvc-dialog-media { background: var(--nvc-soft); display: grid; place-items: center; min-height: 260px; }
.nvc-dialog-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.nvc-dialog-body { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.nvc-dialog-body h3 { margin: 0; font-size: 20px; line-height: 1.25; }
.nvc-specs { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.nvc-specs dt { color: var(--nvc-muted); }
.nvc-specs dd { margin: 0; font-weight: 500; }
.nvc-dialog-links { display: flex; gap: 16px; flex-wrap: wrap; }
.nvc-dialog-links a { color: var(--nvc-ink); }
.nvc-close { position: absolute; top: 8px; right: 8px; border: 0; background: var(--nvc-surface); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 20px; line-height: 1; }

.nvc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
	.nvc-skel { animation: none; }
	.nvc-grid { transition: none; }
}
