/* Zdravý Panák: stable product-card rhythm, clear sale pricing and native WC gallery. */

/* Product tags remain available for internal organisation and filtering, but
   do not need to be exposed in the single-product summary. */
.single-product .product_meta .tagged_as {
  display: none !important;
}

.zp-product-info {
  display: flex;
  flex-direction: column;
}

.zp-product-detail,
.zp-product h3,
.zp-product-meta {
  min-width: 0;
  overflow: hidden;
}

.zp-product-detail,
.zp-product h3,
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.zp-product-detail {
  min-height: 38px;
  -webkit-line-clamp: 2;
}

.zp-product h3,
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  min-height: 2.3em;
  -webkit-line-clamp: 3;
}

.zp-product-meta {
  min-height: 52px;
  margin: 14px 0 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
}

.zp-product-info .zp-add {
  margin-top: auto;
}

.zp-product-meta > strong,
.woocommerce ul.products li.product .price {
  font-size: 16px !important;
  line-height: 1.32;
}

.zp-product-meta > strong {
  align-self: end;
}

.zp-product-meta del,
.woocommerce ul.products li.product .price del {
  margin-right: 2px;
  color: #817f77;
  font-size: .76em !important;
  font-weight: 500 !important;
  opacity: 1;
  text-decoration: line-through 1px #9b927e;
}

.zp-product-meta ins,
.woocommerce ul.products li.product .price ins {
  color: #946a1f;
  font-size: 1em !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}

.zp-product-meta .woocommerce-Price-amount,
.woocommerce ul.products li.product .price .woocommerce-Price-amount {
  font-size: inherit !important;
  line-height: inherit;
}

.woocommerce-price-suffix {
  font-size: .78em;
  font-weight: 600;
  white-space: nowrap;
}

.woocommerce ul.products li.product .woocommerce-loop-product__link {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  height: auto;
  min-height: 2.3em;
}

.woocommerce ul.products li.product .price {
  min-height: 45px;
  margin-top: 10px;
  margin-bottom: 0;
  display: flex;
  align-items: flex-end;
  align-content: flex-end;
  flex-wrap: wrap;
  gap: 3px 7px;
}

.woocommerce ul.products li.product .zp-earned-points {
  min-height: 26px;
  padding: 6px 18px 0;
  display: block;
}

.woocommerce div.product .woocommerce-product-gallery__wrapper,
.woocommerce div.product .flex-viewport {
  overflow: hidden;
  border-radius: 28px;
  background: var(--zp-cream, #f7f4ec);
}

.woocommerce div.product .woocommerce-product-gallery__trigger {
  top: 18px;
  right: 18px;
  z-index: 5;
}

.woocommerce div.product .flex-control-thumbs {
  margin: 16px 0 0 !important;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 92px));
  gap: 12px;
  list-style: none;
}

.woocommerce div.product .flex-control-thumbs li {
  width: auto !important;
  margin: 0 !important;
  float: none !important;
}

.woocommerce div.product .flex-control-thumbs img {
  width: 100%;
  height: auto !important;
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: 12px;
  object-fit: cover;
  opacity: .62;
  cursor: pointer;
  transition: opacity .2s ease, border-color .2s ease, transform .2s ease;
}

.woocommerce div.product .flex-control-thumbs img:hover,
.woocommerce div.product .flex-control-thumbs img.flex-active {
  border-color: #c9973e;
  opacity: 1;
  transform: translateY(-2px);
}

.zp-welcome-offer,
.zp-register-offer {
  margin: 0 0 24px;
  padding: 20px 22px;
  border: 1px solid rgba(201, 151, 62, .45);
  border-radius: 18px;
  background: #fbf2d8;
}

.zp-welcome-offer > strong {
  font: 600 28px/1.2 Georgia, serif;
}

.zp-welcome-offer p,
.zp-register-offer p {
  margin-bottom: 0;
}

.zp-legal-card {
  margin: 22px 0 30px;
  padding: 22px;
  border: 1px solid var(--zp-line, rgba(24,26,22,.14));
  border-radius: 20px;
  background: var(--zp-cream, #f7f4ec);
}

.zp-legal-card p:last-child {
  margin-bottom: 0;
}

/* Compact billing grid and reveal company details only when requested. */
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper {
  column-gap: 14px;
  row-gap: 2px;
}

.woocommerce-checkout .woocommerce-billing-fields__field-wrapper > .form-row {
  width: 100% !important;
  margin: 0 0 10px !important;
  padding: 0 !important;
  float: none !important;
  box-sizing: border-box;
}

.woocommerce-checkout #billing_company_invoice_field {
  grid-column: 1 / -1;
  margin: 2px 0 14px !important;
  padding: 13px 15px !important;
  border: 1px solid var(--zp-line, rgba(24,26,22,.14));
  border-radius: 13px;
  background: var(--zp-cream, #f7f4ec);
}

.woocommerce-checkout #billing_company_invoice_field label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.3;
}

.woocommerce-checkout #billing_company_invoice {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 18px;
  accent-color: var(--zp-gold, #c9973e);
}

.woocommerce-checkout .zp-company-field {
  display: none;
}

.woocommerce-checkout .woocommerce-billing-fields__field-wrapper:has(#billing_company_invoice:checked) .zp-company-field {
  display: block;
}

/* Checkout validation: leave enough room for the error icon and keep the
   message vertically centred inside the notice. */
.woocommerce-notices-wrapper .woocommerce-error,
form.checkout .woocommerce-error {
  position: relative;
  margin: 0 0 24px !important;
  padding: 17px 22px 17px 58px !important;
  border: 1px solid rgba(24, 26, 22, .16) !important;
  border-top: 3px solid #a92d2d !important;
  border-radius: 16px;
  background: var(--zp-cream, #f7f4ec);
  color: #55564f;
  line-height: 1.45;
  list-style: none;
}

.woocommerce-notices-wrapper .woocommerce-error::before,
form.checkout .woocommerce-error::before {
  content: "!";
  position: absolute;
  top: 50%;
  left: 20px;
  width: 22px;
  height: 22px;
  margin: 0;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #b5222d;
  color: #fff;
  font: 700 14px/1 Arial, sans-serif;
}

.woocommerce-notices-wrapper .woocommerce-error li,
form.checkout .woocommerce-error li {
  margin: 0;
  padding: 0;
}

/* Packeta prints the pickup-point link on a new line inside a table cell.
   Give the cell and button a deliberate, compact layout. */
.packetery-order-detail .shop_table th,
.packetery-order-detail .shop_table td {
  padding-top: 16px;
  padding-bottom: 16px;
  vertical-align: middle;
}

.packetery-order-detail .shop_table td .button {
  min-height: 42px;
  margin: 10px 0 0;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}

/* The withdrawal flow stays reachable through "Reklamácie a odstúpenia".
   Hide only the duplicated buttons injected into individual order views. */
.woocommerce-orders-table .oodz_withdraw,
.woocommerce-order-details tr:has(.oodz_withdraw),
.woocommerce-view-order .oodz-order-withdraw,
.woocommerce-order .oodz-order-withdraw {
  display: none !important;
}

@media (max-width: 820px) {
  .zp-product-detail {
    height: auto;
    min-height: 34px !important;
  }

  .zp-product h3 {
    height: auto;
    min-height: 2.35em !important;
  }

  .zp-product-meta {
    min-height: 52px;
    margin-top: 12px;
  }

  .woocommerce ul.products li.product .woocommerce-loop-product__title {
    height: 4.05em;
    min-height: 4.05em;
  }

  .woocommerce ul.products li.product .price {
    min-height: 48px;
  }

  .woocommerce div.product .flex-control-thumbs {
    grid-template-columns: repeat(4, minmax(0, 74px));
    gap: 10px;
  }
}

@media (max-width: 560px) {
  .zp-product-info {
    padding-top: 14px;
  }

  .zp-product-detail {
    font-size: 9px;
    line-height: 1.4;
  }

  .zp-product h3 {
    font-size: 19px;
    line-height: 1.16;
  }

  .zp-product-meta > strong,
  .woocommerce ul.products li.product .price {
    font-size: 15px !important;
  }

  .zp-product-meta > span,
  .woocommerce ul.products li.product .zp-earned-points {
    font-size: 11px;
  }

  .woocommerce ul.products li.product .woocommerce-loop-product__title {
    height: 3.7em;
    min-height: 3.7em !important;
    padding-inline: 12px;
    font-size: 18px;
    line-height: 1.15;
  }

  .woocommerce ul.products li.product .price {
    min-height: 50px;
    padding-inline: 12px;
  }

  .woocommerce ul.products li.product .zp-earned-points {
    min-height: 27px;
    padding-inline: 12px;
  }

  .woocommerce div.product .woocommerce-product-gallery__wrapper,
  .woocommerce div.product .flex-viewport {
    border-radius: 22px;
  }

  .woocommerce-notices-wrapper .woocommerce-error,
  form.checkout .woocommerce-error {
    padding: 15px 16px 15px 50px !important;
    border-radius: 14px;
  }

  .woocommerce-notices-wrapper .woocommerce-error::before,
  form.checkout .woocommerce-error::before {
    left: 16px;
  }

  .packetery-order-detail .shop_table th,
  .packetery-order-detail .shop_table td {
    padding: 13px 12px;
  }

  .packetery-order-detail .shop_table td .button {
    width: 100%;
    margin-top: 8px;
  }
}
