/* ========== Responsive tweaks for tabs/card ========== */
@media (max-width: 768px) {
  .pdp-tabs {
    grid-template-columns: 1fr 1fr;
    justify-content: center;
    max-width: 100%;
    margin: 0 auto;
  }
  .pdp-tab { font-size: 11px; padding: 14px 10px; text-align: center; white-space: nowrap; }
  .pdp-body { padding: 16px; max-width: 100%; margin: 0 auto; }
  .pdp-tabs::before, .pdp-tabs::after { bottom: -1px; }
}

/* ========== Tabs + Card ========== */
.pdp-tabs, .pdp-tab, .pdp-body { box-sizing: border-box; }

.pdp-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 40px 0 0;
  z-index: 2;
}
.pdp-tab {
  display: flex; align-items: center; justify-content: center;
  padding: 16px 20px; background: transparent; color: #2f2f2f;
  text-transform: uppercase; font-weight: 600; font-size: 10px; letter-spacing: .17em;
  border: none; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.pdp-tab:hover:not(.is-active){ background:#4d4d4d; color:#fff; }
.pdp-tab:focus { outline: none; }
.pdp-tab:focus-visible { outline: 2px dotted #9b9b9b; outline-offset: 2px; }
.pdp-tab.is-active {
  background: transparent; color:#2f2f2f; border:1px solid #333; border-bottom:none;
  margin-bottom:-1px; position:relative; z-index:2;
}
.pdp-body { border:1px solid #333; border-top:none; background:transparent; padding:24px; position:relative; z-index:1; }
.pdp-panel { display:none; }
.pdp-panel.is-active { display:block; }

/* Baseline under inactive side */
.pdp-tabs::before, .pdp-tabs::after {
  content:""; position:absolute; bottom:0; height:1px; background:#333; width:50%; z-index:1; display:none;
}
.pdp-tabs[data-active="calc"]::after { display:block; right:0; }
.pdp-tabs[data-active="docs"]::before { display:block; left:0; }
@supports (transform: translateY(1px)) {
  .pdp-tabs::before, .pdp-tabs::after { transform: translateY(.5px); }
}

/* ========== Price area tweaks ========== */
.cw-material-pdp .material-price-stock .price { margin:0; line-height:1.5; }
.cw-material-pdp .entry-summary p.price { margin-bottom:0; }

/* per-yard price – support both old and new class names */
.cw-material-pdp .material-unit-price,
.cw-material-pdp .material-price-stock .details.unit-price {
  display:block; margin:.25rem 0 0; line-height:1.5; font-style:italic;
}

/* ========== ATC block ========== */
.material-atc { margin-bottom: 14px; }

/* Generic grid used by both simple and variable forms */
.material-cart {
  display:grid;
  grid-template-columns: 110px minmax(0,1fr); /* left qty col + fluid right col */
  column-gap:1rem; row-gap:.5rem; align-items:center; width:100%;
}
.material-cart > * { min-width:0; }

/* Label + qty visuals */
.material-qty-label {
  grid-column:1 / 2; justify-self:start; font-size:.8rem; letter-spacing:.05em;
  text-transform:uppercase; color:#777; margin-bottom:.25rem;
}
.material-cart .quantity { grid-column:1 / 2; }
.material-cart .quantity input.qty {
  width:100%; height:42px; padding:0 .5rem; text-align:center;
  border:1px solid #ddd; background:#f8f8f8; border-radius:2px; font-size:1rem; box-sizing:border-box;
}

/* Primary button baseline (theme can still override colors) */
.material-primary-btn {
  width:100%; height:42px; line-height:42px; padding:0; border-radius:2px;
  text-transform:uppercase; letter-spacing:.06em; font-weight:600; text-align:center;
  transition:.2s;
}

/* -------- Simple products -------- */
/* Button sits in the right column for the simple form */
.cart.material-cart .material-primary-btn { grid-column:2 / 3; }

/* -------- Variable products (single form, two buttons) -------- */
/* The grid container is the inner .variations_button element */
.variations_button.material-cart {
  display:grid;
  grid-template-columns:110px minmax(0,1fr);
  column-gap:1rem; row-gap:.5rem; width:100%;
}

/* Level 1 (row 1): label */
.material-qty-label { grid-row:1; }

/* Level 2 (row 2): qty left + Add to Cart right */
.variations_button.material-cart .quantity { grid-column:1 / 2; grid-row:2; }
.material-atc-row { grid-column:2 / 3; grid-row:2; align-self:stretch; }
.material-atc-row .single_add_to_cart_button { width:100%; box-sizing:border-box; }

/* Level 3 (row 3): Order Sample right */
.material-sample-row { grid-column:2 / 3; grid-row:3; }
.material-sample-row .order-sample-btn { width:100%; box-sizing:border-box; }

/* Order Sample look (outlined) */
.order-sample-btn {
  background:transparent; color:#2f2f2f; border:1px solid #333;
}
.order-sample-btn:hover { background:#4d4d4d; color:#000; border-color:#4d4d4d; }
.order-sample-btn:focus-visible { outline:2px dotted #9b9b9b; outline-offset:2px; }

/* Mobile: stack everything */
@media (max-width: 768px) {
  .variations_button.material-cart { grid-template-columns:1fr; }
  .material-qty-label { grid-column:1; grid-row:1; }
  .variations_button.material-cart .quantity { grid-column:1; grid-row:2; }
  .material-atc-row { grid-column:1; grid-row:3; }
  .material-sample-row { grid-column:1; grid-row:4; }
}

/* ========== Documents / downloads (unchanged visuals, trimmed) ========== */
.tearrow { display:flex; flex-direction:column; gap:14px; margin-top:10px; }
.tearrow-link { display:inline-flex; align-items:center; gap:12px; color:#3a3a3a; text-transform:uppercase; letter-spacing:.18em; font-size:10px; font-weight:500; text-decoration:none; transition:color .2s; }
.tearrow-link:hover { color:#000; text-decoration:underline; }
.tearrow-icon { position:relative; width:17px; height:17px; border-radius:50%; border:2px solid #c9ccca; display:inline-block; }
.tearrow-icon::after { content:""; position:absolute; left:50%; top:50%; width:5px; height:5px; border-right:2px solid #9aa09d; border-bottom:2px solid #9aa09d; transform:translate(-50%,-60%) rotate(45deg); }


/* ===== Primary CTA: Add to Cart ===== */
/* tune these once and everything below will follow */
.cw-material-pdp {
  --cta-base: #6a6a6a;   /* lighter base */
  --cta-hover: #4d4d4d;  /* current hover tone */
  --cta-text: #ffffff;
  --cta-disabled: 0.5;   /* opacity when disabled */
}

/* simple-product ATC */
.cart.material-cart .single_add_to_cart_button.material-primary-btn {
  background: var(--cta-base);
  border: 1px solid var(--cta-base);
  color: var(--cta-text);
}

/* variable-product ATC (right column, row 2) */
.material-atc-row .single_add_to_cart_button.material-primary-btn {
  background: var(--cta-base);
  border: 1px solid var(--cta-base);
  color: var(--cta-text);
}

/* hover / focus / disabled states */
.cart.material-cart .single_add_to_cart_button.material-primary-btn:hover,
.material-atc-row .single_add_to_cart_button.material-primary-btn:hover {
  background: var(--cta-hover);
  border-color: var(--cta-hover);
}

.cart.material-cart .single_add_to_cart_button.material-primary-btn:focus-visible,
.material-atc-row .single_add_to_cart_button.material-primary-btn:focus-visible {
  outline: 2px solid #9b9b9b;
  outline-offset: 2px;
}

.cart.material-cart .single_add_to_cart_button.material-primary-btn:disabled,
.material-atc-row .single_add_to_cart_button.material-primary-btn:disabled {
  opacity: var(--cta-disabled);
  cursor: not-allowed;
}

/* keep Order Sample as secondary (outlined) */
.material-sample-row .order-sample-btn {
  background: transparent;
  color: #2f2f2f;
  border: 1px solid #333;
}
.material-sample-row .order-sample-btn:hover {
  background: #4d4d4d;
  color: #000;
  border-color: #4d4d4d;
}
