/*
Theme Name: Zgaya Auto Parts
Theme URI: https://example.com/torqueparts
Author: Codex
Author URI: https://example.com
Description: A bold WooCommerce theme for Zgaya Auto, built around fast fitment search, dense product browsing, and a premium garage-retail look.
Version: 2.0.0
Requires at least: 6.4
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: torqueparts
Tags: e-commerce, custom-logo, custom-menu, featured-images, block-styles, wide-blocks
*/

:root {
  --tp-ink: #101522;
  --tp-panel: #073b8e;
  --tp-panel-2: #0b56cf;
  --tp-line: #d6dde8;
  --tp-text: #f8fbff;
  --tp-muted: #66758a;
  --tp-paper: #f3f5f6;
  --tp-paper-2: #ffffff;
  --tp-yellow: #f4c430;
  --tp-orange: #0b56cf;
  --tp-teal: #0b56cf;
  --tp-red: #f20808;
  --tp-blue: #0b56cf;
  --tp-blue-dark: #062f73;
  --tp-radius: 8px;
  --tp-shadow: 0 18px 45px rgba(6, 47, 115, 0.14);
  --tp-max: 1240px;
  --tp-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--tp-paper);
  color: var(--tp-ink);
  font-family: var(--tp-font);
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.tp-wrap {
  width: min(calc(100% - 32px), var(--tp-max));
  margin: 0 auto;
}

.tp-topbar {
  background: var(--tp-red);
  color: #fff;
  font-size: 13px;
}

.tp-topbar-inner {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.tp-topbar strong {
  color: #fff;
}

.tp-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  color: var(--tp-ink);
  border-bottom: 1px solid var(--tp-line);
  backdrop-filter: blur(16px);
}

.tp-header-main {
  min-height: 78px;
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto;
  align-items: center;
  gap: 24px;
}

.tp-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 168px;
}

.tp-brand-logo {
  width: auto;
  height: 62px;
  object-fit: contain;
}

.custom-logo {
  width: auto;
  max-height: 62px;
  object-fit: contain;
}

.custom-logo-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.tp-brand .custom-logo-link {
  padding: 0;
}

.tp-brand img {
  flex: 0 0 auto;
}

.tp-brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 2px solid var(--tp-red);
  border-radius: 8px;
  color: var(--tp-red);
  font-weight: 900;
}

.tp-search {
  display: grid;
  grid-template-columns: 1fr auto;
  min-height: 48px;
  overflow: hidden;
  border: 1px solid #cbd6e4;
  border-radius: var(--tp-radius);
  background: #fff;
  box-shadow: 0 8px 24px rgba(6, 47, 115, 0.08);
}

.tp-search input {
  width: 100%;
  border: 0;
  padding: 0 18px;
  font: inherit;
  color: var(--tp-ink);
  outline: none;
}

.tp-search button,
.button,
button,
input[type="submit"],
.wp-block-button__link,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
  min-height: 44px;
  border: 0;
  border-radius: var(--tp-radius);
  background: var(--tp-red);
  color: #fff;
  cursor: pointer;
  font-weight: 850;
  padding: 0 18px;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.tp-search button {
  border-radius: 0;
  padding: 0 24px;
  background: var(--tp-blue);
  color: #fff;
}

.button:hover,
button:hover,
input[type="submit"]:hover,
.wp-block-button__link:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
  background: #ff2a2a;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(242, 8, 8, 0.18);
}

.tp-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tp-action {
  min-width: 46px;
  min-height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd6e4;
  border-radius: var(--tp-radius);
  color: var(--tp-blue-dark);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.tp-nav {
  background: var(--tp-blue-dark);
  border-top: 1px solid rgba(6, 47, 115, 0.08);
}

.tp-nav-inner {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.tp-menu,
.tp-menu ul {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tp-menu a {
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 750;
  text-transform: uppercase;
}

.tp-menu a:hover {
  color: #fff;
}

.tp-fitment {
  background:
    radial-gradient(circle at 82% 8%, rgba(242, 8, 8, 0.15), transparent 27%),
    linear-gradient(135deg, #ffffff 0%, #eef5ff 48%, #dfeaff 100%);
  color: var(--tp-ink);
  padding: 54px 0;
}

.tp-fitment-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 34px;
  align-items: center;
}

.tp-kicker {
  color: var(--tp-red);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.tp-hero-title {
  max-width: 680px;
  margin: 12px 0 16px;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 0.94;
  font-weight: 950;
  letter-spacing: 0;
}

.tp-hero-copy {
  max-width: 570px;
  color: #4d5d70;
  font-size: 18px;
}

.tp-fitment-box {
  padding: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #d2ddec;
  border-radius: var(--tp-radius);
  box-shadow: var(--tp-shadow);
}

.tp-fitment-box h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

.tp-fitment-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.tp-fitment-form select,
.tp-fitment-form input {
  min-height: 48px;
  width: 100%;
  border: 1px solid #cbd6e4;
  border-radius: var(--tp-radius);
  background: #fff;
  color: var(--tp-ink);
  padding: 0 12px;
  font: inherit;
}

.tp-fitment-form button {
  background: var(--tp-red);
  color: #fff;
}

.tp-strip {
  background: var(--tp-blue);
  color: #fff;
}

.tp-strip-inner {
  min-height: 52px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  font-size: 14px;
  font-weight: 850;
  text-transform: uppercase;
}

.tp-strip-inner span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-left: 1px solid rgba(0, 0, 0, 0.12);
}

.tp-main {
  padding: 42px 0 64px;
}

.tp-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.tp-section-head h2,
.woocommerce-products-header__title,
.entry-title {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
}

.tp-category-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 290px);
  grid-template-columns: none;
  gap: 14px;
  margin-bottom: 34px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 2px 2px 14px;
  scroll-snap-type: inline mandatory;
  scrollbar-color: var(--tp-blue) #dce6f5;
}

.tp-category-rail {
  position: relative;
  margin-bottom: 34px;
}

.tp-category-rail .tp-category-grid {
  margin-bottom: 0;
}

.tp-rail-button {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 46px;
  height: 58px;
  min-height: 58px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  background: rgba(242, 8, 8, 0.94);
  box-shadow: 0 14px 34px rgba(6, 47, 115, 0.24);
  transform: translateY(-50%);
}

.tp-rail-button::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}

.tp-rail-prev {
  left: -10px;
}

.tp-rail-prev::before {
  border-right: 15px solid #fff;
}

.tp-rail-next {
  right: -10px;
}

.tp-rail-next::before {
  border-left: 15px solid #fff;
}

.tp-rail-button:hover {
  background: var(--tp-blue);
}

.tp-rail-button[hidden] {
  display: none;
}

.tp-category-grid::-webkit-scrollbar {
  height: 10px;
}

.tp-category-grid::-webkit-scrollbar-track {
  background: #dce6f5;
  border-radius: 999px;
}

.tp-category-grid::-webkit-scrollbar-thumb {
  background: var(--tp-blue);
  border-radius: 999px;
}

.tp-category-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
  border-radius: var(--tp-radius);
  background: linear-gradient(135deg, var(--tp-blue-dark), var(--tp-blue));
  color: var(--tp-text);
  overflow: hidden;
  position: relative;
  scroll-snap-align: start;
  box-shadow: 0 10px 28px rgba(6, 47, 115, 0.14);
}

.tp-category-card::after {
  content: "";
  position: absolute;
  right: -38px;
  bottom: -48px;
  width: 130px;
  height: 130px;
  border: 22px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.tp-category-image {
  position: relative;
  z-index: 1;
  height: 126px;
  display: grid;
  place-items: center;
  background: #fff;
}

.tp-category-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14px;
}

.tp-category-fallback {
  color: rgba(6, 47, 115, 0.12);
  font-size: 72px;
  font-weight: 950;
  line-height: 1;
}

.tp-category-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  padding: 16px 18px 18px;
}

.tp-category-card strong {
  font-size: 22px;
  line-height: 1.05;
}

.tp-category-card span {
  color: #fff;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
  display: none;
}

.woocommerce ul.products li.product {
  width: auto;
  margin: 0;
  float: none;
  background: var(--tp-paper-2);
  border: 1px solid #dfe4e7;
  border-radius: var(--tp-radius);
  box-shadow: 0 6px 20px rgba(12, 16, 20, 0.06);
  padding: 12px 12px 16px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.woocommerce ul.products li.product:hover {
  transform: translateY(-3px);
  border-color: #c8d1d8;
  box-shadow: var(--tp-shadow);
}

.woocommerce ul.products li.product a img {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f7f9fa;
  border-radius: 6px;
  padding: 14px;
}

.woocommerce-loop-product__title {
  min-height: 48px;
  color: var(--tp-ink);
  font-size: 16px;
  font-weight: 850;
}

.woocommerce ul.products li.product .price {
  color: var(--tp-red);
  font-size: 18px;
  font-weight: 950;
}

.tp-product-meta {
  display: inline-flex;
  margin: 4px 0 8px;
  border-radius: 999px;
  background: rgba(11, 86, 207, 0.1);
  color: var(--tp-blue-dark);
  font-size: 12px;
  font-weight: 850;
  padding: 4px 8px;
  text-transform: uppercase;
}

.woocommerce span.onsale {
  min-width: auto;
  min-height: auto;
  border-radius: 6px;
  background: var(--tp-red);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 8px 10px;
}

.tp-garage-band {
  margin: 46px 0;
  padding: 28px;
  border-radius: var(--tp-radius);
  background:
    linear-gradient(90deg, rgba(242, 8, 8, 0.18), transparent 42%),
    var(--tp-blue-dark);
  color: var(--tp-text);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}

.tp-garage-band h2 {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.08;
}

.tp-garage-band p {
  margin: 0;
  color: var(--tp-muted);
}

.entry-content,
.woocommerce div.product {
  background: var(--tp-paper-2);
  border-radius: var(--tp-radius);
  padding: 24px;
}

.tp-page-lead {
  max-width: 820px;
  color: #4d5d70;
  font-size: 18px;
}

.tp-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 26px 0;
}

.tp-info-card {
  display: block;
  min-height: 150px;
  padding: 20px;
  border: 1px solid #dfe4e7;
  border-radius: var(--tp-radius);
  background: #f8fbff;
  color: var(--tp-ink);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

a.tp-info-card:hover {
  border-color: var(--tp-blue);
  box-shadow: 0 12px 30px rgba(6, 47, 115, 0.12);
  transform: translateY(-2px);
}

.tp-info-card h2,
.tp-info-card h3 {
  margin-top: 0;
}

.tp-kit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0;
  align-items: stretch;
  width: 100%;
}

.tp-kit-card {
  aspect-ratio: 1.12 / 1;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--tp-radius);
  background: linear-gradient(135deg, var(--tp-blue-dark), var(--tp-blue));
  color: var(--tp-text);
  box-shadow: 0 10px 28px rgba(6, 47, 115, 0.14);
  overflow: hidden;
  position: relative;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.tp-kit-card::after {
  content: "";
  position: absolute;
  right: -38px;
  bottom: -48px;
  width: 130px;
  height: 130px;
  border: 22px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.tp-kit-card:hover {
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 16px 36px rgba(6, 47, 115, 0.22);
  transform: translateY(-2px);
}

.tp-kit-card > * {
  position: relative;
  z-index: 1;
}

.tp-kit-card h2 {
  margin: 0 0 10px;
  font-size: 25px;
  line-height: 1.05;
}

.tp-kit-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}


.tp-contact-list {
  display: grid;
  gap: 10px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.tp-contact-list li {
  padding: 14px 16px;
  border-left: 4px solid var(--tp-red);
  background: #f8fbff;
}

.woocommerce div.product {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 34px;
}

.woocommerce div.product div.images,
.woocommerce div.product div.summary {
  width: auto;
  float: none;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
  color: var(--tp-red);
  font-size: 32px;
  font-weight: 950;
}

.quantity .qty {
  min-height: 44px;
  border: 1px solid #cfd7dd;
  border-radius: var(--tp-radius);
}

.tp-footer {
  background: #0c0f13;
  color: var(--tp-muted);
  padding: 42px 0 26px;
}

.tp-footer-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  gap: 28px;
}

.tp-footer h2,
.tp-footer h3 {
  margin: 0 0 12px;
  color: var(--tp-text);
}

.tp-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tp-footer li + li {
  margin-top: 8px;
}

.tp-footer-bottom {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

@media (max-width: 980px) {
  .tp-header-main,
  .tp-fitment-grid,
  .woocommerce div.product,
  .tp-footer-grid {
    grid-template-columns: 1fr;
  }

  .woocommerce ul.products,
  .tp-kit-grid,
  .tp-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tp-fitment-form,
  .tp-strip-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .tp-topbar-inner,
  .tp-nav-inner,
  .tp-section-head,
  .tp-garage-band {
    align-items: stretch;
    flex-direction: column;
    display: flex;
  }

  .tp-menu {
    flex-wrap: wrap;
    gap: 14px;
  }

  .tp-header-main {
    gap: 14px;
    padding: 14px 0;
  }

  .tp-actions {
    justify-content: space-between;
  }

  .tp-fitment {
    padding: 34px 0;
  }

  .tp-fitment-form,
  .woocommerce ul.products,
  .tp-strip-inner,
  .tp-kit-grid,
  .tp-info-grid {
    grid-template-columns: 1fr;
  }

  .tp-category-grid {
    grid-auto-columns: minmax(78%, 1fr);
  }

  .tp-rail-prev {
    left: 4px;
  }

  .tp-rail-next {
    right: 4px;
  }

  .entry-content,
  .woocommerce div.product {
    padding: 16px;
  }
}
