/*
Theme Name: TPD Shoptimizer Child
Theme URI: https://thepartsdistributors.com/
Description: Lightweight Shoptimizer child theme with redesigned homepage and cleaner ecommerce presentation for The Parts Distributors.
Author: OpenAI
Template: shoptimizer
Version: 1.0.0
Text Domain: tpd-shoptimizer-child
*/

:root {
  --tpd-blue: #1f4fd6;
  --tpd-dark: #111827;
  --tpd-text: #1f2937;
  --tpd-muted: #6b7280;
  --tpd-bg: #f8fafc;
  --tpd-card: #ffffff;
  --tpd-border: #e5e7eb;
  --tpd-radius: 16px;
  --tpd-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
  --tpd-max: 1440px;
}

body {
  color: var(--tpd-text);
}

.site-header,
.header-widget-region,
.secondary-navigation,
.site-top-bar,
.site-search,
.site-header-search,
.header-search,
.search-form-container {
  box-sizing: border-box;
}

body.home .site-search,
body.home .site-header-search,
body.home .header-search,
body.home .search-form-container {
  display: none !important;
}

.col-full,
.content-area,
.site-main,
.page-template-template-fullwidth .content-area {
  max-width: var(--tpd-max);
}

.site-content .col-full,
.site-header .col-full,
.site-footer .col-full,
.woocommerce-page .col-full {
  max-width: var(--tpd-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.site-header {
  border-bottom: 1px solid var(--tpd-border);
}

.home .site-main,
.page-template-template-fullwidth .site-main {
  max-width: none;
}

.tpd-home {
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 28%, #ffffff 100%);
}

.tpd-section {
  padding: 36px 0;
}

.tpd-hero {
  padding: 44px 0 28px;
}

.tpd-hero__wrap {
  background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%);
  border: 1px solid rgba(31, 79, 214, 0.1);
  border-radius: 24px;
  box-shadow: var(--tpd-shadow);
  padding: 42px;
  text-align: center;
}

.tpd-kicker {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--tpd-blue);
  margin-bottom: 12px;
}

.tpd-hero h1,
.tpd-section-title {
  color: var(--tpd-dark);
  line-height: 1.1;
}

.tpd-hero h1 {
  font-size: clamp(34px, 5vw, 58px);
  margin: 0 0 14px;
}

.tpd-hero p {
  max-width: 760px;
  margin: 0 auto 22px;
  color: var(--tpd-muted);
  font-size: 18px;
}

.tpd-search {
  max-width: 880px;
  margin: 0 auto;
}

.tpd-search__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--tpd-border);
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.tpd-search__input {
  min-height: 58px;
  border: 0;
  padding: 0 18px;
  font-size: 17px;
  background: transparent;
}

.tpd-search__input:focus {
  outline: none;
}

.tpd-btn,
.tpd-search__button,
.tpd-card__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 24px;
  border-radius: 14px;
  border: 0;
  text-decoration: none;
  font-weight: 700;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.tpd-search__button,
.tpd-btn--primary,
.tpd-card__button {
  background: var(--tpd-blue);
  color: #fff;
}

.tpd-btn--ghost {
  background: #fff;
  color: var(--tpd-blue);
  border: 1px solid rgba(31,79,214,.18);
}

.tpd-search__button:hover,
.tpd-btn:hover,
.tpd-card__button:hover {
  color: inherit;
  transform: translateY(-1px);
}

.tpd-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.tpd-badge {
  background: #fff;
  border: 1px solid var(--tpd-border);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tpd-dark);
}

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

.tpd-section-title {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
}

.tpd-section-subtitle {
  color: var(--tpd-muted);
  margin: 0;
  max-width: 760px;
}

.tpd-grid {
  display: grid;
  gap: 20px;
}

.tpd-grid--categories {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tpd-grid--help {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tpd-grid--products {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tpd-card {
  background: var(--tpd-card);
  border: 1px solid var(--tpd-border);
  border-radius: var(--tpd-radius);
  box-shadow: var(--tpd-shadow);
  overflow: hidden;
  height: 100%;
}

.tpd-cat-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.tpd-cat-card__media {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tpd-cat-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tpd-cat-card__fallback {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: rgba(31,79,214,.08);
  color: var(--tpd-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
}

.tpd-cat-card__body,
.tpd-help-card,
.tpd-product-card__body {
  padding: 18px;
}

.tpd-cat-card__title,
.tpd-help-card__title,
.tpd-product-card__title {
  margin: 0 0 8px;
  font-size: 20px;
  color: var(--tpd-dark);
}

.tpd-cat-card__meta,
.tpd-help-card__text,
.tpd-product-card__sku,
.tpd-product-card__meta {
  color: var(--tpd-muted);
  font-size: 14px;
}

.tpd-brands {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.tpd-brand-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 18px;
  background: #fff;
  border: 1px solid var(--tpd-border);
  border-radius: 999px;
  box-shadow: var(--tpd-shadow);
  text-decoration: none;
  font-weight: 700;
  color: var(--tpd-dark);
}

.tpd-help-card {
  background: #fff;
  border: 1px solid var(--tpd-border);
  border-radius: var(--tpd-radius);
  box-shadow: var(--tpd-shadow);
}

.tpd-help-card__link {
  display: inline-flex;
  margin-top: 12px;
  text-decoration: none;
  font-weight: 700;
  color: var(--tpd-blue);
}

.tpd-product-card {
  display: flex;
  flex-direction: column;
}

.tpd-product-card__media {
  aspect-ratio: 1 / 1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-bottom: 1px solid var(--tpd-border);
}

.tpd-product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tpd-product-card__title {
  font-size: 16px;
  min-height: 3.1em;
}

.tpd-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--tpd-dark);
  margin: 10px 0 14px;
}

.tpd-product-card__actions {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.tpd-product-card__button {
  width: 100%;
}

.tpd-page-hero {
  padding: 26px 0 10px;
}

.tpd-page-hero__wrap {
  background: #fff;
  border: 1px solid var(--tpd-border);
  border-radius: 22px;
  box-shadow: var(--tpd-shadow);
  padding: 28px 30px;
}

.tpd-page-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 3vw, 42px);
}

body.woocommerce-cart .shop_table,
body.woocommerce-checkout .shop_table,
body.woocommerce-account .woocommerce,
body.woocommerce-page .woocommerce {
  background: #fff;
  border: 1px solid var(--tpd-border);
  border-radius: 18px;
  box-shadow: var(--tpd-shadow);
  padding: 18px;
}

body.woocommerce-cart .quantity .qty,
body.woocommerce-page .quantity .qty {
  min-height: 44px;
  border-radius: 12px;
}

body.woocommerce-account .entry-title,
body.page .entry-title,
body.single .entry-title {
  margin-bottom: 12px;
}

@media (max-width: 1200px) {
  .tpd-grid--categories,
  .tpd-grid--help,
  .tpd-grid--products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .site-content .col-full,
  .site-header .col-full,
  .site-footer .col-full,
  .woocommerce-page .col-full {
    padding-left: 18px;
    padding-right: 18px;
  }

  .tpd-hero__wrap,
  .tpd-page-hero__wrap {
    padding: 28px 20px;
  }

  .tpd-search__form {
    grid-template-columns: 1fr;
  }

  .tpd-grid--categories,
  .tpd-grid--help,
  .tpd-grid--products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .tpd-section {
    padding: 24px 0;
  }

  .tpd-section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .tpd-grid--categories,
  .tpd-grid--help,
  .tpd-grid--products {
    grid-template-columns: 1fr;
  }

  .tpd-badges,
  .tpd-brands {
    justify-content: flex-start;
  }
}
