/* ==========================================================================
   Patyczki-NS — WooCommerce (klasyczne szablony motywu)
   Ładowany po custom.css. Mobile-first: baza < 992 px, zakres tabletowy
   od 640 px tam, gdzie wymaga tego układ, jeden blok @media (min-width: 992px).
   Klasy WooCommerce na ul/li/p/tr (wymagane przez skrypty) stylowane kontekstowo.
   ========================================================================== */

/* ---------- Karta produktu: uzupełnienia ---------- */
.product-tag.is-sale {
  background: var(--green);
  color: var(--white);
}

.product-card-stock {
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--red);
}

.price-value ins {
  text-decoration: none;
}

.price-value del {
  margin-left: 6px;
  font-size: 0.75em;
  font-weight: 400;
  color: var(--gray);
}

.cart-button .is-added {
  display: none;
}

.cart-button.added .theme-icon {
  display: none;
}

.cart-button.added .is-added {
  display: inline-block;
}

.cart-button.added {
  background: var(--green);
}

.cart-button.loading {
  opacity: 0.6;
  pointer-events: none;
}

.cart-button.is-muted {
  border: 1px solid var(--stone);
  background: var(--white);
  color: var(--graphite);
}

.cart-button.is-muted:hover {
  border-color: var(--graphite);
  background: var(--white);
}

.cart-button:focus-visible {
  outline-offset: 2px;
}

/* Link „Zobacz koszyk" WooCommerce zastępuje komunikat motywu (.cart-toast). */
.product-card .added_to_cart,
.add-to-cart .added_to_cart {
  display: none;
}

/* ---------- Komunikat „Dodano do koszyka" ---------- */
.cart-toast {
  position: fixed;
  inset: auto 12px calc(12px + env(safe-area-inset-bottom)) 12px;
  z-index: 120;
  pointer-events: none;
}

.cart-toast-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  max-width: 440px;
  margin-left: auto;
  padding: 14px 8px 14px 16px;
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 16px 40px rgba(32, 35, 32, 0.16);
  font-size: 0.9375rem;
  line-height: 1.4;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.cart-toast.is-visible .cart-toast-inner {
  opacity: 1;
  transform: none;
}

.cart-toast-inner > .theme-icon {
  color: var(--green);
}

.cart-toast-text {
  flex: 1 1 160px;
  min-width: 0;
}

.cart-toast-inner .link-arrow {
  min-height: 44px;
  font-weight: 600;
  text-decoration: underline;
}

.cart-toast-inner .icon-button {
  width: 44px;
  height: 44px;
}

.cart-toast-inner.is-info {
  border-left-color: var(--olive);
  padding-right: 16px;
}

/* Na stronie produktu (mobile) nad przypiętym paskiem. */
.has-sticky-cta .cart-toast {
  bottom: calc(var(--sticky-cta-h) + 12px + env(safe-area-inset-bottom));
}

/* ---------- Powiadomienia WooCommerce ---------- */
.woocommerce-notices-wrapper:empty {
  display: none;
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.woocommerce-NoticeGroup .woocommerce-error {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
  background: var(--cream);
  font-size: 0.9375rem;
  line-height: 1.5;
  list-style: none;
}

.woocommerce-info {
  border-left-color: var(--olive);
  background: var(--white);
}

.woocommerce-error {
  flex-direction: column;
  gap: 6px;
  border-left-color: var(--red);
  background: #fdf5f4;
}

.woocommerce-error li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
}

.notice-icon {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--green);
}

.woocommerce-info .notice-icon {
  color: var(--olive);
}

.woocommerce-error .notice-icon {
  color: var(--red);
}

.notice-text {
  flex: 1 1 auto;
  min-width: 0;
}

.notice-text a,
.woocommerce-error a {
  font-weight: 600;
}

/* Przycisk w komunikacie (np. „Zobacz koszyk") - jako link akcji. */
.woocommerce-message .button,
.woocommerce-info .button,
.woocommerce-error .button {
  float: right;
  margin-left: 12px;
  padding: 0;
  border: 0;
  background: none;
  font-weight: 600;
  text-decoration: underline;
  color: var(--olive);
}

/* ---------- Archiwum: nagłówek, wyniki, stan pusty ---------- */
.page-header-aside > div:empty {
  display: none;
}

.page-header .intro a {
  color: var(--graphite);
}

.shop-main.is-loading .product-grid,
.shop-main.is-loading .pagination {
  opacity: 0.45;
  transition: opacity var(--dur) var(--ease);
}

.shop-empty {
  display: grid;
  justify-items: start;
  gap: 4px;
  padding: 32px 24px;
  border: 1px dashed var(--stone);
  border-radius: var(--radius);
  background: var(--cream);
}

.shop-empty > .theme-icon {
  margin-bottom: 8px;
  color: var(--green);
}

.shop-empty h2 {
  font-size: 1.5rem;
}

.shop-empty p {
  color: var(--gray);
}

.shop-empty .buttons {
  margin-top: 12px;
}

.filters-actions a.btn {
  text-decoration: none;
}

.filters .check {
  font-size: 0.9375rem;
}

/* ---------- Strona produktu ---------- */
.summary-rating {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  margin-top: 8px;
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--gray);
}

.summary-rating:hover span:last-child {
  color: var(--graphite);
  text-decoration: underline;
}

.rating-stars {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  line-height: 0;
  white-space: nowrap;
}

.rating-stars-base,
.rating-stars-fill {
  display: flex;
  gap: 2px;
}

.rating-stars-base {
  color: var(--stone);
}

.rating-stars-fill {
  position: absolute;
  inset: 0 auto 0 0;
  overflow: hidden;
  color: var(--green);
}

.summary-price .price-value del {
  font-size: 0.5em;
}

.summary-price .price-unit:empty {
  display: none;
}

/* Warianty: chips sterują ukrytym <select> (bez JS widoczne pola wyboru). */
.variations .option:first-child {
  margin-top: 24px;
}

.js .option-select {
  display: none;
}

.no-js .option-list {
  display: none;
}

.option-select {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  background: var(--white);
}

.option-item.is-disabled span {
  border-style: dashed;
  color: var(--moss);
  background: var(--cream);
  text-decoration: line-through;
  cursor: not-allowed;
}

.option-item.is-disabled input {
  cursor: not-allowed;
}

.reset_variations {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--gray);
}

/* WooCommerce ukrywa link przez visibility - bez rezerwowania miejsca. */
.reset_variations[style*="hidden"] {
  display: none;
}

.variation-hint {
  margin-top: 10px;
  font-size: 0.875rem;
  color: var(--red);
}

.variation-hint:empty {
  display: none;
}

.details-grid .specs-table {
  align-self: start;
}

.single_variation_wrap .woocommerce-variation:empty {
  display: none;
}

.woocommerce-variation-description,
.woocommerce-variation-availability {
  font-size: 0.875rem;
  color: var(--gray);
}

.woocommerce-variation-description:empty,
.woocommerce-variation-availability:empty {
  display: none;
}

.woocommerce-variation {
  margin-top: 16px;
}

.variation-unavailable {
  padding: 12px 14px;
  border-left: 2px solid var(--red);
  background: #fdf5f4;
  font-size: 0.9375rem;
}

/* Przed wyborem wariantu przycisk wygląda jak w projekcie; klik pokazuje podpowiedź (.variation-hint). */
.single_add_to_cart_button.disabled {
  opacity: 0.85;
}

.single_add_to_cart_button.loading,
.btn.loading {
  opacity: 0.7;
  cursor: progress;
}

.single_add_to_cart_button.loading .theme-icon {
  animation: pns-pulse 0.9s ease-in-out infinite alternate;
}

@keyframes pns-pulse {
  from { opacity: 1; }
  to { opacity: 0.3; }
}

.quantity input:focus-visible {
  outline-offset: -2px;
}

.quantity button {
  min-height: 50px;
  color: var(--graphite);
}

.quantity button:focus-visible {
  outline-offset: -2px;
}

.quantity.is-static {
  border: 0;
}

.stock.out-of-stock::before {
  background: var(--red);
}

.stock.available-on-backorder::before {
  background: var(--lime);
}

.stock.out-of-stock {
  color: var(--red);
}

.gallery-track {
  outline-offset: -2px;
}

.gallery-thumbs button:focus-visible {
  outline-offset: 2px;
}

.gallery-thumbs button:hover {
  border-color: var(--stone);
}

.gallery.is-single .product-tag {
  left: 12px;
}

/* Tabela parametrów bez opisu - pełna szerokość. */
.details-content:empty {
  display: none;
}

/* ---------- Opinie ---------- */
.reviews-summary .intro {
  margin-bottom: 24px;
}

.reviews-average {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.reviews-average > strong {
  font-size: 3rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.reviews-average > div {
  display: grid;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--gray);
}

.commentlist ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.commentlist li {
  margin: 0;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.commentlist li:last-child {
  border-bottom: 1px solid var(--line);
}

.review-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.review-head strong {
  font-size: 1rem;
}

.review-head time {
  margin-left: auto;
  font-size: 0.8125rem;
  color: var(--gray);
}

.review-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--green-dark);
}

.review-rating {
  margin-top: 8px;
}

.review-pending {
  margin-top: 8px;
  font-size: 0.8125rem;
  color: var(--gray);
}

.review-text {
  margin-top: 10px;
  color: var(--gray);
}

.reviews-empty {
  padding: 20px;
  border-left: 2px solid var(--green);
  background: var(--cream);
  color: var(--gray);
}

.review-form {
  margin-top: 40px;
  padding: 28px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.review-form h3 {
  margin-bottom: 8px;
}

.review-form h3 small {
  display: block;
  margin-top: 4px;
  font-size: 0.875rem;
}

.review-comment-form {
  display: grid;
  gap: 18px;
}

.review-comment-form .form-note {
  margin-bottom: 4px;
}

.review-comment-form .consent label {
  font-size: 0.875rem;
}

.star-rating-input {
  margin: 0;
  padding: 0;
  border: 0;
}

.star-rating-input legend {
  margin-bottom: 8px;
  padding: 0;
  font-size: 0.875rem;
  font-weight: 500;
}

.star-rating-options {
  display: inline-flex;
  gap: 2px;
}

.star-rating-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.star-rating-options label {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  color: var(--stone);
  cursor: pointer;
  transition: color var(--dur) var(--ease);
}

/* Wypełnienie do wybranej gwiazdki (bez :has - przynajmniej zaznaczona gwiazdka). */
.star-rating-options input:checked + label {
  color: var(--green);
}

.star-rating-options:has(input[value="2"]:checked) label:nth-of-type(-n+2),
.star-rating-options:has(input[value="3"]:checked) label:nth-of-type(-n+3),
.star-rating-options:has(input[value="4"]:checked) label:nth-of-type(-n+4),
.star-rating-options:has(input[value="5"]:checked) label:nth-of-type(-n+5) {
  color: var(--green);
}

/* Podgląd przy wskazaniu myszą. */
.star-rating-options:has(label:hover) label {
  color: var(--stone);
}

.star-rating-options:has(label:nth-of-type(1):hover) label:nth-of-type(-n+1),
.star-rating-options:has(label:nth-of-type(2):hover) label:nth-of-type(-n+2),
.star-rating-options:has(label:nth-of-type(3):hover) label:nth-of-type(-n+3),
.star-rating-options:has(label:nth-of-type(4):hover) label:nth-of-type(-n+4),
.star-rating-options:has(label:nth-of-type(5):hover) label:nth-of-type(-n+5) {
  color: var(--green);
}

.star-rating-options input:focus-visible + label {
  outline: 2px solid var(--green);
  outline-offset: 0;
}

.star-rating-input[aria-invalid="true"] .star-rating-options label {
  color: #e2b4b0;
}

.review-comment-form .form-submit {
  display: flex;
}

/* ---------- Strony koszyka, kasy i konta ---------- */
.page-header.is-compact {
  padding-bottom: 28px;
}

.page-header.is-compact .page-header-body {
  margin-top: 20px;
}

.page-header.is-compact .intro h1 {
  margin: 0;
}

.shop-page {
  padding-block: 32px var(--section);
}

.shop-page .woocommerce > .woocommerce-notices-wrapper,
.shop-page .woocommerce-notices-wrapper {
  margin-bottom: 4px;
}

/* Sekcja produktów osadzona w treści strony (koszyk): bez drugiego kontenera. */
.products.is-embedded {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.products.is-embedded > .container {
  padding-inline: 0;
}

/* Pola formularzy WooCommerce (kasa, adresy, konto) w stylu .field */
.shop-page form .form-row,
.woocommerce-form-row {
  margin: 0 0 16px;
  padding: 0;
}

.shop-page form .form-row label,
.woocommerce-form-row label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}

.shop-page form .form-row .required,
.shop-page form .form-row .optional {
  font-weight: 400;
  text-decoration: none;
  color: var(--gray);
}

.shop-page form .form-row .required {
  color: var(--red);
}

.woocommerce-input-wrapper {
  display: block;
}

.shop-page form .input-text:not(.qty),
.shop-page form select,
.shop-page form textarea,
.shop-page .field input,
.shop-page .field select,
.coupon .input-text,
.review-comment-form input[type="text"],
.review-comment-form input[type="email"],
.review-comment-form textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 1rem;
  transition: border-color var(--dur) var(--ease);
}

.shop-page form textarea,
.review-comment-form textarea {
  min-height: 120px;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

.shop-page form select {
  padding-right: 40px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23202320' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.shop-page form .input-text:not(.qty):hover,
.shop-page form select:hover,
.shop-page form textarea:hover {
  border-color: var(--gray);
}

.shop-page form .input-text:not(.qty):focus-visible,
.shop-page form select:focus-visible,
.shop-page form textarea:focus-visible,
.coupon .input-text:focus-visible,
.review-comment-form input:focus-visible,
.review-comment-form textarea:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 0;
  border-color: var(--green);
}

.shop-page form .woocommerce-invalid .input-text,
.shop-page form .woocommerce-invalid select,
.review-comment-form [aria-invalid="true"] {
  border-color: var(--red);
}

.shop-page form .woocommerce-validated .input-text {
  border-color: var(--stone);
}

.checkout-inline-error-message,
.shop-page form .form-row .checkout-inline-error-message {
  margin: 6px 0 0;
  font-size: 0.8125rem;
  color: var(--red);
}

.shop-page form .form-row .description {
  display: block;
  margin-top: 6px;
  font-size: 0.8125rem;
  color: var(--gray);
}

.woocommerce-form__label-for-checkbox,
.shop-page form .form-row label.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  cursor: pointer;
}

.woocommerce-form__label-for-checkbox input,
.shop-page form .form-row label.checkbox input,
.shop-page form input[type="checkbox"],
.shop-page form input[type="radio"] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--olive);
}

.form-note {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--gray);
}

.checkout-note {
  padding: 12px 14px;
  border-left: 2px solid var(--olive);
  background: var(--cream);
  font-size: 0.9375rem;
}

/* Karty opcji: metody dostawy i płatności */
.option-cards ul,
.wc_payment_methods {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.option-cards li,
.wc_payment_methods > li {
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.option-cards li:hover,
.wc_payment_methods > li:hover {
  border-color: var(--stone);
}

.option-cards li:has(input:checked),
.option-cards li:has(input[type="hidden"]),
.wc_payment_methods > li:has(input:checked) {
  border-color: var(--olive);
  box-shadow: inset 0 0 0 1px var(--olive);
  background: var(--cream);
}

.option-cards input[type="radio"],
.wc_payment_methods > li > input[type="radio"] {
  position: absolute;
  top: 18px;
  left: 16px;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--olive);
}

.option-cards label,
.wc_payment_methods > li > label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  min-height: 56px;
  margin: 0;
  padding: 14px 16px 14px 48px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}

.option-cards input[type="hidden"] + label {
  padding-left: 16px;
}

.option-card-price {
  font-weight: 600;
  white-space: nowrap;
}

.wc_payment_methods > li > label img {
  max-height: 24px;
  width: auto;
}

.payment_box {
  margin: 0 16px 16px 48px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--gray);
}

.payment_box p {
  margin: 0;
}

.woocommerce-shipping-destination,
.woocommerce-shipping-contents {
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--gray);
}

.shipping-calculator-button {
  font-size: 0.875rem;
  font-weight: 500;
}

.shipping-calculator-form {
  margin-top: 12px;
}

/* ---------- Koszyk ---------- */
.cart-layout {
  display: grid;
  gap: 32px;
}

.woocommerce-cart-form {
  min-width: 0;
}

.shop_table.cart {
  width: 100%;
  border-collapse: collapse;
}

.shop_table.cart thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Mobile: każda pozycja jako karta (miniatura | nazwa, cena, ilość, wartość, usuń). */
.shop_table.cart tr.cart_item {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 44px;
  grid-template-areas:
    "thumb name remove"
    "thumb price price"
    "thumb qty subtotal";
  gap: 6px 14px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.shop_table.cart tr.cart_item:first-child {
  border-top: 1px solid var(--line);
}

.shop_table.cart td,
.shop_table.cart th {
  padding: 0;
  text-align: left;
  font-weight: 400;
}

.shop_table.cart .product-thumbnail {
  grid-area: thumb;
  align-self: start;
}

.shop_table.cart .product-thumbnail a,
.shop_table.cart .product-thumbnail img {
  display: block;
}

.shop_table.cart .product-thumbnail img {
  width: 80px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--sand);
}

.shop_table.cart .product-name {
  grid-area: name;
  font-size: 0.9375rem;
  line-height: 1.4;
  font-weight: 500;
}

.shop_table.cart .product-name a {
  text-decoration: none;
}

.shop_table.cart .product-name a:hover {
  text-decoration: underline;
}

.cart-item-meta,
.backorder_notification {
  display: block;
  margin-top: 2px;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--gray);
}

dl.variation {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  margin: 4px 0 0;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--gray);
}

dl.variation dt,
dl.variation dd {
  margin: 0;
}

dl.variation dd p {
  margin: 0;
}

dl.variation dd + dt::before {
  content: "· ";
}

.shop_table.cart .product-price {
  grid-area: price;
  font-size: 0.8125rem;
  color: var(--gray);
}

.shop_table.cart .product-price::before {
  content: attr(data-title) ": ";
}

.shop_table.cart .product-quantity {
  grid-area: qty;
}

.shop_table.cart .product-subtotal {
  grid-area: subtotal;
  justify-self: end;
  font-weight: 600;
  white-space: nowrap;
}

.shop_table.cart .product-remove {
  grid-area: remove;
  justify-self: end;
  align-self: start;
}

.shop_table.cart .quantity {
  height: 44px;
}

.shop_table.cart .quantity button {
  width: 40px;
  min-height: 0;
}

.shop_table.cart .quantity input {
  width: 44px;
}

a.remove {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  color: var(--gray);
  text-decoration: none;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

a.remove:hover {
  background: #fdf5f4;
  color: var(--red);
}

.shop_table.cart tr.cart-actions-row,
.shop_table.cart tr.cart-actions-row td {
  display: block;
}

.shop_table.cart td.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 0 0;
}

.coupon {
  display: flex;
  flex: 1 1 280px;
  gap: 8px;
  max-width: 420px;
}

.coupon .input-text {
  flex: 1 1 auto;
  min-height: 44px;
}

.coupon .btn,
td.actions > .btn {
  flex: 0 0 auto;
}

td.actions > .btn[disabled] {
  opacity: 0.5;
  cursor: default;
}

/* Podsumowanie koszyka */
.cart_totals,
.checkout-summary {
  padding: 24px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream);
}

.cart_totals h2,
.checkout-summary h2 {
  margin-bottom: 16px;
  font-size: 1.375rem;
  line-height: 1.3;
}

.totals-table,
.woocommerce-checkout-review-order-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.totals-table th,
.totals-table td,
.woocommerce-checkout-review-order-table tfoot th,
.woocommerce-checkout-review-order-table tfoot td {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  text-align: left;
  font-weight: 400;
  vertical-align: top;
}

.totals-table td,
.woocommerce-checkout-review-order-table td {
  text-align: right;
}

.totals-table tr.shipping th,
.totals-table tr.shipping td {
  display: block;
  text-align: left;
}

.totals-table tr.shipping th {
  padding-bottom: 6px;
}

.totals-table tr.shipping td {
  padding-top: 0;
  border-top: 0;
}

.totals-table .order-total th,
.totals-table .order-total td,
.woocommerce-checkout-review-order-table .order-total th,
.woocommerce-checkout-review-order-table .order-total td {
  padding-top: 14px;
  border-top: 1px solid var(--graphite);
  font-weight: 600;
}

.totals-table .order-total td,
.woocommerce-checkout-review-order-table .order-total td {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.order-total .includes_tax,
.tax_label {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--gray);
}

.wc-proceed-to-checkout {
  margin-top: 20px;
}

/* Pasek do darmowej dostawy */
.free-shipping {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--white);
  font-size: 0.875rem;
  line-height: 1.4;
}

.free-shipping-text {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.free-shipping-text .theme-icon {
  color: var(--green);
}

.free-shipping progress {
  display: block;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
  appearance: none;
}

.free-shipping progress::-webkit-progress-bar {
  border-radius: 3px;
  background: var(--line);
}

.free-shipping progress::-webkit-progress-value {
  border-radius: 3px;
  background: var(--green);
}

.free-shipping progress::-moz-progress-bar {
  border-radius: 3px;
  background: var(--green);
}

.free-shipping.is-reached {
  font-weight: 600;
}

/* Pusty koszyk */
.cart-empty-panel {
  display: grid;
  justify-items: start;
  gap: 4px;
  padding: 32px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream);
}

.cart-empty-panel > .theme-icon {
  margin-bottom: 8px;
  color: var(--green);
}

.cart-empty-panel h2 {
  font-size: 1.75rem;
}

.cart-empty-panel p {
  max-width: 560px;
  color: var(--gray);
}

.cart-empty-panel .buttons {
  margin-top: 12px;
}

/* ---------- Kasa ---------- */
.woocommerce-form-coupon-toggle .woocommerce-info,
.woocommerce-form-login-toggle .woocommerce-info {
  margin-bottom: 16px;
}

form.checkout_coupon,
form.woocommerce-form-login.login {
  margin-bottom: 24px;
}

form.checkout_coupon {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.checkout-layout {
  display: grid;
  gap: 24px;
}

.checkout-main,
.checkout-pay,
#customer_details {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.checkout-card {
  padding: 24px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
}

.checkout-card h3,
.checkout-card .woocommerce-billing-fields h3,
.checkout-card .woocommerce-additional-fields h3 {
  margin: 0 0 18px;
  font-size: 1.25rem;
  font-weight: 600;
}

.checkout-card .woocommerce-additional-fields h3 {
  margin-top: 8px;
}

#ship-to-different-address {
  margin-bottom: 0;
  font-size: 1rem;
  font-weight: 500;
}

#ship-to-different-address label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
}

.shipping_address {
  margin-top: 16px;
}

.woocommerce-shipping-fields + .woocommerce-additional-fields {
  margin-top: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.woocommerce-billing-fields__field-wrapper,
.woocommerce-shipping-fields__field-wrapper,
.woocommerce-address-fields__field-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.woocommerce-account-fields .create-account {
  margin-top: 4px;
}

.checkout-summary .woocommerce-checkout-review-order-table thead {
  position: absolute;
}

.woocommerce-checkout-review-order-table tbody td {
  padding: 0 0 14px;
  vertical-align: top;
}

.woocommerce-checkout-review-order-table tbody .product-name {
  text-align: left;
}

.woocommerce-checkout-review-order-table tbody .product-total {
  font-weight: 500;
  white-space: nowrap;
}

.review-item {
  display: flex;
  gap: 12px;
}

.review-item-media img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--sand);
}

.review-item-body {
  display: grid;
  gap: 2px;
  font-size: 0.875rem;
  line-height: 1.4;
}

.review-item-name {
  font-weight: 500;
}

.review-item-body .product-quantity {
  color: var(--gray);
}

.woocommerce-checkout-payment .place-order {
  display: grid;
  gap: 16px;
  margin: 20px 0 0;
}

.woocommerce-terms-and-conditions-wrapper {
  display: grid;
  gap: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--gray);
}

.woocommerce-terms-and-conditions-wrapper p,
.woocommerce-privacy-policy-text p {
  margin: 0;
}

.woocommerce-terms-and-conditions-wrapper .form-row {
  margin: 0;
}

.woocommerce-terms-and-conditions-checkbox-text {
  color: var(--graphite);
}

#place_order {
  min-height: 56px;
  font-size: 1rem;
}

.woocommerce-checkout .blockUI.blockOverlay,
.woocommerce-cart .blockUI.blockOverlay {
  cursor: progress;
}

/* ---------- Podziękowanie ---------- */
.thankyou-panel {
  display: grid;
  justify-items: start;
  gap: 4px;
  margin-bottom: 24px;
  padding: 28px 24px;
  border-left: 3px solid var(--green);
  border-radius: var(--radius-sm);
  background: var(--cream);
}

.thankyou-panel > .theme-icon {
  margin-bottom: 8px;
  color: var(--green);
}

.thankyou-panel.is-failed {
  border-left-color: var(--red);
}

.thankyou-panel.is-failed > .theme-icon {
  color: var(--red);
}

.thankyou-panel h2 {
  font-size: 1.75rem;
}

.thankyou-panel p {
  color: var(--gray);
}

.order-overview ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 40px;
  padding: 0;
  list-style: none;
}

.order-overview li {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.order-overview span {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray);
}

.woocommerce-order-details,
.woocommerce-customer-details,
.woocommerce-bacs-bank-details {
  margin-bottom: 40px;
}

.woocommerce-order-details h2,
.woocommerce-customer-details h2,
.woocommerce-bacs-bank-details h2,
.woocommerce-column__title {
  margin-bottom: 16px;
  font-size: 1.5rem;
}

.wc-bacs-bank-details {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  list-style: none;
  font-size: 0.9375rem;
}

.wc-bacs-bank-details li {
  margin: 0;
}

.woocommerce-table--order-details,
.woocommerce-orders-table,
.woocommerce-MyAccount-content .shop_table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.woocommerce-table--order-details th,
.woocommerce-table--order-details td,
.woocommerce-orders-table th,
.woocommerce-orders-table td,
.woocommerce-MyAccount-content .shop_table th,
.woocommerce-MyAccount-content .shop_table td {
  padding: 12px 8px 12px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.woocommerce-table--order-details thead th,
.woocommerce-orders-table thead th {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray);
}

.woocommerce-table--order-details tfoot th {
  font-weight: 500;
}

.woocommerce-customer-details address {
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-style: normal;
  line-height: 1.6;
}

.woocommerce-customer-details--phone,
.woocommerce-customer-details--email {
  margin: 4px 0 0;
}

/* ---------- Moje konto ---------- */
.account-auth {
  display: grid;
  gap: 24px;
}

.account-card {
  padding: 28px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
}

.account-card.is-register {
  background: var(--cream);
}

/* Reset hasła (szablony myaccount/form-lost-password.php, form-reset-password.php) */
.lost_reset_password {
  display: grid;
  gap: 16px;
  max-width: 560px;
  padding: 28px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
}

.lost_reset_password > p {
  margin: 0;
  color: var(--gray);
}

.lost_reset_password .clear {
  display: none;
}

.lost_reset_password .btn,
.woocommerce-EditAccountForm .btn {
  justify-self: start;
}

.account-card h2 {
  margin-bottom: 12px;
  font-size: 1.75rem;
}

.account-card > p {
  color: var(--gray);
}

.account-card form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.account-card .field label {
  margin-bottom: 6px;
}

.account-card .field input {
  min-height: 48px;
  border-color: var(--stone);
}

.account-form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.account-form-row .check {
  min-height: 44px;
}

.account-lost {
  font-size: 0.875rem;
}

.woocommerce-privacy-policy-text {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--gray);
}

.account-nav {
  margin: 0 calc(var(--pad) * -1) 24px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.account-nav ul {
  display: flex;
  gap: 8px;
  width: max-content;
  margin: 0;
  padding: 0 var(--pad) 4px;
  list-style: none;
}

.account-nav li {
  margin: 0;
}

.account-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color var(--dur) var(--ease);
}

.account-nav a:hover {
  border-color: var(--stone);
}

.account-nav a[aria-current="page"] {
  border-color: var(--olive);
  background: var(--olive);
  color: var(--white);
}

.woocommerce-MyAccount-content {
  min-width: 0;
}

.woocommerce-MyAccount-content > p:first-child {
  font-size: 1.0625rem;
}

.woocommerce-MyAccount-content .button,
.woocommerce-MyAccount-content button[type="submit"],
.woocommerce-orders-table .button,
.woocommerce-EditAccountForm button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--olive);
  border-radius: var(--radius);
  background: var(--olive);
  color: var(--white);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.woocommerce-orders-table .button + .button {
  margin-left: 6px;
}

.woocommerce-Addresses {
  display: grid;
  gap: 24px;
}

.woocommerce-Address {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.woocommerce-Address-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.woocommerce-Address-title h2 {
  margin: 0;
  font-size: 1.25rem;
}

.woocommerce-Address address {
  font-style: normal;
  line-height: 1.6;
}

.woocommerce-EditAccountForm fieldset {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.woocommerce-EditAccountForm legend {
  padding: 0 6px;
  font-weight: 600;
}

/* Pokaż/ukryj hasło (przycisk dodawany przez woocommerce.js) */
.password-input {
  position: relative;
  display: block;
}

.password-input input {
  width: 100%;
  padding-right: 52px;
}

.show-password-input {
  position: absolute;
  top: 50%;
  right: 4px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--gray);
  cursor: pointer;
  transform: translateY(-50%);
}

.show-password-input::before {
  content: "";
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%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 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.show-password-input.display-password::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M3 3l18 18'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M3 3l18 18'/%3E%3C/svg%3E");
}

.show-password-input:hover {
  color: var(--olive);
}

.show-password-input:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

/* ---------- Ruch ---------- */
@media (prefers-reduced-motion: reduce) {
  .cart-toast-inner {
    transform: none;
    transition: none;
  }

  .single_add_to_cart_button.loading .theme-icon {
    animation: none;
  }
}

/* ==========================================================================
   Tablet: od 640 px
   ========================================================================== */
@media (min-width: 640px) {
  .woocommerce-billing-fields__field-wrapper,
  .woocommerce-shipping-fields__field-wrapper,
  .woocommerce-address-fields__field-wrapper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
  }

  .woocommerce-billing-fields__field-wrapper > .form-row,
  .woocommerce-shipping-fields__field-wrapper > .form-row,
  .woocommerce-address-fields__field-wrapper > .form-row {
    grid-column: 1 / -1;
  }

  .woocommerce-billing-fields__field-wrapper > .form-row-first,
  .woocommerce-shipping-fields__field-wrapper > .form-row-first,
  .woocommerce-address-fields__field-wrapper > .form-row-first {
    grid-column: 1;
  }

  .woocommerce-billing-fields__field-wrapper > .form-row-last,
  .woocommerce-shipping-fields__field-wrapper > .form-row-last,
  .woocommerce-address-fields__field-wrapper > .form-row-last {
    grid-column: 2;
  }

  .checkout-card,
  .account-card,
  .review-form {
    padding: 28px;
  }

  .order-overview ul {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .account-auth.has-register,
  .woocommerce-Addresses {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cart-toast {
    inset: auto 24px 24px auto;
  }

  .has-sticky-cta .cart-toast {
    bottom: calc(var(--sticky-cta-h) + 24px);
  }
}

/* ==========================================================================
   Desktop: od 992 px
   ========================================================================== */
@media (min-width: 992px) {
  .has-sticky-cta .cart-toast {
    bottom: 24px;
  }

  .woocommerce-message,
  .woocommerce-info,
  .woocommerce-error {
    padding: 16px 20px;
  }

  /* Galeria z jednym zdjęciem - bez kolumny miniatur. */
  .gallery.is-single {
    grid-template-columns: minmax(0, 1fr);
  }

  .gallery.is-single .gallery-track {
    grid-column: 1;
  }

  .gallery.is-single .product-tag {
    left: 16px;
  }

  .gallery-thumbs ul {
    max-height: 520px;
    overflow-y: auto;
    scrollbar-width: thin;
  }

  /* Opinie */
  .reviews-summary {
    position: sticky;
    top: calc(var(--header-h) + 24px);
  }

  .review-form {
    padding: 36px;
  }

  .review-comment-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
  }

  .review-comment-form > :not(.comment-form-author):not(.comment-form-email) {
    grid-column: 1 / -1;
  }

  /* Koszyk */
  .shop-page {
    padding-top: 48px;
  }

  .page-header.is-compact {
    padding-bottom: 40px;
  }

  .page-header.is-compact .page-header-body {
    margin-top: 32px;
  }

  .page-header.is-compact .intro h1 {
    font-size: 3rem;
  }

  .cart-layout {
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 48px;
    align-items: start;
  }

  .cart-collaterals {
    position: sticky;
    top: calc(var(--header-h) + 24px);
  }

  .shop_table.cart thead {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }

  .shop_table.cart thead th {
    padding: 0 12px 12px 0;
    border-bottom: 1px solid var(--graphite);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gray);
  }

  .shop_table.cart tr.cart_item {
    display: table-row;
    padding: 0;
  }

  .shop_table.cart tr.cart_item:first-child {
    border-top: 0;
  }

  .shop_table.cart tr.cart_item > * {
    padding: 18px 12px 18px 0;
    vertical-align: middle;
  }

  .shop_table.cart .product-thumbnail {
    width: 96px;
  }

  .shop_table.cart td.product-price {
    font-size: 0.9375rem;
    color: var(--graphite);
    white-space: nowrap;
  }

  .shop_table.cart .product-price::before {
    content: none;
  }

  .shop_table.cart .product-subtotal {
    text-align: right;
  }

  .shop_table.cart .product-remove {
    width: 52px;
    padding-right: 0;
    text-align: right;
  }

  .shop_table.cart tr.cart-actions-row {
    display: table-row;
  }

  /* Komórka tabeli nie może być flex (zwęża się do 1. kolumny) - układ przez inline-flex i float. */
  .shop_table.cart tr.cart-actions-row td {
    display: table-cell;
  }

  .shop_table.cart td.actions .coupon {
    display: inline-flex;
    width: min(420px, 100%);
    vertical-align: middle;
  }

  .shop_table.cart td.actions > .btn {
    float: right;
  }

  .cart_totals {
    padding: 28px;
  }

  .products.is-embedded {
    margin-top: 72px;
    padding-top: 56px;
  }

  /* Kasa: dane i płatność po lewej, podsumowanie przypięte po prawej */
  .checkout-layout {
    grid-template-columns: minmax(0, 1fr) 400px;
    column-gap: 48px;
    row-gap: 24px;
    align-items: start;
  }

  .checkout-main {
    grid-column: 1;
    grid-row: 1;
  }

  .checkout-pay {
    grid-column: 1;
    grid-row: 2;
  }

  .checkout-aside {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: stretch;
  }

  .checkout-summary {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    padding: 28px;
  }

  .checkout-card {
    padding: 32px;
  }

  #place_order {
    width: auto;
    min-width: 280px;
    justify-self: start;
  }

  /* Moje konto: nawigacja boczna + treść */
  .woocommerce-account .shop-page .woocommerce:has(> .woocommerce-MyAccount-navigation) {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    column-gap: 48px;
    align-items: start;
  }

  .woocommerce-account .shop-page .woocommerce > .woocommerce-notices-wrapper {
    grid-column: 1 / -1;
  }

  .account-nav {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    margin: 0;
    overflow: visible;
  }

  .account-nav ul {
    display: grid;
    gap: 6px;
    width: auto;
    padding: 0;
  }

  .account-nav a {
    display: flex;
    width: 100%;
  }

  .account-card {
    padding: 40px;
  }

  .thankyou-panel {
    padding: 36px 40px;
  }
}

/* ==========================================================================
   Długi opis kategorii: nagłówek w wąskiej kolumnie i zwijanie
   ========================================================================== */
.text-content .intro h2 {
  font-size: 1.625rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.content-wrap .collapsible-toggle {
  margin-top: 24px;
}

.content-wrap .collapsible-toggle[hidden] {
  display: none;
}

.content-wrap.is-collapsible:not(.is-open) .content {
  max-height: var(--collapsed-height, 560px);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
}

@media (min-width: 992px) {
  .text-content .intro h2 {
    font-size: 1.875rem;
  }

  .content-wrap.is-collapsible:not(.is-open) .content {
    column-fill: auto;
  }
}

/* Opis metody dostawy (np. „Darmowa od 290,00 zł brutto") */
.option-card-desc {
  flex: 0 0 100%;
  order: 3;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--gray);
}

.option-card-desc:empty {
  display: none;
}
