/* ==========================================================================
   Creditory Tradeline System — Frontend Styles
   ========================================================================== */

/* ---- 1. Design tokens --------------------------------------------------- */

.cts-site {
	--cts-navy:       #0f2a44;
	--cts-navy-mid:   #163655;
	--cts-navy-dark:  #071523;
	--cts-gold:       #c9a24d;
	--cts-amber:      #e8920a;
	--cts-gold-pale:  #f6eddb;
	--cts-bg:         #f0f3f7;
	--cts-surface:    #ffffff;
	--cts-border:     #dce3ed;
	--cts-border-lt:  #edf2f7;
	--cts-text:       #0f172a;
	--cts-muted:      #64748b;
	--cts-success:    #059669;
	--cts-error:      #dc2626;
	--cts-r:          10px;
	--cts-shadow-xs:  0 1px 3px rgba(15,42,68,.07);
	--cts-shadow-sm:  0 2px 8px rgba(15,42,68,.08);
	--cts-shadow:     0 4px 20px rgba(15,42,68,.10);
	--cts-shadow-lg:  0 12px 44px rgba(15,42,68,.14);

	background:   var(--cts-bg);
	box-sizing:   border-box;
	color:        var(--cts-text);
	font-family:  "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	margin:       0 calc(50% - 50vw) 0;
	min-height:   100vh;
	width:        100vw;
}

.cts-site *,
.cts-site *::before,
.cts-site *::after {
	box-sizing: inherit;
}

/* ---- 2. Header ---------------------------------------------------------- */

.cts-brand-header {
	background:    #fff;
	border-bottom: 1px solid rgba(15,42,68,.09);
	box-shadow:    0 2px 14px rgba(15,42,68,.07);
	clip:          auto !important;
	clip-path:     none !important;
	overflow:      visible !important;
	position:      sticky;
	top:           0;
	z-index:       100;
}

.admin-bar .cts-brand-header {
	top: 32px;
}
/* Mobile admin bar is 46px tall — sticky header must clear it fully */
@media screen and (max-width: 782px) {
	.admin-bar .cts-brand-header {
		top: 46px;
	}
}

.cts-brand-inner {
	align-items:  center;
	display:      flex;
	gap:          16px;
	margin:       0 auto;
	max-width:    1280px;
	min-height:   52px;
	overflow:     visible !important;
	padding:      6px 24px;
}

.cts-brand-logo {
	align-items:     center;
	display:         flex;
	flex:            0 0 auto;
	text-decoration: none;
}

.cts-brand-logo img {
	display:   block;
	height:    auto;
	max-width: 175px;
	width:     100%;
}

.cts-brand-nav {
	align-items:     center;
	display:         flex;
	flex:            1 1 auto;
	gap:             4px;
	justify-content: center;
	min-width:       0;
}

.cts-brand-nav a {
	border-radius:   7px;
	color:           var(--cts-navy);
	font-size:       14px;
	font-weight:     600;
	padding:         7px 13px;
	text-decoration: none;
	transition:      background 150ms, color 150ms;
	white-space:     nowrap;
}

.cts-brand-nav a:hover,
.cts-brand-nav a:focus {
	background: var(--cts-gold-pale);
	color:      var(--cts-gold);
}

.cts-brand-nav a.is-active,
.cts-brand-nav a[aria-current="page"] {
	background:  rgba(201,162,77,.13);
	color:       #9b7320;
	font-weight: 700;
}

.cts-nav-live {
	align-items: center;
	display:     inline-flex !important;
	gap:         6px;
}
.cts-nav-live::before {
	animation:     cts-nav-pulse 1.8s ease-in-out infinite;
	background:    #22c55e;
	border-radius: 50%;
	content:       '';
	display:       inline-block;
	flex-shrink:   0;
	height:        7px;
	width:         7px;
}
@keyframes cts-nav-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.6); opacity: 1; }
	50%       { box-shadow: 0 0 0 5px rgba(34,197,94,0); opacity: .7; }
}

.cts-brand-cta {
	align-items:     center;
	background:      var(--cts-navy);
	border:          0;
	border-radius:   8px;
	color:           #fff;
	display:         inline-flex;
	flex:            0 0 auto;
	font-size:       13.5px;
	font-weight:     700;
	min-height:      40px;
	padding:         9px 17px;
	text-decoration: none;
	transition:      background 150ms, transform 120ms;
	white-space:     nowrap;
}

.cts-brand-cta:hover,
.cts-brand-cta:focus {
	background: var(--cts-navy-dark);
	color:      #fff;
	transform:  translateY(-1px);
}

/* Hamburger */
.cts-nav-toggle {
	-webkit-appearance: none;
	appearance:         none;
	-webkit-tap-highlight-color: transparent;
	align-items:   center;
	background:    transparent !important;
	border:        0 !important;
	box-shadow:    none !important;
	color:         var(--cts-navy);
	cursor:        pointer;
	display:       none;
	flex:          0 0 auto;
	justify-content: center;
	margin-left:   auto;
	outline:       none;
	overflow:      visible;
	padding:       10px 10px;
	position:      relative;
	touch-action:  manipulation;
	z-index:       200;
}
.cts-nav-toggle:hover,
.cts-nav-toggle:focus,
.cts-nav-toggle:active {
	background: transparent !important;
	box-shadow: none !important;
	outline:    none !important;
}

/* SVG icons — swap on open */
.cts-icon-menu  { display: block !important; }
.cts-icon-close { display: none  !important; }
.cts-nav-toggle.is-open .cts-icon-menu  { display: none  !important; }
.cts-nav-toggle.is-open .cts-icon-close { display: block !important; }

/* ---- 3. Buttons --------------------------------------------------------- */

.cts-button {
	align-items:     center;
	background:      var(--cts-navy);
	border:          0;
	border-radius:   6px;
	color:           #fff;
	cursor:          pointer;
	display:         inline-flex;
	font-family:     inherit;
	font-size:       14px;
	font-weight:     700;
	gap:             7px;
	justify-content: center;
	line-height:     1.2;
	min-height:      46px;
	padding:         12px 20px;
	text-decoration: none !important;
	transition:      background 150ms, transform 120ms;
	white-space:     nowrap;
}

/* ---- 30. Footer --------------------------------------------------------- */

.cts-site-footer {
	background: var(--cts-navy-dark);
	color:      rgba(255,255,255,.7);
	padding:    52px 24px 28px;
}

.cts-footer-grid {
	display:               grid;
	gap:                   36px;
	grid-template-columns: 1.8fr 1fr 1fr 1fr;
	margin:                0 auto;
	max-width:             1280px;
}

.cts-footer-grid > div > strong {
	color:       #fff;
	display:     block;
	font-size:   24px;
	font-weight: 800;
	margin-bottom: 11px;
}

.cts-footer-grid > div > p {
	font-size:   14px;
	line-height: 1.7;
	margin:      0;
	max-width:   340px;
}

.cts-footer-grid h2 {
	color:          #fff;
	font-size:      11.5px;
	font-weight:    800;
	letter-spacing: .08em;
	margin:         0 0 14px;
	text-transform: uppercase;
}

.cts-footer-grid a,
.cts-footer-grid span {
	color:           rgba(255,255,255,.62);
	display:         block;
	font-size:       14px;
	margin:          8px 0;
	text-decoration: none;
	transition:      color 140ms;
}

.cts-footer-grid a:hover,
.cts-footer-grid a:focus { color: #f6d98b; }

.cts-footer-bottom {
	border-top:      1px solid rgba(255,255,255,.1);
	display:         flex;
	gap:             16px;
	justify-content: space-between;
	margin:          34px auto 0;
	max-width:       1280px;
	padding-top:     18px;
}

.cts-footer-bottom span {
	color:     rgba(255,255,255,.48);
	font-size: 13px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1180px) {
	.cts-grid         { grid-template-columns: repeat(2, minmax(0,1fr)); }
	.cts-footer-grid  { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 960px) {
	/* Hamburger visible */
	.cts-nav-toggle { align-items: center; color: #0f2a44; display: flex !important; justify-content: center; }

	/* Nav becomes a mobile dropdown */
	.cts-brand-nav {
		align-items:    stretch;
		background:     #fff;
		border-top:     1px solid var(--cts-border-lt);
		box-shadow:     var(--cts-shadow-lg);
		display:        none;
		flex-direction: column;
		gap:            0;
		left:           0;
		padding:        8px 16px 20px;
		position:       absolute;
		right:          0;
		top:            100%;
		z-index:        9999;
	}

	.cts-brand-nav.is-open { display: flex; }

	.cts-brand-nav > a {
		border-radius: 10px;
		font-size:     15px;
		font-weight:   600;
		padding:       11px 14px;
		width:         100%;
	}

	.cts-brand-header { position: relative; }

	.cts-hero {
		grid-template-columns: 1fr;
		padding: 48px 20px 40px;
	}

	.cts-hero h1 { font-size: 36px; }

	.cts-listing-layout,
	.cts-checkout-form,
	.cts-footer-grid  { grid-template-columns: 1fr; }

	.cts-filters      { position: static; }

	.cts-order-summary {
		grid-row:   auto;
		margin-top: 0;
		position:   static;
	}
}

@media (max-width: 640px) {
	.cts-site { margin-top: 0; }

	.cts-brand-inner    { gap: 10px; min-height: auto; padding: 12px 16px; }
	.cts-brand-logo img { max-width: 140px; }
	.cts-brand-cta      { display: none; }

	.cts-hero h1       { font-size: 28px; }
	.cts-hero p        { font-size: 15px; }
	.cts-hero-actions  { flex-direction: row; flex-wrap: nowrap; }
	.cts-hero-actions .cts-button { flex: 1; font-size: 12px; min-height: 38px; padding: 9px 10px; }

	.cts-wrap { padding: 22px 16px 48px; }
}

/* ==========================================================================
   Dropdown Nav
   ========================================================================== */

.cts-nav-dropdown-wrap {
	position: relative !important;
	display:  inline-block !important;
}

.cts-nav-dropdown-wrap > a {
	align-items: center !important;
	display:     inline-flex !important;
	gap:         5px !important;
}

.cts-dropdown-arrow {
	flex-shrink: 0;
	transition:  transform 200ms ease;
}

.cts-nav-dropdown-wrap:hover .cts-dropdown-arrow,
.cts-nav-dropdown-wrap.is-open .cts-dropdown-arrow {
	transform: rotate(180deg);
}

/* Hidden by default — display:none beats any opacity/visibility conflict */
.cts-dropdown-menu {
	background:    #fff !important;
	border:        1px solid rgba(15,42,68,.10) !important;
	border-radius: 12px !important;
	box-shadow:    0 8px 32px rgba(15,42,68,.14) !important;
	display:       none !important;
	left:          0 !important;
	min-width:     220px !important;
	padding:       8px !important;
	position:      absolute !important;
	top:           calc(100% + 6px) !important;
	z-index:       9999 !important;
}

/* Show on hover (desktop) or .is-open (JS toggle) */
.cts-nav-dropdown-wrap:hover .cts-dropdown-menu,
.cts-nav-dropdown-wrap.is-open .cts-dropdown-menu {
	display: block !important;
}

.cts-dropdown-item {
	align-items:     center !important;
	border-radius:   8px !important;
	color:           #0f2a44 !important;
	display:         flex !important;
	font-size:       14px !important;
	font-weight:     600 !important;
	gap:             10px !important;
	margin:          0 !important;
	padding:         9px 12px !important;
	text-decoration: none !important;
	transition:      background 140ms;
	white-space:     nowrap !important;
}

.cts-dropdown-item:hover,
.cts-dropdown-item:focus {
	background: #f6eddb !important;
	color:      #c9a24d !important;
}

.cts-dropdown-item.is-active {
	background:  rgba(201,162,77,.13) !important;
	color:       #9b7320 !important;
	font-weight: 700 !important;
}

.cts-di-icon {
	flex-shrink: 0;
	font-size:   15px;
	line-height: 1;
	width:       20px;
	text-align:  center;
}

/* Mobile */
@media (max-width: 960px) {
	.cts-nav-dropdown-wrap {
		display: block !important;
		width:   100%;
	}
	.cts-nav-dropdown-wrap > a {
		border-radius: 10px;
		font-size:     15px;
		font-weight:   600;
		padding:       11px 14px !important;
		width:         100%;
	}
	.cts-dropdown-menu {
		background: transparent !important;
		border:     none !important;
		box-shadow: none !important;
		left:       0 !important;
		padding:    4px 0 4px 16px !important;
		position:   static !important;
		top:        auto !important;
		z-index:    auto !important;
	}
	.cts-nav-dropdown-wrap.is-open .cts-dropdown-menu {
		display: block !important;
	}
}


/* ==========================================================================
   COIS Modal — creditory-site-chrome v1.0.9
   ========================================================================== */

/* Overlay */
.csc-modal-overlay {
	position:        fixed;
	inset:           0;
	background:      rgba(15, 42, 68, 0.60);
	z-index:         999998;
	display:         flex;
	align-items:     center;
	justify-content: center;
	padding:         16px;
	box-sizing:      border-box;
}
.csc-modal-overlay[hidden] { display: none !important; }

/* Inner card */
.csc-modal-inner {
	background:    #fff;
	border-radius: 20px;
	box-shadow:    0 24px 80px rgba(15,42,68,.30);
	max-width:     760px;
	width:         100%;
	max-height:    90vh;
	overflow-y:    auto;
	position:      relative;
	display:       flex;
	flex-direction: column;
	scroll-behavior: smooth;
}

/* Close button */
.csc-modal-close {
	background:    rgba(15,42,68,.08);
	border:        none;
	border-radius: 50%;
	color:         #0f2a44;
	cursor:        pointer;
	font-size:     20px;
	height:        36px;
	line-height:   1;
	position:      absolute;
	right:         16px;
	top:           16px;
	width:         36px;
	z-index:       2;
	transition:    background 140ms;
}
.csc-modal-close:hover { background: rgba(15,42,68,.16); }

/* ── COIS Section ── */
.csc-cois-section {
	background:  linear-gradient(135deg, #0f2a44 0%, #163a5e 100%);
	border-radius: 20px 20px 0 0;
	color:       #fff;
	padding:     40px 36px 36px;
	text-align:  center;
}

/* FREE badge */
.csc-cois-badge {
	background:    #c9a24d;
	border-radius: 100px;
	color:         #0f2a44;
	display:       inline-block;
	font-size:     13px;
	font-weight:   700;
	letter-spacing: 0.5px;
	padding:       5px 18px;
	text-transform: uppercase;
	margin-bottom: 18px;
}
.csc-cois-badge-premium {
	background: #1a3a5c;
	border:     1px solid rgba(201,162,77,.35);
	color:      #c9a24d;
}

.csc-cois-title {
	color:         #fff;
	font-size:     28px;
	font-weight:   800;
	line-height:   1.2;
	margin:        0 0 14px;
}
.csc-cois-title span {
	background:              linear-gradient(90deg, #c9a24d, #f0d080);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip:         text;
}

.csc-cois-desc {
	color:         rgba(255,255,255,.82);
	font-size:     15px;
	line-height:   1.6;
	margin:        0 0 24px;
	max-width:     520px;
	margin-left:   auto;
	margin-right:  auto;
}

/* CTA button */
.csc-cois-cta {
	background:    #c9a24d;
	border:        none;
	border-radius: 100px;
	color:         #fff;
	cursor:        pointer;
	display:       inline-block;
	font-size:     15px;
	font-weight:   800;
	letter-spacing: 0.3px;
	padding:       14px 32px;
	text-decoration: none;
	transition:    transform 140ms, box-shadow 140ms;
	box-shadow:    0 4px 18px rgba(201,162,77,.40);
}
.csc-cois-cta:hover {
	transform:  translateY(-2px);
	box-shadow: 0 8px 28px rgba(201,162,77,.55);
}
.csc-cois-cta-locked {
	background: rgba(255,255,255,.12);
	box-shadow: none;
	color:      rgba(255,255,255,.65);
}
.csc-cois-cta-locked:hover {
	background: rgba(255,255,255,.18);
	transform:  none;
	box-shadow: none;
}

.csc-cois-free-note {
	color:       rgba(255,255,255,.60);
	font-size:   12px;
	margin:      14px 0 0;
}

/* Upgrade popup */
.csc-upgrade-popup {
	background:    rgba(255,255,255,.10);
	border:        1px solid rgba(255,255,255,.20);
	border-radius: 12px;
	color:         #fff;
	margin-top:    16px;
	padding:       20px 24px;
	text-align:    left;
}
.csc-upgrade-popup p { font-size: 14px; margin: 0 0 8px; }
.csc-upgrade-popup button {
	background: transparent;
	border:     1px solid rgba(255,255,255,.30);
	border-radius: 8px;
	color:      rgba(255,255,255,.70);
	cursor:     pointer;
	font-size:  12px;
	margin-top: 10px;
	padding:    6px 14px;
}

/* ── Tradelines Section ── */
.csc-tl-section {
	border-top: 1px solid rgba(15,42,68,.08);
	padding:    32px 36px 36px;
}

.csc-tl-header {
	align-items:     center;
	display:         flex;
	gap:             12px;
	justify-content: space-between;
	margin-bottom:   12px;
	flex-wrap:       wrap;
}

.csc-tl-title {
	color:       #0f2a44;
	font-size:   20px;
	font-weight: 800;
	margin:      0;
}

.csc-tl-live {
	align-items:   center;
	background:    #f0faf0;
	border:        1px solid #b8e0b8;
	border-radius: 100px;
	color:         #2a7a2a;
	display:       inline-flex;
	font-size:     12px;
	font-weight:   700;
	gap:           6px;
	padding:       4px 12px;
}

.csc-tl-desc {
	color:         #4a6075;
	font-size:     14px;
	line-height:   1.6;
	margin:        0 0 24px;
}

/* Feature grid */
.csc-tl-features {
	display:               grid;
	grid-template-columns: 1fr 1fr;
	gap:                   12px;
	margin-bottom:         28px;
}

.csc-tl-feature {
	align-items:   flex-start;
	background:    #f8fafc;
	border:        1px solid rgba(15,42,68,.08);
	border-radius: 12px;
	display:       flex;
	gap:           12px;
	padding:       14px 16px;
}

.csc-tl-feat-icon {
	flex-shrink: 0;
	font-size:   20px;
	line-height: 1;
}

.csc-tl-feature > div {
	display:        flex;
	flex-direction: column;
	gap:            2px;
}
.csc-tl-feature strong {
	color:       #0f2a44;
	font-size:   13px;
	font-weight: 700;
}
.csc-tl-feature span {
	color:     #6b88a0;
	font-size: 12px;
}

/* Browse button */
.csc-tl-browse-btn {
	background:    #0f2a44;
	border:        2px solid #0f2a44;
	border-radius: 100px;
	color:         #fff;
	display:       inline-block;
	font-size:     15px;
	font-weight:   700;
	padding:       13px 28px;
	text-decoration: none;
	transition:    background 140ms, color 140ms, border-color 140ms, transform 140ms;
}
.csc-tl-browse-btn:hover {
	background: #fff;
	color:      #0f2a44;
	border-color: #0f2a44;
	transform:  translateY(-1px);
}

/* Responsive */
@media (max-width: 640px) {
	.csc-cois-section { padding: 36px 20px 28px; }
	.csc-cois-title   { font-size: 22px; }
	.csc-tl-section   { padding: 24px 20px 28px; }
	.csc-tl-features  { grid-template-columns: 1fr; }
}

/* Extra-compact for small phones (≤400px) */
@media (max-width: 400px) {
	.csc-modal-overlay { align-items: flex-start; padding: 0; }
	.csc-modal-inner   { max-height: 100dvh; overflow-y: auto; border-radius: 0; width: 100%; }
	.csc-modal-close   { top: 8px; right: 10px; width: 28px; height: 28px; font-size: 16px; }
	.csc-cois-section  { padding: 28px 16px 20px; }
	.csc-cois-badge    { font-size: 10px; padding: 4px 10px; margin-bottom: 10px; }
	.csc-cois-title    { font-size: 18px; line-height: 1.25; margin-bottom: 8px; }
	.csc-cois-title span { font-size: 18px; }
	.csc-cois-desc     { font-size: 12px; margin-bottom: 14px; }
	.csc-cois-cta      { font-size: 13px; padding: 11px 18px; }
	.csc-cois-free-note { font-size: 11px; margin-top: 8px; }
	.csc-tl-section    { padding: 18px 16px 22px; }
	.csc-tl-title      { font-size: 16px; }
	.csc-tl-features   { grid-template-columns: 1fr; gap: 8px; margin: 12px 0; }
	.csc-tl-browse-btn { font-size: 13px; padding: 10px 20px; }
}
