/*
Theme Name: Texas Parts
Theme URI: https://texas-parts.com/
Description: WooCommerce theme for Texas Parts, trade supplier for automotive locksmiths.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: texasparts
*/

:root {
	--tp-navy: #022461;
	--tp-navy-deep: #011a47;
	--tp-slate: #687ba3;
	--tp-red: #bc192c;
	--tp-red-dark: #9a1424;
	--tp-ink: #12192b;
	--tp-muted: #4d5568;
	--tp-line: #d9dde6;
	--tp-line-soft: #e9ecf2;
	--tp-ground: #f3f5f8;
	--tp-white: #ffffff;
	--tp-radius: 10px;
	--tp-wrap: 1280px;
	--tp-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
	--tp-body: "Public Sans", "Helvetica Neue", Arial, sans-serif;
	--tp-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--tp-ground); color: var(--tp-ink); font-family: var(--tp-body); font-size: 16px; line-height: 1.55; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--tp-navy); }
a:hover { color: var(--tp-red); }
h1, h2, h3, h4 { font-family: var(--tp-display); line-height: 1.15; color: var(--tp-ink); }
h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -0.01em; }
input, select, textarea, button { font: inherit; color: inherit; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; width: auto; height: auto; clip: auto; z-index: 1000; background: #fff; padding: 10px 16px; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--tp-red); outline-offset: 2px; }

.tp-wrap { max-width: var(--tp-wrap); margin: 0 auto; padding-left: 24px; padding-right: 24px; }
@media (max-width: 600px) { .tp-wrap { padding-left: 16px; padding-right: 16px; } }

/* Buttons */
.tp-btn, .button, button.button, a.button, input.button, .wp-element-button,
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .woocommerce #respond input#submit {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 10px 20px; border: 0; border-radius: 8px;
	background: var(--tp-navy); color: #fff; font-weight: 600; font-size: 15px; line-height: 1.2;
	text-decoration: none; cursor: pointer; transition: background .15s;
}
.tp-btn:hover, .button:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .wp-element-button:hover { background: var(--tp-navy-deep); color: #fff; }
.tp-btn--red, .woocommerce a.button.alt, .woocommerce button.button.alt, .single_add_to_cart_button, .checkout-button,
.woocommerce #place_order { background: var(--tp-red) !important; color: #fff !important; }
.tp-btn--red:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .single_add_to_cart_button:hover, .checkout-button:hover { background: var(--tp-red-dark) !important; }
.tp-btn--ghost { background: transparent; color: var(--tp-navy); border: 1.5px solid var(--tp-navy); }
.tp-btn--ghost:hover { background: var(--tp-navy); color: #fff; }

/* Top bar */
.tp-topbar { background: var(--tp-navy-deep); color: #dfe5f1; font-size: 13px; }
.tp-topbar .tp-wrap { display: flex; flex-wrap: wrap; gap: 6px 28px; align-items: center; justify-content: space-between; padding-top: 8px; padding-bottom: 8px; }
.tp-topbar__group { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.tp-topbar a { color: #dfe5f1; text-decoration: none; }
.tp-topbar a:hover { color: #fff; text-decoration: underline; }

/* Header */
.tp-header { background: #fff; border-bottom: 1px solid var(--tp-line); position: relative; z-index: 20; }
.tp-header__main { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 32px; padding-top: 14px; padding-bottom: 14px; }
.tp-logo { flex: none; display: block; }
.tp-logo img { height: 72px; width: auto; }
.tp-search { flex: 999 1 420px; min-width: 0; display: flex; border: 2px solid var(--tp-navy); border-radius: 8px; overflow: hidden; background: #fff; }
.tp-search input[type="search"] { flex: 1; min-width: 0; border: 0; padding: 0 16px; height: 48px; font-size: 15px; background: #fff; }
.tp-search input[type="search"]:focus { outline: none; }
.tp-search:focus-within { box-shadow: 0 0 0 3px rgba(188,25,44,.25); }
.tp-search button { border: 0; background: var(--tp-red); color: #fff; padding: 0 20px; font-weight: 600; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.tp-search button:hover { background: var(--tp-red-dark); }
.tp-header__actions { display: flex; gap: 10px; align-items: center; }
.tp-cart-link { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; border: 1px solid var(--tp-line); border-radius: 8px; text-decoration: none; font-weight: 600; color: var(--tp-ink); white-space: nowrap; }
.tp-cart-link:hover { border-color: var(--tp-navy); color: var(--tp-navy); }
.tp-cart-count { display: inline-flex; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--tp-red); color: #fff; font-size: 12px; align-items: center; justify-content: center; }
@media (max-width: 760px) {
	.tp-logo img { height: 56px; }
	.tp-search { order: 3; flex-basis: 100%; }
	.tp-header__actions { margin-left: auto; }
}

/* Category nav */
.tp-nav { background: var(--tp-navy); }
.tp-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.tp-nav a { display: block; padding: 13px 14px; color: #fff; text-decoration: none; font-size: 14px; font-weight: 600; }
.tp-nav a:hover, .tp-nav .current-menu-item > a, .tp-nav .current-cat > a { background: var(--tp-navy-deep); color: #fff; }
.tp-nav__toggle { display: none; }
@media (max-width: 760px) {
	.tp-nav__toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; background: none; border: 0; color: #fff; padding: 12px 0; font-weight: 600; min-height: 44px; cursor: pointer; }
	.tp-nav ul { display: none; flex-direction: column; padding-bottom: 8px; }
	.tp-nav.is-open ul { display: flex; }
	.tp-nav a { padding: 11px 0; border-top: 1px solid rgba(255,255,255,.12); }
}

/* Main */
.tp-main { min-height: 50vh; }
.tp-section { padding-top: 56px; }
.tp-section__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 20px; }
.tp-section__head h2 { margin: 0; }
.tp-card { background: #fff; border: 1px solid var(--tp-line); border-radius: var(--tp-radius); }
.tp-eyebrow { font-family: var(--tp-mono); font-size: 12px; letter-spacing: .06em; color: var(--tp-red); text-transform: uppercase; }

/* Hero slider */
.tp-hero { padding-top: 24px; }
.tp-slider { position: relative; border-radius: 12px; overflow: hidden; background: var(--tp-navy); }
.tp-slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.tp-slides::-webkit-scrollbar { display: none; }
.tp-slide { flex: 0 0 100%; scroll-snap-align: start; position: relative; }
.tp-slide a, .tp-slide > div { display: block; }
.tp-slide img { width: 100%; height: auto; aspect-ratio: 1920 / 800; object-fit: contain; background: var(--tp-navy); }
.tp-slide--placeholder { aspect-ratio: 1920 / 800; display: flex !important; align-items: center; justify-content: center; flex-direction: column; gap: 6px; color: #c8d1e4; text-align: center; padding: 24px; }
.tp-slide--placeholder strong { color: #fff; font-family: var(--tp-display); font-size: 22px; }
.tp-slider__dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 8px; }
.tp-slider__dots button { width: 12px; height: 12px; border-radius: 6px; border: 0; padding: 0; background: rgba(255,255,255,.55); cursor: pointer; transition: width .2s; }
.tp-slider__dots button[aria-current="true"] { width: 32px; background: #fff; }
.tp-slider__arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 22px; border: 0; background: rgba(1,26,71,.7); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tp-slider__arrow:hover { background: var(--tp-navy-deep); }
.tp-slider__arrow--prev { left: 14px; } .tp-slider__arrow--next { right: 14px; }
@media (max-width: 600px) { .tp-slider__arrow { display: none; } }

/* Perks */
.tp-perks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; padding-top: 20px; }
.tp-perk { padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; }
.tp-perk__icon { flex: none; width: 38px; height: 38px; border-radius: 8px; background: #eaf0fa; color: var(--tp-navy); display: flex; align-items: center; justify-content: center; }
.tp-perk strong { display: block; font-size: 15px; }
.tp-perk span { display: block; font-size: 13px; color: var(--tp-muted); line-height: 1.45; margin-top: 2px; }

/* Category grid */
.tp-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.tp-cat { display: flex; flex-direction: column; overflow: hidden; text-decoration: none; transition: border-color .15s, transform .15s; }
.tp-cat:hover { border-color: var(--tp-navy); transform: translateY(-2px); }
.tp-cat__img { aspect-ratio: 3 / 2; background: #e6eaf2; display: flex; align-items: center; justify-content: center; color: var(--tp-slate); }
.tp-cat__img img { width: 100%; height: 100%; object-fit: cover; }
.tp-cat__body { padding: 14px 16px; }
.tp-cat__name { font-family: var(--tp-display); font-weight: 700; font-size: 16px; color: var(--tp-ink); }
.tp-cat__count { font-size: 13px; color: var(--tp-muted); margin-top: 2px; }

/* Vehicle finder */
.tp-finder { background: var(--tp-navy); color: #fff; border-radius: 12px; padding: 32px; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; }
.tp-finder h2 { color: #fff; margin: 0; font-size: 28px; }
.tp-finder p { margin: 8px 0 0; color: #c8d1e4; }
.tp-finder__intro { flex: 1 1 280px; }
.tp-finder form { flex: 2 1 560px; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.tp-field { display: flex; flex-direction: column; gap: 6px; }
.tp-field label { font-size: 13px; color: #c8d1e4; }
.tp-field select, .tp-field input { height: 48px; border-radius: 8px; border: 0; padding: 0 12px; font-size: 15px; background: #fff; color: var(--tp-ink); width: 100%; }
.tp-finder .tp-btn { height: 48px; width: 100%; }

/* Used parts promo */
.tp-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.tp-promo { padding: 32px; }
.tp-promo h2 { margin: 8px 0 0; font-size: 28px; }
.tp-promo p { color: #333a4a; }
.tp-promo__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.tp-promo-list { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.tp-promo-list h3 { margin: 0 0 4px; font-size: 18px; }
.tp-promo-list ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.tp-promo-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.tp-promo-list li svg { flex: none; color: var(--tp-red); margin-top: 3px; }

/* Steps */
.tp-steps { padding: 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; }
.tp-step__n { font-family: var(--tp-display); font-weight: 800; font-size: 40px; color: var(--tp-red); line-height: 1; }
.tp-step strong { display: block; font-size: 17px; margin-top: 8px; }
.tp-step span { display: block; font-size: 14px; color: var(--tp-muted); margin-top: 6px; }

/* Footer */
.tp-footer { margin-top: 72px; background: var(--tp-navy-deep); color: #c8d1e4; font-size: 14px; }
.tp-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; padding-top: 48px; padding-bottom: 32px; }
.tp-footer h2 { font-size: 15px; color: #fff; margin: 0 0 12px; font-family: var(--tp-body); font-weight: 600; letter-spacing: 0; }
.tp-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tp-footer a { color: #c8d1e4; text-decoration: none; }
.tp-footer a:hover { color: #fff; text-decoration: underline; }
.tp-footer__brand img { height: 64px; width: auto; background: #fff; border-radius: 8px; padding: 4px 8px; }
.tp-footer__brand p { margin: 14px 0 0; line-height: 1.6; }
.tp-footer__bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 16px; padding-bottom: 28px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* Generic content */
.tp-page { padding-top: 32px; }
.tp-content { background: #fff; border: 1px solid var(--tp-line); border-radius: var(--tp-radius); padding: clamp(20px, 4vw, 40px); }
.tp-content > :first-child { margin-top: 0; }
.tp-breadcrumb, .woocommerce-breadcrumb { font-size: 13px; color: var(--tp-muted); margin: 0 0 16px; }
.woocommerce-breadcrumb a { color: var(--tp-muted); }

/* ---------- WooCommerce ---------- */
.tp-shop { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; padding-top: 28px; }
.tp-shop__side { flex: 1 1 240px; max-width: 280px; display: flex; flex-direction: column; gap: 16px; }
.tp-shop__main { flex: 999 1 560px; min-width: 0; }
@media (max-width: 860px) { .tp-shop__side { max-width: none; order: 2; } }
.tp-widget { padding: 18px; }
.tp-widget h2 { font-size: 16px; margin: 0 0 10px; font-family: var(--tp-display); }
.tp-widget ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tp-widget li a { display: flex; justify-content: space-between; padding: 7px 8px; border-radius: 6px; text-decoration: none; color: var(--tp-ink); font-size: 14px; }
.tp-widget li a:hover, .tp-widget li.current-cat > a { background: var(--tp-ground); color: var(--tp-navy); }
.tp-widget .count { color: var(--tp-muted); font-size: 12px; }
.tp-widget .children { padding-left: 12px; }

.woocommerce-products-header__title, .tp-shop__main h1.page-title { margin: 0 0 6px; }
.term-description { color: var(--tp-muted); margin-bottom: 12px; }
.woocommerce-result-count { font-size: 14px; color: var(--tp-muted); margin: 8px 0 16px; float: left; }
.woocommerce-ordering { float: right; margin: 0 0 16px; }
.woocommerce-ordering select { height: 40px; border: 1px solid var(--tp-line); border-radius: 8px; padding: 0 10px; background: #fff; }
.woocommerce-notices-wrapper:empty { display: none; }

ul.products { list-style: none; margin: 0; padding: 0; clear: both; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
ul.products::before, ul.products::after { display: none !important; }
ul.products li.product { width: auto !important; margin: 0 !important; float: none !important; background: #fff; border: 1px solid var(--tp-line); border-radius: var(--tp-radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; position: relative; }
ul.products li.product:hover { border-color: var(--tp-slate); }
ul.products li.product a.woocommerce-LoopProduct-link { text-decoration: none; color: var(--tp-ink); display: flex; flex-direction: column; gap: 8px; flex: 1; }
ul.products li.product img { aspect-ratio: 1 / 1; object-fit: contain; background: var(--tp-ground); border-radius: 6px; margin: 0 !important; width: 100%; }
ul.products li.product .tp-loop-brand { font-family: var(--tp-mono); font-size: 12px; color: var(--tp-muted); }
ul.products li.product .woocommerce-loop-product__title { font-family: var(--tp-body); font-size: 15px !important; font-weight: 600; line-height: 1.35; margin: 0; padding: 0 !important; }
ul.products li.product .price { font-family: var(--tp-display); font-weight: 800; font-size: 21px; color: var(--tp-ink) !important; margin-top: auto; }
ul.products li.product .price del { font-size: 14px; color: var(--tp-muted); font-weight: 500; }
ul.products li.product .price ins { text-decoration: none; color: var(--tp-red); }
ul.products li.product .woocommerce-price-suffix, .price .woocommerce-price-suffix { font-family: var(--tp-body); font-size: 12px; font-weight: 500; color: var(--tp-muted); }
ul.products li.product .onsale, .woocommerce span.onsale { position: absolute; top: 20px; left: 20px; z-index: 2; background: var(--tp-red); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; min-height: 0; min-width: 0; line-height: 1.4; margin: 0; }
.tp-loop-buy { display: flex; gap: 8px; }
.tp-loop-buy .quantity input.qty, .tp-loop-buy input.qty { width: 64px; height: 44px; border: 1px solid var(--tp-line); border-radius: 8px; padding: 0 8px; text-align: center; }
.tp-loop-buy .button { flex: 1; padding: 10px 12px; }
ul.products li.product .button { width: 100%; }
.tp-loop-buy .button { width: auto; }
ul.products li.product .added_to_cart { font-size: 13px; text-align: center; }
.tp-stock-pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #e7f4ec; color: #1d6b3c; width: fit-content; }
.tp-stock-pill--out { background: #f6e3e5; color: var(--tp-red-dark); }
.tp-cond-pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eaf0fa; color: var(--tp-navy); width: fit-content; }

nav.woocommerce-pagination ul { display: flex; gap: 6px; list-style: none; padding: 0; margin: 28px 0 0; border: 0 !important; }
nav.woocommerce-pagination ul li { border: 0 !important; }
nav.woocommerce-pagination ul li a, nav.woocommerce-pagination ul li span { display: flex; min-width: 44px; height: 44px; align-items: center; justify-content: center; border: 1px solid var(--tp-line) !important; border-radius: 8px; background: #fff; text-decoration: none; }
nav.woocommerce-pagination ul li span.current { background: var(--tp-navy) !important; color: #fff !important; border-color: var(--tp-navy) !important; }

/* Single product */
.single-product div.product { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 32px; background: #fff; border: 1px solid var(--tp-line); border-radius: var(--tp-radius); padding: clamp(18px, 3vw, 32px); position: relative; }
.single-product div.product .woocommerce-product-gallery, .single-product div.product .summary { width: auto !important; float: none !important; margin: 0 !important; }
.single-product div.product .woocommerce-tabs, .single-product div.product .related, .single-product div.product .upsells { grid-column: 1 / -1; }
.single-product .product_title { margin: 0 0 8px; font-size: clamp(24px, 3vw, 32px); }
.single-product div.product p.price, .single-product div.product span.price { font-family: var(--tp-display); font-weight: 800; font-size: 30px; color: var(--tp-ink) !important; }
.single-product .woocommerce-product-gallery img { background: var(--tp-ground); border-radius: 8px; }
.single-product form.cart { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0; }
.single-product form.cart .quantity input.qty { width: 80px; height: 48px; border: 1px solid var(--tp-line); border-radius: 8px; text-align: center; }
.single-product form.cart .button { height: 48px; padding: 0 28px; font-size: 16px; }
.product_meta { font-size: 14px; color: var(--tp-muted); display: grid; gap: 4px; }
.tp-specs { margin: 18px 0; border: 1px solid var(--tp-line); border-radius: 8px; overflow: hidden; font-size: 14px; }
.tp-specs div { display: flex; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--tp-line-soft); }
.tp-specs div:first-child { border-top: 0; }
.tp-specs dt { width: 140px; flex: none; color: var(--tp-muted); }
.tp-specs dd { margin: 0; font-weight: 600; }
.tp-specs .tp-mono { font-family: var(--tp-mono); }
.woocommerce-tabs ul.tabs { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0 !important; margin: 0 0 16px !important; border-bottom: 1px solid var(--tp-line); }
.woocommerce-tabs ul.tabs::before, .woocommerce-tabs ul.tabs li::before, .woocommerce-tabs ul.tabs li::after { display: none !important; }
.woocommerce-tabs ul.tabs li { margin: 0 !important; border: 0 !important; background: none !important; padding: 0 !important; }
.woocommerce-tabs ul.tabs li a { display: block; padding: 12px 16px !important; text-decoration: none; font-weight: 600; color: var(--tp-muted) !important; border-bottom: 3px solid transparent; }
.woocommerce-tabs ul.tabs li.active a { color: var(--tp-ink) !important; border-bottom-color: var(--tp-red); }
.related > h2, .upsells > h2 { font-size: 24px; }

/* Notices */
.woocommerce-message, .woocommerce-info, .woocommerce-error, .wc-block-components-notice-banner { border-radius: 8px; border: 1px solid var(--tp-line); border-left-width: 1px; background: #fff; padding: 14px 18px; margin: 0 0 16px; list-style: none; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.woocommerce-message::before, .woocommerce-info::before, .woocommerce-error::before { display: none; }
.woocommerce-error { border-color: #e7b4ba; background: #fdf3f4; }

/* Cart / checkout blocks */
.wc-block-cart, .wc-block-checkout { background: #fff; border: 1px solid var(--tp-line); border-radius: var(--tp-radius); padding: clamp(16px, 3vw, 32px) !important; }
.wc-block-components-button:not(.is-link) { background: var(--tp-red) !important; color: #fff !important; border-radius: 8px !important; min-height: 48px; font-weight: 600; }
.wc-block-components-button:not(.is-link):hover { background: var(--tp-red-dark) !important; }
.wc-block-components-text-input input, .wc-block-components-combobox input, .wc-block-components-select select { border-radius: 8px !important; }
.wc-block-components-radio-control__input:checked { border-color: var(--tp-red) !important; }
.wc-block-components-radio-control__input:checked::before { background: var(--tp-red) !important; }

/* Forms (classic) */
.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea, .woocommerce form .form-row select, .tp-content input[type="text"], .tp-content input[type="email"], .tp-content textarea {
	border: 1px solid #b9c0ce; border-radius: 8px; padding: 10px 12px; min-height: 46px; background: #fff; width: 100%;
}
