/*
 Theme Name: GEWI Child
 Template: astra
*/

/* ========== Global tokens ========== */
:root{
  --gw-btn-w: 184px;        /* fixed width for both buttons */
  --gw-blue: #007ac2;
  --gw-blue-dark: #00649e;
}

/*--------------------------------
  Breadcrumbs (sticky on scroll)
--------------------------------*/
.gewi-breadcrumb {
  font-size: .95rem;
  color: #445566;
  margin: 12px 0 22px;
  position: sticky;
  top: var(--gw-sticky-top, 0);
  z-index: 9;
  background: #fff;
  padding: 6px 0;
  border-bottom: 1px solid #eef2f6;
}
.gewi-breadcrumb a {
  color: #004f75;
  text-decoration: none;
  font-weight: 500;
}
.gewi-breadcrumb a:hover { text-decoration: underline; }
.gewi-breadcrumb .sep { color: #9ba9b5; margin: 0 6px; }
.gewi-breadcrumb .current { color: #1a1a1a; font-weight: 600; }

/*--------------------------------
  Category Hero (text left, image right)
--------------------------------*/
.gewi-cat-hero {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 16px;
  padding: 28px 32px;
  margin: 26px 0 34px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .05);
}
.gewi-cat-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr);
  gap: 28px;
  align-items: center;
}
@media (max-width: 1024px) {
  .gewi-cat-hero__inner { grid-template-columns: 1fr; gap: 22px; }
}
.gewi-cat-hero__text { max-width: 720px; }
.gewi-cat-hero__title {
  font-size: 2.15rem;
  font-weight: 800;
  line-height: 1.22;
  color: #002b45;
  margin: 0 0 10px;
}
.gewi-cat-hero__tagline {
  font-size: 1.08rem;
  line-height: 1.6;
  color: #334e68;
  font-weight: 600;
  margin: 0 0 16px;
}
.gewi-cat-hero__cta a {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 10px;
  background: var(--gw-blue);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  transition: background .2s;
}
.gewi-cat-hero__cta a:hover { background: var(--gw-blue-dark); }
.gewi-cat-hero__media {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.gewi-cat-hero__media .gewi-cat-hero__img {
  width: auto !important;
  max-width: 320px !important;
  max-height: 220px !important;
  height: auto !important;
  object-fit: contain !important;
  display: block;
  margin-left: auto;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
  background: #f7f9fb;
}
@media (max-width: 1024px) {
  .gewi-cat-hero__media { justify-content: flex-start; }
  .gewi-cat-hero__media .gewi-cat-hero__img {
    max-width: 280px !important;
    max-height: 200px !important;
    margin: 0;
  }
}
.gewi-archive-description {
  margin: 18px 0 12px;
  font-size: 1rem;
  line-height: 1.6;
  color: #445566;
}

/*==========================================================
  PRODUCT LIST — row cards with subtitle + inline details
==========================================================*/
.woocommerce ul.products {
  display: block !important;
  margin: 0;
  padding: 0;
}
.woocommerce ul.products li.product.gw-card,
.woocommerce ul.products li.product {
  list-style: none;
  display: block !important;
  width: 100% !important;
  margin: 0 0 12px 0 !important;
  border: 1px solid #e6ecf1;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  position: relative;
  transition: box-shadow .2s, transform .2s, border-color .2s, background .2s;
}
.woocommerce ul.products li.product:hover,
.woocommerce ul.products li.product:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(2, 28, 55, .08);
  border-color: #cfe0ea;
  background: #fcfeff;
}
.woocommerce ul.products li.product.is-open {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(2, 28, 55, .1);
  border-color: #bcd6e6;
  background: #fafdff;
}

/* grid: image | content */
.gw-card__inner,
.woocommerce ul.products li.product .woocommerce-LoopProduct-link {
  display: grid !important;
  grid-template-columns: 200px 1fr !important;
  gap: 18px !important;
  align-items: stretch !important;
  padding: 14px !important;
  text-decoration: none !important;
}
@media (max-width: 960px) {
  .gw-card__inner,
  .woocommerce ul.products li.product .woocommerce-LoopProduct-link {
    grid-template-columns: 1fr !important;
  }
}

/* media (left) */
.gw-card__media { display: block; }
.woocommerce ul.products li.product img {
  width: 100% !important;
  height: auto !important;
  max-width: 180px !important;
  max-height: 140px !important;
  object-fit: contain !important;
  margin: 0 !important;
  border-radius: 8px;
  background: #f6f8fa;
  border: 1px solid #eef2f6;
  padding: 6px;
}

/* body (right) */
.gw-card__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.gw-card__title {
  font-size: 1.18rem;
  line-height: 1.35;
  margin: 2px 0 4px;
}
.gw-card__title a {
  color: #062b46;
  text-decoration: none;
  font-weight: 800;
}
.gw-card__title a:hover { text-decoration: underline; }
.gw-card__subtitle {
  font-size: .98rem;
  color: #2a455a;
  line-height: 1.5;
  margin: 0 0 8px;
}
.gw-card__meta-line {
  font-size: .92rem;
  color: #5b6c7a;
  margin: 0 0 12px;
}

/* actions bottom-right */
.gw-card__actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-self: flex-end;
  justify-content: flex-end; /* right alignment */
}
@media (max-width: 960px) { .gw-card__actions { align-self: flex-start; justify-content:flex-start; } }

/*--------------------------------
  Buttons
--------------------------------*/
.gw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .55rem 1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, border-color .2s, box-shadow .2s, transform .1s, color .15s;
  min-height: 40px;
  box-sizing: border-box;
}

/* Go to product page — equal width and aligned with View details (inside Overview) */
.gw-btn--primary{
  inline-size: var(--gw-btn-w);
  min-inline-size: var(--gw-btn-w);
  background:#f6f8fa;
  color:#111;
  border:1px solid #dbe2ea;
}
.gw-btn--primary:hover,
.gw-btn--primary:focus{
  background:#eef2f6;
  border-color:#cfd7e2;
}

/* View details — always blue */
.gw-btn--cta {
  inline-size: var(--gw-btn-w);
  min-inline-size: var(--gw-btn-w);
  background: var(--gw-blue);
  color: #000 !important;
  border-color: var(--gw-blue);
  position: relative;
  padding-right: 2.2rem; /* space for arrow */
  box-shadow: 0 6px 14px rgba(16,132,208,.25);
}
.gw-btn--cta:hover {
  color: #fff !important;
  background: #006fb6;
  border-color: #006fb6;
  box-shadow: 0 8px 18px rgba(16,132,208,.30);
}
.gw-btn--cta::after {
  content: "";
  position: absolute;
  right: .7rem;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-right: 2px solid #fff !important;
  border-bottom: 2px solid #fff !important;
  transform: rotate(45deg);
  opacity: .95;
  transition: transform .2s ease;
}
.woocommerce ul.products li.product.is-open .gw-btn--cta::after {
  transform: rotate(-135deg);
}
.woocommerce ul.products li.product .gw-card__actions .gw-btn--cta:active {
  transform: scale(.97);
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
}

/* keep View Details blue in all states */
.gw-card .gw-btn--cta,
.gw-card .gw-btn--cta:hover,
.gw-card .gw-btn--cta:focus,
.gw-card .gw-btn--cta:active,
.woocommerce ul.products li.product.is-open .gw-btn--cta {
  background: var(--gw-blue) !important;
  border-color: var(--gw-blue) !important;
  color:#fff !important;
}
.gw-card .gw-btn--cta:not(:hover){ color:#111 !important; }

/* reset theme button styles inside cards */
.gw-card .button,
.gw-card .wp-element-button { all: unset; }

/*------------------------------
  Inline Details Panel
------------------------------*/
.gw-card__details {
  border-top: 1px solid #eef2f6;
  background: #fbfdff;
  padding: 0 14px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .25s ease, padding .25s ease, opacity .2s ease;
}
.woocommerce ul.products li.product.is-open .gw-card__details {
  padding: 14px;
  max-height: 1000px;
  opacity: 1;
}

/* grid columns inside details */
.gw-details__grid { 
  display: grid; 
  grid-template-columns: 1.2fr .8fr; 
  gap: 18px; 
}
@media (max-width: 960px) { 
  .gw-details__grid { grid-template-columns: 1fr; } 
}

/* sections */
.gw-details__section {
  background: #fff;
  border: 1px solid #e9edf3;
  border-radius: 12px;
  padding: 12px;
}
.gw-details__section--downloads { align-self: start; }

/* Overview spans full width of the details grid */
.gw-details__section--overview{ 
  grid-column: 1 / -1;
}

/* 2-column content inside Overview only when topics exist */
.gw-details__section--overview .gw-details__content.has-topics{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}
@media (max-width: 960px){
  .gw-details__section--overview .gw-details__content.has-topics{ grid-template-columns: 1fr; }
}

/* Overview items */
.gw-overview-item{
  border: 1px dashed #e8eef5;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}
.gw-overview-topic{
  font-weight: 800;
  color: #18364a;
  margin: 0 0 6px;
  line-height: 1.4;
}
.gw-overview-text{
  color: #28485d;
  line-height: 1.65;
  margin: 0;
}

/* headings + body text baseline for sections */
.gw-details__heading {
  font-weight: 800;
  color: #062b46;
  margin: 0 0 8px;
}
.gw-details__content {
  font-size: .96rem;
  line-height: 1.6;
  color: #3a4e60;
}

/* === Text spacing tweaks (compact & consistent) === */
.gw-details__content p,
.gw-details__content li,
.gw-overview-item p,
.gw-overview-text,
.gw-specs__row dd,
.gw-specs__row dt {
  line-height: 1.35em;
}
.gw-details__content p,
.gw-overview-item p,
.gw-overview-text { 
  margin-bottom: 0.4em;
}
.gw-details__content ul,
.gw-details__content ol {
  margin: 0 0 .6em 1.2em;
  padding: 0;
}
.gw-details__content li { 
  margin: .2em 0;
}
.gw-details__heading { 
  margin-bottom: 6px;
}
.gw-overview-topic { 
  margin-bottom: 4px;
}

/* footer INSIDE sections (Overview CTA alignment) */
.gw-section__footer{
  display:flex;
  justify-content:flex-end;
  margin-top:10px;
}

/* specs */
.gw-specs { margin: 0; }
.gw-specs__row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px dashed #e8eef5;
}
.gw-specs__row:last-child { border-bottom: 0; }
.gw-specs__row dt { font-weight: 700; color: #18364a; }
.gw-specs__row dd { margin: 0; color: #28485d; }

/* features */
.gw-features { margin: 0; padding-left: 18px; }
.gw-features li { margin: 4px 0; }

/* downloads */
.gw-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gw-downloads__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .45rem .7rem;
  border-radius: 9px;
  background: #f1f7ff;
  border: 1px solid #cfe2fb;
  color: #0a3a6b;
  text-decoration: none;
  font-weight: 700;
}
.gw-downloads__btn:hover { background: #e8f2ff; }

/* legacy footer (unused) */
.gw-details__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}
