/* ============================================================
   Cooprtim 2.0 — WordPress / WooCommerce layout glue
   Maps core markup and WooCommerce markup onto the concept
   design system. Loaded after store.css so it can adjust it.
   ============================================================ */

/* ---------- header offset ----------
   The header is in normal flow, so the content needs no offset on any page.
   The WordPress admin bar still pushes the whole page down on its own. */
.cooprtim-content { padding-block-start: 0; }

/* Solid, readable header outside the homepage hero. */
body:not(.cooprtim-front) .hd {
  background: color-mix(in srgb, #faf4ea 94%, transparent);
  border-block-end: 1px solid rgba(18, 59, 37, .1);
}

/* ---------- navigation list from wp_nav_menu ---------- */
.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 1.8vw, 2.2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav__list .menu-item { position: relative; }
.nav__list .sub-menu {
  position: absolute;
  inset-block-start: calc(100% + .6rem);
  inset-inline-end: 0;
  min-width: 14rem;
  padding: .6rem;
  margin: 0;
  list-style: none;
  border-radius: 10px;
  background: #fffdf7;
  box-shadow: 0 24px 48px -28px rgba(40, 30, 10, .55);
  border: 1px solid rgba(18, 59, 37, .1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  z-index: 90;
}
.nav__list .menu-item:hover > .sub-menu,
.nav__list .menu-item:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.nav__list .sub-menu a { display: block; padding: .5rem .7rem; border-radius: 7px; }
.nav__list .sub-menu a:hover { background: rgba(18, 59, 37, .06); }

@media (max-width: 980px) {
  .nav__list { display: none; }
}

/* ---------- page shell ---------- */
.cooprtim-main { padding-block: clamp(1.6rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem); }
.cooprtim-container { width: min(var(--maxw), calc(100% - clamp(2.2rem, 5vw, 5rem))); margin-inline: auto; }

.cooprtim-page-header,
.cooprtim-shop__header { margin-block-end: clamp(1.4rem, 3vw, 2.4rem); }

.cooprtim-page-header__title,
.cooprtim-shop__title,
.cooprtim-entry__title,
.cooprtim-404__title {
  font-family: var(--head);
  font-weight: 700;
  line-height: 1.15;
  color: var(--forest-3);
  font-size: clamp(1.9rem, 4vw, 3rem);
  margin-block: .5rem 0;
}

.cooprtim-breadcrumbs { font-size: .8rem; color: var(--muted); }
.cooprtim-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.cooprtim-breadcrumbs li + li::before { content: "/"; margin-inline-end: .4rem; opacity: .5; }
.cooprtim-breadcrumbs a:hover { color: var(--forest); }

.cooprtim-layout__main { min-width: 0; }

/* ---------- WooCommerce: product grid as concept cards ---------- */
.cooprtim-shop .woocommerce-products-header,
.cooprtim-shop .term-description { margin-block-end: 1rem; }

.cooprtim-shop .woocommerce-result-count,
.cooprtim-shop .woocommerce-ordering { margin-block: 0 1.4rem; font-size: .9rem; color: var(--muted); }
.cooprtim-shop .woocommerce-ordering select {
  appearance: none;
  padding: .6rem 1rem;
  border-radius: 100px;
  border: 1px solid rgba(18, 59, 37, .18);
  background: #fffdf7;
  font: inherit;
  color: var(--forest);
}

.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: clamp(1rem, 2vw, 1.6rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.woocommerce ul.products li.product {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: visible;
  height: auto;
  float: none;
  width: auto;
  padding: .9rem;
  border-radius: 18px;
  background: #fffcf6;
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 20px 34px -24px rgba(105, 75, 35, .45), 0 2px 6px rgba(105, 75, 35, .05);
  transition: transform .45s var(--ease), box-shadow .45s;
  text-align: start;
}
.woocommerce ul.products li.product:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 46px -26px rgba(105, 75, 35, .55);
}

.woocommerce ul.products li.product .woocommerce-loop-product__link { display: block; }

.woocommerce ul.products li.product img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 12px;
  background: #f7f1e5;
  margin: 0 0 .75rem;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--ui);
  font-size: .98rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--forest-3);
  padding: 0;
  margin: 0 0 .35rem;
}

.woocommerce ul.products li.product .price {
  font-family: var(--num);
  font-weight: 700;
  color: var(--gold-dp);
  font-size: 1.02rem;
  margin-block-end: .7rem;
  display: block;
}
.woocommerce ul.products li.product .price del { opacity: .5; font-weight: 500; font-size: .85em; }

.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .added_to_cart {
  position: static;
  inset: auto;
  margin-block-start: auto;
  margin-block-end: 0;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .72rem 1rem;
  border-radius: 100px;
  background: var(--forest);
  color: #f7f0e2;
  font-weight: 600;
  font-size: .88rem;
  line-height: 1;
  transition: background .3s, transform .3s var(--ease);
}
.woocommerce ul.products li.product .button:hover,
.woocommerce ul.products li.product .added_to_cart:hover { background: var(--forest-2); transform: translateY(-1px); }

.woocommerce span.onsale,
.woocommerce ul.products li.product .onsale {
  position: absolute;
  inset-block-start: .9rem;
  inset-inline-start: .9rem;
  padding: .3rem .6rem;
  border-radius: 100px;
  background: var(--orange);
  color: #fff;
  font-family: var(--num);
  font-size: .7rem;
  font-weight: 700;
  line-height: 1;
}

/* ---------- class collision guard ----------
   The concept styles the header cart icon as `.cart`; WooCommerce uses the same
   class on the add-to-cart <form>. Reset the form so it is not a 44px circle. */
form.cart {
  position: static;
  display: flex;
  place-items: normal;
  width: auto;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  margin-block: 1.2rem;
}

/* ---------- single product ---------- */
/* Layout stays WooCommerce's float model: the product div also holds tabs and
   related products, so a grid on it would drag them into the columns. */
.cooprtim-shop--single div.product::after { content: ""; display: table; clear: both; }

@media (min-width: 900px) {
  .cooprtim-shop--single div.product div.images { width: 48%; float: inline-start; }
  .cooprtim-shop--single div.product div.summary { width: 48%; float: inline-end; }
}

.cooprtim-shop--single div.product div.summary { margin-block-end: 2rem; }
.cooprtim-shop--single div.product div.images .flex-control-thumbs { display: flex; gap: .5rem; }
.cooprtim-shop--single div.product div.images .flex-control-thumbs li { width: 22%; }

div.product div.images img { border-radius: 18px; background: #f7f1e5; }

div.product .product_title {
  font-family: var(--head);
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 1.15;
  color: var(--forest-3);
  margin-block: 0 .6rem;
}

div.product p.price,
div.product span.price {
  font-family: var(--num);
  font-weight: 700;
  color: var(--gold-dp);
  font-size: 1.6rem;
}

div.product form.cart {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  margin-block: 1.2rem;
}

div.product form.cart .quantity {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(18, 59, 37, .2);
  border-radius: 100px;
  overflow: hidden;
  background: #fffdf7;
}
div.product form.cart .quantity input.qty {
  width: 3.4rem;
  padding: .7rem .2rem;
  border: 0;
  text-align: center;
  font-family: var(--num);
  background: transparent;
}

div.product form.cart button.button,
div.product form.cart .single_add_to_cart_button {
  padding: .9rem 1.8rem;
  border: 0;
  border-radius: 100px;
  background: var(--forest);
  color: #f7f0e2;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: background .3s, transform .3s var(--ease);
}
div.product form.cart button.button:hover { background: var(--forest-2); transform: translateY(-1px); }

div.product .variations { width: 100%; border-collapse: collapse; margin-block-end: 1rem; }
div.product .variations th,
div.product .variations td { padding: .45rem 0; text-align: start; vertical-align: middle; }
div.product .variations select {
  width: 100%;
  padding: .65rem .9rem;
  border-radius: 10px;
  border: 1px solid rgba(18, 59, 37, .2);
  background: #fffdf7;
  font: inherit;
}

div.product .woocommerce-tabs ul.tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1rem; padding: 0; list-style: none; }
div.product .woocommerce-tabs ul.tabs li a {
  display: inline-block;
  padding: .55rem 1rem;
  border-radius: 100px;
  background: rgba(18, 59, 37, .07);
  font-size: .9rem;
}
div.product .woocommerce-tabs ul.tabs li.active a { background: var(--forest); color: #f7f0e2; }

.related.products > h2 { font-family: var(--head); font-size: 1.6rem; margin-block: 2rem 1rem; color: var(--forest-3); }

/* ---------- cart / checkout / account ---------- */
.cooprtim-shop .woocommerce table.shop_table,
.woocommerce-cart table.shop_table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 14px;
  overflow: hidden;
  background: #fffcf6;
  box-shadow: 0 20px 34px -30px rgba(105, 75, 35, .5);
}
.woocommerce-cart table.shop_table th { background: rgba(18, 59, 37, .06); font-size: .82rem; text-align: start; }
.woocommerce-cart table.shop_table th,
.woocommerce-cart table.shop_table td { padding: .8rem .7rem; border-block-end: 1px solid rgba(18, 59, 37, .08); }
.woocommerce-cart table.shop_table td.product-name a { font-weight: 600; color: var(--forest-3); }

.woocommerce-cart .cart-collaterals .cart_totals h2,
.woocommerce-checkout h3,
.woocommerce-account h2 {
  font-family: var(--head);
  color: var(--forest-3);
  font-size: 1.5rem;
  margin-block: 0 .8rem;
}

.woocommerce-cart .cart-collaterals .cart_totals table th,
.woocommerce-cart .cart-collaterals .cart_totals table td { padding: .5rem 0; text-align: start; }

.woocommerce .button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
  border-radius: 100px;
  border: 0;
  padding: .8rem 1.4rem;
  background: var(--forest);
  color: #f7f0e2;
  font-weight: 600;
  cursor: pointer;
  transition: background .3s;
}
.woocommerce .button:hover,
.woocommerce a.button:hover { background: var(--forest-2); color: #f7f0e2; }
.woocommerce .button.alt,
.woocommerce a.button.alt,
.woocommerce button.button.alt { background: var(--orange); color: #fff; }
.woocommerce .button.alt:hover { background: var(--orange-3); }

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce-Input {
  width: 100%;
  padding: .75rem .9rem;
  border-radius: 10px;
  border: 1px solid rgba(18, 59, 37, .2);
  background: #fffdf7;
  font: inherit;
  color: var(--text);
}
.woocommerce form .form-row label { font-size: .85rem; font-weight: 600; color: var(--forest-3); }

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  border-radius: 12px;
  border: 0;
  padding: .9rem 1.1rem;
  background: #fffcf6;
  box-shadow: 0 16px 30px -28px rgba(105, 75, 35, .6);
  list-style: none;
}
.woocommerce-message { border-inline-start: 4px solid #4a7a3a; }
.woocommerce-info { border-inline-start: 4px solid var(--gold); }
.woocommerce-error { border-inline-start: 4px solid #b4341f; }

/* ---------- blog / pages ---------- */
.cooprtim-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: clamp(1rem, 2vw, 1.6rem);
}
.cooprtim-card__title { font-family: var(--head); font-size: 1.25rem; line-height: 1.3; }
.cooprtim-entry__content { max-width: 70ch; }
.cooprtim-prose p { margin-block: 0 1rem; }

/* ---------- footer links from wp_nav_menu ---------- */
.ft__legal-list { display: contents; }
.ft__legal-list .menu-item { list-style: none; }

/* ---------- 404 ---------- */
.cooprtim-404__inner { text-align: center; padding-block: clamp(3rem, 10vw, 7rem); }
.cooprtim-404__code {
  font-family: var(--num);
  font-size: clamp(4rem, 14vw, 9rem);
  font-weight: 900;
  line-height: 1;
  color: rgba(18, 59, 37, .12);
  margin: 0;
}
.cooprtim-404__actions { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; margin-block-start: 1.4rem; }
.cooprtim-button {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .8rem 1.4rem;
  border-radius: 100px;
  background: var(--forest);
  color: #f7f0e2;
  font-weight: 600;
}
.cooprtim-button--ghost { background: transparent; color: var(--forest); box-shadow: inset 0 0 0 1.5px var(--forest); }

/* ---------- drawer scrim ---------- */
.scrim.is-on { opacity: 1; visibility: visible; }
.drawer.is-open { transform: none; }

/* ---------- mini-cart drawer lines (WP data instead of the prototype demo) ---------- */
.drawer__body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.drawer__item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: start;
  padding: .85rem 0;
  border-bottom: 1px solid rgba(18, 59, 37, .09);
}
.drawer__thumb {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(18, 59, 37, .06);
}
.drawer__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.drawer__meta { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.drawer__name { font-size: .86rem; line-height: 1.35; color: var(--forest); }
.drawer__price { font-size: .82rem; font-weight: 600; color: var(--forest); }
.drawer__qty { display: inline-flex; align-items: center; gap: .55rem; margin-top: .15rem; }
.drawer__qty button {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; line-height: 1;
  background: rgba(18, 59, 37, .09); color: var(--forest);
}
.drawer__qty span { min-width: 1.2ch; text-align: center; font-size: .82rem; }
.drawer__remove {
  font-size: .7rem;
  color: #8d8674;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.drawer__fees { margin-top: .9rem; }
.drawer__foot { border-top: 1px solid rgba(18, 59, 37, .12); }
.drawer__total { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.drawer__empty { font-size: .85rem; color: #6f7d6c; padding: 1rem 0; }

@media (max-width: 520px) {
  .drawer__item { grid-template-columns: 52px minmax(0, 1fr) auto; gap: .6rem; }
  .drawer__thumb { width: 52px; height: 52px; }
  .drawer__name { font-size: .8rem; }
}

/* keep drawer row content hugging its own column instead of stretching */
.drawer__meta { align-items: flex-start; }
.drawer__item { align-items: start; padding: .65rem 0; }
.drawer__pack { align-self: flex-start; width: auto; }
.drawer__qty { align-self: flex-start; }
.drawer__remove { align-self: start; justify-self: end; }
@media (max-width: 520px) {
  .drawer__item { padding: .55rem 0; }
  .drawer__remove { font-size: .66rem; }
}

/* drawer: readable line, compact remove control */
.drawer__name { color: var(--forest); font-weight: 500; }
.drawer__price { color: #6f7d6c; font-weight: 500; }
.drawer__remove {
  font-size: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(18, 59, 37, .06);
  text-decoration: none;
}
.drawer__remove::before { content: '✕'; font-size: .68rem; color: #6f7d6c; }
