/* ==========================================================================
   abccom.css - ABC Auto Parts public site
   Token-driven skin over Bootstrap 5.3. Loaded after bootstrap.min.css and
   fontawesome, before overrides.css. No jQuery, no plugin themes.

   Brand carried over from the legacy skel/dropotron build:
     navy  #25408F   red #D1252A   page #f0f0f0 on white content
     uppercase, letter-spaced headings; red hairline under the header with a
     blue underline beneath it.
   ========================================================================== */

:root {
	/* brand palette */
	--abc-blue:        #25408F;
	--abc-blue-600:    #1d3373;
	--abc-blue-300:    #5a72b8;
	--abc-red:         #D1252A;
	--abc-red-600:     #b01e22;
	--abc-ink:         #33383d;
	--abc-muted:       #6b7280;
	--abc-line:        #e3e7ec;
	--abc-bg:          #f0f0f0;
	--abc-surface:     #ffffff;

	/* form fields - tinted so they never blend into a white panel */
	--abc-input-bg:     #eef1f5;
	--abc-input-border: #b9c2cd;
	--abc-input-addon:  #dde3ea;

	/* shape + motion */
	--abc-radius:      .5rem;
	--abc-radius-sm:   .3rem;
	--abc-shadow-sm:   0 1px 2px rgba(28, 39, 51, .06);
	--abc-shadow:      0 2px 10px rgba(28, 39, 51, .10);
	--abc-speed:       .2s;

	/* Bootstrap mappings - keep the -rgb triplets in sync or BS components
	   (buttons, links, alerts, focus rings) will not follow the brand. */
	--bs-primary:            #25408F;
	--bs-primary-rgb:        37, 64, 143;
	--bs-danger:             #D1252A;
	--bs-danger-rgb:         209, 37, 42;
	--bs-link-color:         #25408F;
	--bs-link-color-rgb:     37, 64, 143;
	--bs-link-hover-color:   #D1252A;
	--bs-body-color:         #33383d;
	--bs-body-bg:            #f0f0f0;
	--bs-border-color:       #e3e7ec;
	--bs-border-radius:      .5rem;
	--bs-font-sans-serif:    "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
body {
	font-family: var(--bs-font-sans-serif);
	background: var(--abc-bg);
	color: var(--abc-ink);
	font-size: 1rem;
	line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
	text-transform: uppercase;
	font-weight: 600;
	letter-spacing: .06em;
	color: var(--abc-ink);
}

h1, .h1 { letter-spacing: .08em; }

a { text-decoration: none; transition: color var(--abc-speed) ease-in-out; }
a:hover { color: var(--abc-red); }

hr { border-top: 1px solid var(--abc-line); opacity: 1; }

/* --------------------------------------------------------------------------
   Header / navigation
   Red hairline with a blue underline beneath it, mirroring the legacy header.
   Sticky rather than fixed: sticky keeps the header in normal flow, so the
   content below is not hidden underneath it and no body padding offset is
   needed. scroll-padding-top on <html> keeps in-page anchor targets from
   landing behind the bar.
   -------------------------------------------------------------------------- */
html { scroll-padding-top: 6.5rem; }

.site-header {
	position: sticky;
	top: 0;
	z-index: 1030;
	background: var(--abc-surface);
	border-bottom: 3px solid var(--abc-red) !important;
	box-shadow: inset 0 -3px 0 0 var(--abc-blue), var(--abc-shadow-sm);
	transition: box-shadow var(--abc-speed) ease-in-out;
}

/* Slightly stronger shadow once the page has scrolled, so the bar reads as
   floating above the content rather than painted onto it. */
.site-header.is-stuck {
	box-shadow: inset 0 -3px 0 0 var(--abc-blue), 0 4px 12px rgba(28, 39, 51, .12);
}

/* On short viewports the collapsed mobile menu could overflow the screen with
   the header pinned, so let it scroll independently. */
@media (max-width: 991.98px) {
	.site-header .navbar-collapse {
		max-height: calc(100vh - 6rem);
		overflow-y: auto;
	}
}

.site-header .navbar { padding-block: .75rem; }

.site-header .navbar-brand img {
	height: 48px;
	width: auto;
	display: block;
}

.site-header .nav-link {
	text-transform: uppercase;
	font-size: .8rem;
	font-weight: 600;
	letter-spacing: .1em;
	color: var(--abc-muted);
	padding-inline: .9rem;
	border-bottom: 2px solid transparent;
	transition: color var(--abc-speed) ease-in-out, border-color var(--abc-speed) ease-in-out;
}

.site-header .nav-link i { color: var(--abc-blue-300); transition: color var(--abc-speed) ease-in-out; }

.site-header .nav-link:hover,
.site-header .nav-link:focus-visible { color: var(--abc-red); }
.site-header .nav-link:hover i { color: var(--abc-red); }

.site-header .nav-link.active {
	color: var(--abc-blue);
	border-bottom-color: var(--abc-red);
}
.site-header .nav-link.active i { color: var(--abc-red); }

.navbar-toggler { border-color: var(--abc-line); }
.navbar-toggler:focus { box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .25); }

/* --------------------------------------------------------------------------
   Content surfaces
   -------------------------------------------------------------------------- */
main { background: var(--abc-surface); }

.card {
	border: 1px solid var(--abc-line);
	border-radius: var(--abc-radius);
	box-shadow: var(--abc-shadow-sm);
	transition: box-shadow var(--abc-speed) ease-in-out;
}
.card:hover { box-shadow: var(--abc-shadow); }

.card-body { padding: 1.75rem; }

/* Section heading with a short red rule underneath. */
.section-title {
	position: relative;
	padding-bottom: .75rem;
	margin-bottom: 2rem;
}
.section-title::after {
	content: "";
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	bottom: 0;
	width: 64px;
	height: 3px;
	background: var(--abc-red);
	border-radius: 2px;
}
.section-title.text-start::after { left: 0; transform: none; }

/* --------------------------------------------------------------------------
   Home page: B2B portal logos and app store badges
   -------------------------------------------------------------------------- */
.b2blogo {
	display: block;
	max-width: 260px;
	width: 60%;
	height: auto;
	margin-inline: auto;
}

.storebadges { text-align: center; }
.storebadges img {
	width: 120px;
	max-width: 30%;
	height: auto;
	margin: .25rem;
	display: inline-block;
	transition: opacity var(--abc-speed) ease-in-out;
}
.storebadges a:hover img { opacity: .75; }

/* --------------------------------------------------------------------------
   Forms
   Inputs sit on white panels, so a white field disappears into the card. They get
   a tinted fill and a stronger border to read as an editable target, then flip to
   white on focus so the active field stands out from the rest of the form.
   -------------------------------------------------------------------------- */
.form-control, .form-select {
	background-color: var(--abc-input-bg);
	border: 1px solid var(--abc-input-border);
	border-radius: var(--abc-radius-sm);
	padding: .6rem .85rem;
	color: var(--abc-ink);
	transition: background-color var(--abc-speed) ease-in-out, border-color var(--abc-speed) ease-in-out, box-shadow var(--abc-speed) ease-in-out;
}

.form-control:hover:not(:disabled):not([readonly]),
.form-select:hover:not(:disabled) { border-color: var(--abc-blue-300); }

.form-control:focus, .form-select:focus {
	background-color: #fff;
	border-color: var(--abc-blue);
	box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .18);
}

.form-control::placeholder { color: #8b949e; opacity: 1; }

.form-control:disabled, .form-control[readonly] {
	background-color: #e9ecef;
	color: var(--abc-muted);
}

/* Input-group add-ons share the field fill so the control reads as one unit. */
.input-group-text {
	background-color: var(--abc-input-addon);
	border: 1px solid var(--abc-input-border);
	color: var(--abc-muted);
}

/* Checkboxes and radios need the same treatment or they vanish too. */
.form-check-input {
	background-color: var(--abc-input-bg);
	border: 1px solid var(--abc-input-border);
}
.form-check-input:checked {
	background-color: var(--abc-blue);
	border-color: var(--abc-blue);
}
.form-check-input:focus {
	border-color: var(--abc-blue);
	box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .18);
}

label.form-label {
	text-transform: uppercase;
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .08em;
	color: var(--abc-muted);
	margin-bottom: .35rem;
}

/* --------------------------------------------------------------------------
   Validation states
   Bootstrap's .is-invalid / .is-valid are applied by JustValidate on the client and
   re-applied server-side on redisplay, so both paths look identical. Bootstrap's
   own state icons are suppressed on selects and textareas, where they collide with
   the caret and the resize grip.
   -------------------------------------------------------------------------- */
.form-control.is-invalid, .form-select.is-invalid {
	border-color: var(--abc-red);
	background-color: #fdf3f3;
}
.form-control.is-invalid:focus, .form-select.is-invalid:focus {
	border-color: var(--abc-red);
	box-shadow: 0 0 0 .2rem rgba(var(--bs-danger-rgb), .2);
}

.form-control.is-valid, .form-select.is-valid {
	border-color: #198754;
	background-color: #f4faf6;
}
.form-control.is-valid:focus, .form-select.is-valid:focus {
	border-color: #198754;
	box-shadow: 0 0 0 .2rem rgba(25, 135, 84, .2);
}

.form-check-input.is-invalid { border-color: var(--abc-red); }
.form-check-input.is-valid   { border-color: #198754; }

.form-select.is-invalid, .form-select.is-valid,
textarea.form-control.is-invalid, textarea.form-control.is-valid { background-image: none; }

.invalid-feedback, .errmsg {
	color: var(--abc-red);
	font-size: .8rem;
	font-weight: 600;
}
.valid-feedback {
	color: #198754;
	font-size: .8rem;
	font-weight: 600;
}

/* Required-field marker, carried over from the legacy build. */
.required::after { content: " *"; color: var(--abc-red); font-weight: 700; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
	text-transform: uppercase;
	font-size: .8rem;
	font-weight: 600;
	letter-spacing: .08em;
	border-radius: var(--abc-radius-sm);
	padding: .65rem 1.6rem;
	transition: background-color var(--abc-speed) ease-in-out, border-color var(--abc-speed) ease-in-out;
}

.btn-primary {
	background-color: var(--abc-blue);
	border-color: var(--abc-blue);
}
.btn-primary:hover, .btn-primary:focus {
	background-color: var(--abc-blue-600);
	border-color: var(--abc-blue-600);
}

.btn-danger { background-color: var(--abc-red); border-color: var(--abc-red); }
.btn-danger:hover { background-color: var(--abc-red-600); border-color: var(--abc-red-600); }

.btn-outline-primary { color: var(--abc-blue); border-color: var(--abc-blue); }
.btn-outline-primary:hover { background-color: var(--abc-blue); border-color: var(--abc-blue); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
	background: var(--abc-bg);
	border-top: 3px solid var(--abc-line) !important;
	color: var(--abc-muted);
	font-size: .9rem;
}
.site-footer h2 { font-size: .9rem; color: var(--abc-ink); }
.site-footer a { color: var(--abc-blue); }
.site-footer a:hover { color: var(--abc-red); }
.site-footer i { color: var(--abc-blue-300); width: 1.1em; text-align: center; }
/* The opt-in sits on the gray footer, so its fields need to go lighter than the
   surface rather than darker - the inverse of the on-white treatment above. */
.site-footer .form-control {
	background-color: #fff;
	border-color: var(--abc-input-border);
}
.site-footer .form-control:focus { background-color: #fff; }

/* --------------------------------------------------------------------------
   Tech tip videos grid (legacy .ttvid retained for any inline references)
   -------------------------------------------------------------------------- */
.ttvid {
	display: inline-block;
	width: 24%;
	min-width: 220px;
	text-align: center;
	margin: 1rem .3rem;
	vertical-align: top;
}

/* --------------------------------------------------------------------------
   Tech tip videos
   A <video> with preload="none" has no intrinsic size until playback starts, so
   the browser uses its 300x150 default and the element visibly jumps when the
   clip loads. Pinning the aspect ratio reserves the correct box up front, so the
   preview and the playing video are the same size.
   -------------------------------------------------------------------------- */
.ttvid-frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: var(--abc-radius-sm);
	overflow: hidden;
	cursor: pointer;
}

.ttvid-frame video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #000;
	display: block;
}

/* Centered play affordance, hidden once playback begins. Pointer events pass
   through so a click anywhere - including on the badge - reaches the video. */
.ttvid-frame .ttvid-play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 3rem;
	text-shadow: 0 2px 12px rgba(0, 0, 0, .6);
	pointer-events: none;
	opacity: .9;
	transition: opacity var(--abc-speed) ease-in-out;
}

.ttvid-frame:hover .ttvid-play { opacity: 1; }
.ttvid-frame.is-playing .ttvid-play { opacity: 0; }

/* --------------------------------------------------------------------------
   Promotions
   -------------------------------------------------------------------------- */
.avlpromo {
	display: inline-block;
	width: 10em;
	text-align: center;
	margin: 0 1em 1.5em;
}
.avlpromo img { width: 100px; height: auto; }

/* Inline promo-code trigger: an icon sized to sit in a sentence, not a button. */
.promo-code-trigger {
	display: inline-block;
	color: var(--abc-red);
	font-size: 1.35rem;
	line-height: 1;
	vertical-align: -.15em;
	margin-inline: .15rem;
	transition: transform var(--abc-speed) ease-in-out, color var(--abc-speed) ease-in-out;
}
.promo-code-trigger:hover,
.promo-code-trigger:focus-visible {
	color: var(--abc-blue);
	transform: scale(1.15);
}

/* --------------------------------------------------------------------------
   Alerts
   Bootstrap's .fade transition is opacity .15s linear, which reads as the message
   blinking out rather than fading. Slowing it to .6s with an ease curve and a
   slight upward drift makes the dismissal graceful. Bootstrap's Alert.close()
   waits for transitionend before removing the node, so the longer duration is
   picked up automatically with no JS change.
   -------------------------------------------------------------------------- */
.alert.fade {
	transition: opacity .6s ease-in-out, transform .6s ease-in-out;
}

.alert.fade:not(.show) {
	opacity: 0;
	transform: translateY(-6px);
}

/* --------------------------------------------------------------------------
   Modals
   -------------------------------------------------------------------------- */
.modal-header {
	background: var(--abc-blue);
	color: #fff;
	border-bottom: 3px solid var(--abc-red);
	border-top-left-radius: calc(var(--abc-radius) - 1px);
	border-top-right-radius: calc(var(--abc-radius) - 1px);
}
.modal-header .modal-title { color: #fff; }
.modal-header .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.modal-content { border: 0; border-radius: var(--abc-radius); box-shadow: var(--abc-shadow); }

/* --------------------------------------------------------------------------
   Motion / accessibility
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation: none !important; }
}

:focus-visible { outline: 2px solid var(--abc-blue-300); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   Small screens
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
	.b2blogo { width: 70%; }
	.ttvid { width: 100%; margin-inline: 0; }
	.card-body { padding: 1.25rem; }
	.site-header .nav-link { border-bottom: 0; padding-inline: .25rem; }
}
