/* ==========================================================================
   WooCommerce — DIY Solar design system (tokens defined in pages.css)
   ========================================================================== */

.diy-woo__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px 96px;
  font-family: var(--font-body);
  color: var(--ink);
}
.diy-woo__inner--single { padding-top: 36px; }

/* ==========================================================================
   Shop hero
   ========================================================================== */

.shop-hero {
  position: relative;
  background: linear-gradient(130deg, var(--navy-deep) 0%, var(--navy) 55%, var(--navy-2) 100%);
  color: #fff;
  overflow: hidden;
}
.shop-hero::after {
  content: "";
  position: absolute;
  top: -220px;
  right: -140px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 169, 58, .22), transparent 65%);
  pointer-events: none;
}
.shop-hero__inner {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: 44px 24px 92px;
}
.shop-hero__crumb,
.shop-hero .woocommerce-breadcrumb {
  font-size: 13px;
  color: rgba(255, 255, 255, .55) !important;
  margin: 0 0 26px !important;
}
.shop-hero .woocommerce-breadcrumb a {
  color: rgba(255, 255, 255, .8);
  text-decoration: none;
}
.shop-hero .woocommerce-breadcrumb a:hover { color: #fff; }
.shop-hero__tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--orange-2);
  background: rgba(242, 169, 58, .14);
  border: 1px solid rgba(242, 169, 58, .35);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  margin-bottom: 16px;
}
.shop-hero__title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.6vw, 52px);
  font-weight: 800;
  line-height: 1.08;
  margin: 0 0 12px;
  color: #fff;
}
.shop-hero__sub {
  font-size: 17px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .75);
  max-width: 640px;
  margin: 0;
}

/* ==========================================================================
   Filter toolbar (floats up over the hero)
   ========================================================================== */

.shop-toolbar {
  position: relative;
  z-index: 2;
  margin-top: -52px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 22px 48px rgba(9, 26, 51, .13);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.shop-toolbar__row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.shop-filter__label {
  flex: 0 0 72px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.shop-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.shop-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}
.shop-chip:hover {
  border-color: var(--navy-3);
  transform: translateY(-1px);
}
.shop-chip.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.shop-chip__count {
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-muted);
  background: var(--paper);
  border-radius: var(--r-pill);
  padding: 2px 7px;
}
.shop-chip.is-active .shop-chip__count {
  color: var(--navy);
  background: rgba(255, 255, 255, .9);
}

.shop-toolbar__row--meta {
  border-top: 1px solid var(--border-soft);
  padding-top: 14px;
  flex-wrap: wrap;
}
.shop-count {
  font-size: 14px;
  color: var(--ink-muted);
  white-space: nowrap;
}
.shop-search {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
  margin-left: auto;
}
.shop-search input[type="search"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 10px 42px 10px 18px;
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.shop-search input[type="search"]:focus {
  border-color: var(--navy-3);
  background: var(--paper);
}
.shop-search button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
}
.shop-search button:hover { background: var(--navy-deep); }
.shop-order select {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 10px 16px;
  cursor: pointer;
}

@media (max-width: 700px) {
  .shop-toolbar { padding: 16px; }
  .shop-toolbar__row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .shop-toolbar__row--meta { flex-direction: row; align-items: center; }
  .shop-filter__label { flex: none; }
}

/* ==========================================================================
   Product grid + cards
   ========================================================================== */

.woocommerce ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin: 28px 0 0 !important;
  padding: 0 !important;
  list-style: none;
}
@media (max-width: 1100px) { .woocommerce ul.products { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px)  { .woocommerce ul.products { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (max-width: 480px)  { .woocommerce ul.products { grid-template-columns: 1fr; } }

/* Woo's clearfix pseudo-elements become phantom grid items — remove them */
.woocommerce ul.products::before,
.woocommerce ul.products::after { display: none !important; }

.diy-card {
  width: auto !important;
  float: none !important;
  margin: 0 !important;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.diy-card:hover {
  border-color: transparent;
  box-shadow: 0 18px 40px rgba(9, 26, 51, .13);
  transform: translateY(-3px);
}

@media (prefers-reduced-motion: no-preference) {
  .diy-card {
    animation: diyCardIn .5s cubic-bezier(.2, .7, .3, 1) both;
  }
  .diy-card:nth-child(2)  { animation-delay: .04s; }
  .diy-card:nth-child(3)  { animation-delay: .08s; }
  .diy-card:nth-child(4)  { animation-delay: .12s; }
  .diy-card:nth-child(5)  { animation-delay: .16s; }
  .diy-card:nth-child(6)  { animation-delay: .20s; }
  .diy-card:nth-child(7)  { animation-delay: .24s; }
  .diy-card:nth-child(8)  { animation-delay: .28s; }
  .diy-card:nth-child(n+9) { animation-delay: .32s; }
}
@keyframes diyCardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.diy-card__media {
  position: relative;
  display: block;
  background: var(--soft);
  overflow: hidden;
}
.diy-card__media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  padding: 22px;
  margin: 0 !important;
  transition: transform .35s cubic-bezier(.2, .7, .3, 1);
}
.diy-card:hover .diy-card__media img { transform: scale(1.045); }
.diy-card__badge {
  position: absolute;
  left: 14px;
  bottom: 14px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: var(--navy);
  border-radius: var(--r-pill);
  padding: 5px 12px;
  box-shadow: 0 6px 16px rgba(9, 26, 51, .25);
}

.diy-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px 18px 0;
}
.diy-card__brand {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--navy-3);
  text-decoration: none;
  margin-bottom: 6px;
}
.diy-card__brand:hover { color: var(--navy); }
.diy-card__title {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 10px;
}
.diy-card__title a { color: var(--ink); text-decoration: none; }
.diy-card__title a:hover { color: var(--navy-2); }
.diy-card__price {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: var(--navy);
  margin-bottom: 10px;
}
.diy-card__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--border-soft);
  padding: 13px 0 15px;
}
.diy-card__sheet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color .15s ease;
}
.diy-card__sheet:hover { color: var(--navy); }
.diy-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--navy);
  text-decoration: none;
}
.diy-card__cta svg { transition: transform .18s ease; }
.diy-card__cta:hover svg { transform: translateX(3px); }

/* ==========================================================================
   Pagination / empty state
   ========================================================================== */

.woocommerce nav.woocommerce-pagination { margin-top: 40px; }
.woocommerce nav.woocommerce-pagination ul {
  display: flex;
  justify-content: center;
  gap: 8px;
  border: 0 !important;
  margin: 0;
}
.woocommerce nav.woocommerce-pagination ul li {
  border: 0 !important;
  overflow: visible;
}
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  transition: border-color .15s ease, transform .15s ease;
}
.woocommerce nav.woocommerce-pagination ul li a:hover {
  border-color: var(--navy-3);
  background: var(--soft);
  color: var(--navy);
  transform: translateY(-1px);
}
.woocommerce nav.woocommerce-pagination ul li span.current {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.shop-empty {
  margin-top: 48px;
  text-align: center;
  background: var(--soft);
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
  padding: 72px 24px;
}
.shop-empty h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 8px;
}
.shop-empty p { color: var(--ink-muted); margin: 0 0 22px; }

/* ==========================================================================
   Buttons (Woo generic)
   ========================================================================== */

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
  background: var(--navy);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  border-radius: var(--r-pill);
  padding: 12px 22px;
  border: 0;
  transition: background .15s ease, transform .15s ease;
}
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
  background: var(--navy-deep);
  color: #fff;
  transform: translateY(-1px);
}

/* ==========================================================================
   Single product
   ========================================================================== */

.single-product .woocommerce-breadcrumb {
  font-size: 13px;
  color: var(--ink-muted) !important;
  margin: 0 0 26px !important;
}
.single-product .woocommerce-breadcrumb a { color: var(--navy-3); text-decoration: none; }
.single-product .woocommerce-breadcrumb a:hover { text-decoration: underline; }

.product-brand-eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--navy-3);
  text-decoration: none;
  margin-bottom: 8px;
}
.product-brand-eyebrow:hover { color: var(--navy); }

.single-product div.product .product_title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.15;
}

.product-spec-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 4px;
}
.spec-chip {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 7px 14px;
}
.spec-chip--accent {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.single-product div.product .woocommerce-product-gallery {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--soft);
}
.single-product div.product .woocommerce-product-gallery img { object-fit: contain; }
.single-product div.product .woocommerce-product-gallery .flex-control-thumbs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 8px;
  padding: 0;
}
.single-product div.product .woocommerce-product-gallery .flex-control-thumbs li {
  float: none !important;
  width: 100% !important;
  margin: 0 !important;
}
.single-product div.product .woocommerce-product-gallery .flex-control-thumbs img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--paper);
  cursor: pointer;
  opacity: .6;
  transition: opacity .15s ease, border-color .15s ease;
}
.single-product div.product .woocommerce-product-gallery .flex-control-thumbs img:hover,
.single-product div.product .woocommerce-product-gallery .flex-control-thumbs img.flex-active {
  opacity: 1;
  border-color: var(--navy-3);
}

.single-product div.product .woocommerce-product-details__short-description {
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 1.65;
  margin-top: 10px;
}
.single-product div.product .product_meta {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  font-size: 14px;
  color: var(--ink-muted);
}
.single-product div.product .product_meta > span { display: block; margin-bottom: 4px; }
.single-product div.product .product_meta a { color: var(--navy-3); text-decoration: none; }

/* Datasheet CTA (summary + description) */
.product-datasheet a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--orange);
  color: var(--navy-deep) !important;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  padding: 13px 24px;
  border-radius: var(--r-pill);
  text-decoration: none !important;
  transition: background .15s ease, transform .15s ease;
  box-shadow: 0 10px 22px rgba(242, 169, 58, .35);
}
.product-datasheet a:hover { background: var(--orange-2); transform: translateY(-1px); }
.product-datasheet a::before { content: "\2193"; font-weight: 800; }
.product-datasheet--summary { margin-top: 18px; }

/* ----- Tabs ----- */
.woocommerce-tabs { margin-top: 34px; }
.woocommerce-tabs ul.tabs {
  display: flex;
  gap: 8px;
  padding: 0 !important;
  margin: 0 0 20px !important;
  overflow-x: auto;
}
.woocommerce-tabs ul.tabs::before { display: none !important; }
.woocommerce-tabs ul.tabs li {
  background: var(--soft) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--r-pill) !important;
  margin: 0 !important;
  padding: 0 !important;
}
.woocommerce-tabs ul.tabs li::before,
.woocommerce-tabs ul.tabs li::after { display: none !important; }
.woocommerce-tabs ul.tabs li a {
  display: inline-block;
  padding: 10px 20px !important;
  font-family: var(--font-display);
  font-weight: 700 !important;
  font-size: 14px;
  color: var(--ink) !important;
}
.woocommerce-tabs ul.tabs li.active {
  background: var(--navy) !important;
  border-color: var(--navy) !important;
}
.woocommerce-tabs ul.tabs li.active a { color: #fff !important; }
.woocommerce-tabs .panel {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 26px 28px !important;
  line-height: 1.65;
}
.woocommerce-tabs .panel h2:first-of-type { display: none; }

/* Attribute table (MPN etc.) */
.woocommerce table.woocommerce-product-attributes {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  border-collapse: separate;
  overflow: hidden;
}
.woocommerce table.woocommerce-product-attributes th,
.woocommerce table.woocommerce-product-attributes td {
  padding: 12px 16px;
  font-style: normal;
  background: var(--paper);
}
.woocommerce table.woocommerce-product-attributes th {
  background: var(--soft);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
}

/* ----- Related products ----- */
.single-product section.related.products {
  background: transparent; /* theme's generic .products section styling */
  padding: 0;
  margin: 0;
}
.single-product .related.products > h2,
.single-product .up-sells > h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  margin: 44px 0 4px;
}

/* ----- Notices ----- */
.woocommerce-message,
.woocommerce-info {
  border-top-color: var(--navy);
  background: var(--soft);
  color: var(--ink);
  border-radius: var(--r-sm);
}
.woocommerce-message::before,
.woocommerce-info::before { color: var(--navy-3); }
