/* Connectivity Checker widget — dark theme defaults.
   Theming: override the custom properties below from your theme's stylesheet
   to match your brand — everything derives from them.

   For a light site, override in your theme CSS:
   .cc { --cc-ink:#16202c; --cc-muted:#5b6b7c; --cc-line:#dbe2ea;
         --cc-bg:#ffffff; --cc-bg-soft:#f5f8fb; --cc-accent:#0b5fff;
         --cc-accent-dark:#0847bd; --cc-on-accent:#ffffff; } */

.cc {
	--cc-accent: #4d8dff;        /* primary action */
	--cc-accent-dark: #6ba1ff;   /* hover (lighter reads as active on dark) */
	--cc-ink: #e8eef5;           /* headings/body */
	--cc-muted: #9aa8b8;
	--cc-line: #2b3644;
	--cc-bg: #151d27;            /* card surface */
	--cc-bg-soft: #1b2430;
	--cc-radius: 10px;
	--cc-danger: #ff7a70;
	--cc-on-accent: #0b1220;     /* text on accent buttons */

	color: var(--cc-ink);
	max-width: 960px;
	margin: 0 auto;
	font-size: 16px;
	line-height: 1.5;
}

.cc *, .cc *::before, .cc *::after { box-sizing: border-box; }

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

.cc-mockbar {
	background: rgba(232, 200, 90, .12);
	border: 1px solid rgba(232, 200, 90, .45);
	color: #e6cf7a;
	border-radius: var(--cc-radius);
	padding: .5rem .875rem;
	font-size: .875rem;
	margin-bottom: 1rem;
}

/* Doubled .cc.cc selectors beat typical theme rules like
   .entry-content h2 or .site-content p without resorting to !important. */
.cc.cc .cc-title,
.cc.cc .cc-subtitle,
.cc.cc .cc-card-name,
.cc.cc .cc-summary-name,
.cc.cc .cc-done-title,
.cc.cc label,
.cc.cc dd,
.cc.cc p { color: var(--cc-ink); }
.cc.cc a { color: var(--cc-accent); }
.cc.cc a:hover { color: var(--cc-accent-dark); }

.cc-title { margin: 0 0 .25rem; font-size: 1.6rem; line-height: 1.2; }
.cc-subtitle { margin: 1.5rem 0 .5rem; font-size: 1.1rem; }
.cc.cc .cc-sub { margin: 0 0 1.25rem; color: var(--cc-muted); }

/* ── Postcode form ── */
.cc-postcode-form { display: flex; gap: .5rem; flex-wrap: wrap; }
/* All widget inputs: explicit surface + ink so theme form styles can't
   produce white-on-white (or white-on-dark-input) combinations. */
.cc.cc input[type="text"],
.cc.cc input[type="email"],
.cc.cc input[type="tel"],
.cc.cc input[type="number"],
.cc.cc textarea {
	background: var(--cc-bg);
	color: var(--cc-ink);
	border: 1.5px solid var(--cc-line);
}
.cc.cc input::placeholder,
.cc.cc textarea::placeholder { color: var(--cc-muted); opacity: 1; }

.cc-postcode-form input {
	flex: 1 1 220px;
	padding: .8rem 1rem;
	font-size: 1.05rem;
	border-radius: var(--cc-radius);
	text-transform: uppercase;
}
.cc-postcode-form input:focus-visible,
.cc input:focus-visible, .cc textarea:focus-visible, .cc button:focus-visible {
	outline: 2px solid var(--cc-accent);
	outline-offset: 2px;
}

/* ── Buttons ── */
.cc-btn {
	border: 0; cursor: pointer; font: inherit;
	border-radius: var(--cc-radius);
	padding: .8rem 1.4rem;
}
.cc.cc .cc-btn-primary { background: var(--cc-accent); color: var(--cc-on-accent); font-weight: 600; }
.cc.cc .cc-btn-primary:hover { background: var(--cc-accent-dark); color: var(--cc-on-accent); }
.cc-btn-link { background: none; color: var(--cc-muted); padding: .5rem 0; margin-top: 1rem; text-decoration: underline; }
.cc-btn-link:hover { color: var(--cc-ink); }

/* ── Address list ── */
.cc-address-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.cc.cc .cc-address {
	width: 100%; text-align: left; font: inherit; cursor: pointer;
	padding: .8rem 1rem;
	background: var(--cc-bg);
	color: var(--cc-ink);
	border: 1.5px solid var(--cc-line);
	border-radius: var(--cc-radius);
}
.cc-address:hover { border-color: var(--cc-accent); }

/* ── Family toggle ── */
.cc-family-toggle {
	display: inline-flex;
	border: 1.5px solid var(--cc-line);
	border-radius: 999px;
	padding: 3px;
	margin: .75rem 0 1.25rem;
	background: var(--cc-bg-soft);
}
.cc-tab {
	border: 0; background: none; font: inherit; cursor: pointer;
	padding: .45rem 1.1rem; border-radius: 999px; color: var(--cc-muted);
}
.cc.cc .cc-tab.is-active { background: var(--cc-accent); color: var(--cc-on-accent); }
.cc-tab:disabled { opacity: .4; cursor: not-allowed; }

/* ── Product cards ── */
.cc-products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1rem;
}
.cc-card {
	display: flex; flex-direction: column;
	border: 1.5px solid var(--cc-line);
	border-radius: var(--cc-radius);
	padding: 1.1rem;
	background: var(--cc-bg);
}
.cc-card-review { background: var(--cc-bg-soft); }
.cc-card-head { display: flex; flex-direction: column; gap: .3rem; }
.cc-tech {
	align-self: flex-start;
	font-size: .72rem; font-weight: 700; letter-spacing: .06em;
	color: var(--cc-accent);
	border: 1px solid currentColor;
	border-radius: 4px;
	padding: .1rem .4rem;
}
.cc-card-name { margin: 0; font-size: 1.05rem; }

/* Signature element: the speed reading, set like a meter. */
.cc-speed { margin: .8rem 0; }
.cc-speed-big {
	display: block;
	font-size: 2.1rem; font-weight: 750; line-height: 1;
	font-variant-numeric: tabular-nums;
	letter-spacing: -.02em;
}
.cc-speed-up { color: var(--cc-muted); font-size: .85rem; }

.cc-meta { margin: 0 0 .5rem; padding: 0; display: grid; gap: .2rem; font-size: .875rem; }
.cc-meta > div { display: flex; justify-content: space-between; }
.cc-meta dt { color: var(--cc-muted); }
.cc-meta dd { margin: 0; }

.cc-note { font-size: .82rem; color: var(--cc-muted); margin: .25rem 0 .5rem; }

.cc-card-foot {
	margin-top: auto; padding-top: .75rem;
	border-top: 1px solid var(--cc-line);
	display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.cc-price { margin: 0; }
.cc-price strong { font-size: 1.25rem; }
.cc-price span { color: var(--cc-muted); font-size: .8rem; display: block; }

.cc-empty { color: var(--cc-muted); }

/* ── Checkout ── */
.cc-summary-inner {
	border: 1.5px solid var(--cc-line);
	border-left: 4px solid var(--cc-accent);
	border-radius: var(--cc-radius);
	padding: .9rem 1.1rem;
	margin-bottom: 1rem;
}
.cc-summary-name { margin: 0; font-weight: 650; }
.cc-summary-addr { margin: .15rem 0; color: var(--cc-muted); font-size: .9rem; }
.cc-summary-price { margin: .15rem 0 0; }
.cc-summary-review { margin: .5rem 0 0; font-size: .875rem; color: var(--cc-muted); }

.cc-voip-items { display: grid; gap: .5rem; margin-bottom: 1rem; }
.cc-voip-item {
	display: flex; align-items: center; justify-content: space-between; gap: 1rem;
	border: 1.5px solid var(--cc-line);
	border-radius: var(--cc-radius);
	padding: .7rem .9rem;
}
.cc-voip-info small { display: block; color: var(--cc-muted); }
.cc-voip-item input { width: 5rem; padding: .45rem; border: 1.5px solid var(--cc-line); border-radius: 6px; }

.cc-order-form { display: block; }
.cc-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: .75rem;
	margin-bottom: .75rem;
}
.cc-order-form label { display: block; font-size: .9rem; }
.cc-order-form input[type="text"],
.cc-order-form input[type="email"],
.cc-order-form input[type="tel"],
.cc-order-form textarea {
	width: 100%; margin-top: .25rem;
	padding: .65rem .8rem; font: inherit;
	border: 1.5px solid var(--cc-line);
	border-radius: var(--cc-radius);
}
.cc-full { margin-bottom: .75rem; }
.cc-check { display: flex !important; gap: .5rem; align-items: flex-start; margin: .4rem 0; }
.cc-check input { margin-top: .2rem; }
.cc-hp { position: absolute; left: -9999px; height: 0; width: 0; opacity: 0; }
.cc-place-order { margin-top: 1rem; }

.cc-error { color: var(--cc-danger); margin: .75rem 0 0; }

/* ── Done ── */
.cc-done-ref { color: var(--cc-muted); font-size: .9rem; }

/* ── Loading ── */
.cc-loading { text-align: center; padding: 3rem 0; }
.cc-pulse {
	width: 44px; height: 44px; margin: 0 auto 1rem;
	border-radius: 50%;
	border: 4px solid var(--cc-line);
	border-top-color: var(--cc-accent);
	animation: cc-spin .9s linear infinite;
}
.cc-loading-text { color: var(--cc-muted); }
@keyframes cc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
	.cc-pulse { animation: none; }
	.cc { scroll-behavior: auto; }
}

@media (max-width: 560px) {
	.cc-title { font-size: 1.3rem; }
	.cc-card-foot { flex-direction: column; align-items: stretch; text-align: center; }
}

/* Manual address entry */
.cc-manual { margin-top: 1rem; }
.cc-manual-form { display: grid; gap: .75rem; max-width: 480px; }
.cc-manual-form label { font-size: .9rem; }
.cc-manual-form input { width: 100%; margin-top: .25rem; padding: .65rem .8rem; font: inherit; border-radius: var(--cc-radius); }
.cc-manual-toggle { display: block; }
