/* literally: the shop. Product grid, product page, cart, checkout and account. WooCommerce's own sheets are off
   (inc/woocommerce.php), so this file is the whole shop. Each product card takes the next crayon color. */

/* Product grid: four across, two on a phone. Each card is one link: photo on a crayon-tinted card, name, price */
.woocommerce ul.products, ul.products {
  list-style: none; margin: var(--space-3) 0 var(--space-5); padding: 0;
  display: grid; gap: var(--space-5) var(--space-4);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
ul.products li.product { position: relative; margin: 0; padding: 0; min-width: 0; }
ul.products li.product .woocommerce-loop-product__link {
  display: grid; gap: 12px; color: var(--crayon-black); text-decoration: none;
}
ul.products li.product .woocommerce-loop-product__link img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; margin: 0;
  /* true colors: no tint behind the photo (a tint made white shirts look blue); the crayon frame outlines it */
  background: var(--paper); border-radius: var(--radius);
}
ul.products li.product .woocommerce-loop-product__link::before {
  content: ""; position: absolute; left: -7px; top: -7px; width: calc(100% + 14px); aspect-ratio: 4 / 5.07;
  border: 3px solid var(--crayon); border-radius: var(--radius); filter: url(#crayon-wobble);
  pointer-events: none; z-index: 1; transition: transform 0.2s ease;
}
ul.products li.product .woocommerce-loop-product__link:hover::before,
ul.products li.product .woocommerce-loop-product__link:focus-visible::before { transform: rotate(-1.2deg) scale(1.01); }
ul.products li.product .woocommerce-loop-product__link:focus-visible { outline: none; }
ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--hand); font-weight: 400; font-size: 1.625rem; line-height: 1.1; margin: 8px 0 0; padding: 0; text-wrap: balance;
}
ul.products li.product .price { display: block; color: var(--crayon-black); font-weight: 800; font-size: 1.125rem; margin: 0; }
ul.products li.product .price del { color: var(--pencil); font-weight: 600; margin-right: 6px; }
ul.products li.product .price ins { text-decoration: none; }
.onsale {
  position: absolute; top: 12px; left: 12px; z-index: 2; padding: 4px 12px; margin: 0;
  background: var(--sun-yellow); color: var(--crayon-black); border-radius: var(--radius-small); font-weight: 800; font-size: 1rem;
}
.woocommerce-result-count { color: var(--pencil); font-size: var(--text-small); margin: 0; }
.woocommerce-ordering { margin: 0 0 var(--space-2); }
.woocommerce-ordering select { min-width: 240px; }
.woocommerce-products-header { display: none; }
.woocommerce-pagination ul { list-style: none; padding: 0; display: flex; gap: 8px; }
@media (max-width: 1040px) { .woocommerce ul.products, ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .woocommerce ul.products, ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4) var(--space-3); }
  ul.products li.product .woocommerce-loop-product__title { font-size: 1.375rem; }
}

/* Product page: photos left, buying box right; stacked on a phone */
.single-product div.product {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--space-4) var(--space-6);
  padding-top: var(--space-4); align-items: start;
}
.single-product div.product > :not(.woocommerce-product-gallery):not(.summary):not(.onsale) { grid-column: 1 / -1; }
.woocommerce-product-gallery { position: relative; margin: 0; min-width: 0; }
.woocommerce-product-gallery .flex-viewport,
.woocommerce-product-gallery__wrapper { border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.woocommerce-product-gallery__wrapper { margin: 0; padding: 0; }
.woocommerce-product-gallery__image a { display: block; }
.woocommerce-product-gallery__image img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: contain; background: var(--paper); }
.woocommerce-product-gallery::before {
  content: ""; position: absolute; inset: -8px; bottom: auto; aspect-ratio: 4 / 5.05; width: calc(100% + 16px);
  border: var(--line); border-radius: var(--radius); filter: url(#crayon-wobble); pointer-events: none; z-index: 2;
}
.woocommerce-product-gallery .flex-control-thumbs {
  list-style: none; padding: 0; margin: var(--space-3) 0 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px;
}
.woocommerce-product-gallery .flex-control-thumbs li { margin: 0; }
.woocommerce-product-gallery .flex-control-thumbs img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; cursor: pointer; opacity: 0.6; transition: opacity 0.15s ease;
  border-radius: var(--radius-small); background: var(--paper); border: 2px solid var(--paper-shade);
}
.woocommerce-product-gallery .flex-control-thumbs img.flex-active,
.woocommerce-product-gallery .flex-control-thumbs img:hover { opacity: 1; }
.woocommerce-product-gallery__trigger { display: none; }

.summary { min-width: 0; }
.summary .product_title { font-size: var(--h2); margin: 0 0 var(--space-1); }
.summary .price { font-size: 1.625rem; font-weight: 800; color: var(--crayon-black); margin: 0 0 var(--space-3); }
.summary .price del { color: var(--pencil); font-weight: 600; margin-right: 8px; }
.summary .price ins { text-decoration: none; }
.summary .woocommerce-product-details__short-description { margin-bottom: var(--space-3); }
.summary form.cart { display: grid; gap: var(--space-2); margin: 0 0 var(--space-3); }
/* one shirt per add; the cart changes the number. WooCommerce's variation script sets display:block inline */
.summary .quantity { display: none !important; }
.summary table.variations { border: 0; margin: 0; width: 100%; border-collapse: collapse; }
.summary table.variations tr { display: grid; gap: 6px; margin-bottom: var(--space-2); }
.summary table.variations th, .summary table.variations td { display: block; padding: 0; text-align: left; border: 0; }
.summary table.variations th label { font-family: var(--hand); font-size: 1.5rem; font-weight: 400; }
.summary table.variations select { width: 100%; max-width: 340px; }
/* a choice with only one option (the shirt's color) is preselected: hide its row */
.summary table.variations tr:has(select > option:nth-child(2):last-child) { display: none; }
.summary .reset_variations { display: none !important; }
.summary .single_variation_wrap { display: grid; gap: var(--space-2); }
.summary .woocommerce-variation-price .price { font-size: 1.25rem; margin: 0; }
.summary .woocommerce-variation-availability { color: var(--pencil); font-size: var(--text-small); }
.summary .woocommerce-variation-add-to-cart { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.summary .single_add_to_cart_button { min-width: 240px; min-height: 56px; font-size: 1.1875rem; }
.summary .single_add_to_cart_button.disabled { opacity: 0.55; cursor: not-allowed; }
.product-notes { display: grid; gap: 8px; color: var(--pencil); font-size: var(--text-small); max-width: 46ch; margin-top: var(--space-1); }
.product-notes p { margin: 0; padding-left: 30px; position: relative; }
.product-notes p::before {
  content: ""; position: absolute; left: 0; top: 0.3em; width: 20px; height: 12px; background: var(--water-blue);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 12'%3E%3Cpath d='M2 7c3-3 6 3 9-1s5-3 7 0' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 12'%3E%3Cpath d='M2 7c3-3 6 3 9-1s5-3 7 0' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.product-notes p + p::before { background: var(--mane-orange); }
.product-description { max-width: var(--measure); padding-top: var(--space-2); font-size: 1.1875rem; }
.related.products, .upsells.products { padding-top: var(--space-4); }
.related.products > h2, .upsells.products > h2 { margin: 0 0 var(--space-2); }
@media (max-width: 900px) {
  .single-product div.product { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); padding-top: var(--space-2); }
  .woocommerce-product-gallery { margin-inline: 8px; }
  .summary .single_add_to_cart_button { width: 100%; }
}

/* Notices on shop pages */
.woocommerce-notices-wrapper:empty { display: none; }
.woocommerce-message .button, .woocommerce-info .button { order: 2; }

/* Size chart and other tables WooCommerce or Printify put in a description */
.prose table, .woocommerce table.shop_table, .woocommerce-table {
  width: 100%; border-collapse: collapse; margin: 0 0 var(--space-3); font-size: var(--text-small);
}
.prose th, .prose td, .woocommerce table.shop_table th, .woocommerce table.shop_table td {
  text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--paper-shade);
}
.prose table { display: block; overflow-x: auto; }

/* Cart and checkout (WooCommerce blocks; their own sheets stay, these only set our type, lines and fields) */
.wc-block-cart, .wc-block-checkout { font-family: var(--body); }
.wc-block-components-title, .wc-block-cart__totals-title, .wc-block-components-checkout-step__title {
  font-family: var(--hand) !important; font-weight: 400 !important; text-transform: none !important; letter-spacing: 0 !important;
  font-size: 1.625rem !important;
}
.wc-block-components-text-input input, .wc-block-components-combobox .wc-block-components-combobox-control input,
.wc-blocks-components-select .wc-blocks-components-select__select, .wc-block-components-textarea {
  border: var(--line-thin) !important; border-radius: var(--radius-small) !important; font-size: max(16px, 1rem) !important;
}
.wc-block-components-text-input input:focus { box-shadow: 0 0 0 2px var(--water-blue-ink) !important; }
.wc-block-cart-item__image img { border-radius: var(--radius-small); }
.wc-block-components-product-name,
.wc-block-cart-items .wc-block-components-product-name { font-family: var(--hand); font-size: 1.375rem !important; line-height: 1.15; color: var(--crayon-black); text-decoration: none; }
.wc-block-components-product-metadata { font-size: 0.9375rem; color: var(--pencil); }
.wc-block-components-panel, .wc-block-components-totals-wrapper { border-color: var(--paper-shade) !important; }
.wp-block-woocommerce-empty-cart-block .wp-block-heading { font-family: var(--hand); }
.wc-block-components-button:not(.is-link) .wc-block-components-button__text { position: relative; }

/* My account */
.woocommerce-MyAccount-navigation ul { list-style: none; padding: 0; margin: 0 0 var(--space-3); display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); }
.woocommerce-MyAccount-navigation a { display: inline-flex; min-height: 44px; align-items: center; color: var(--crayon-black); font-weight: 700; }
.woocommerce-MyAccount-navigation .is-active a { text-decoration: underline; text-decoration-color: var(--water-blue); text-decoration-thickness: 3px; }
.woocommerce form .form-row { display: grid; gap: 6px; margin: 0 0 var(--space-2); }
.woocommerce form .form-row input.input-text { width: 100%; }
.woocommerce form.login, .woocommerce form.register { max-width: 460px; }

/* Photoswipe (the full-size photo viewer): only what our theme hides by default */
.pswp { z-index: 1000; }

/* Size chart under the description */
.product-description .product-description__chart { font-size: var(--h3); margin-top: var(--space-4); }
table.size-chart { display: table; width: 100%; max-width: 640px; font-size: 1rem; }
table.size-chart th { font-weight: 800; }
table.size-chart td:first-child, table.size-chart th:first-child { font-family: var(--hand); font-size: 1.375rem; width: 4rem; }

/* Shop page: one section per series */
.shop-series + .shop-series { margin-top: var(--space-5); }
.shop-series__title { margin: 0; }
.shop-series__title a { color: var(--crayon-black); text-decoration: none; }
.shop-series__title a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
