/**
 * Domashnica / Webselo child theme module styles.
 */

/* Disable switch of delivery method from the list on checkout page. */
ul#shipping_method li:not(.elementor-widget-woocommerce-cart #shipping_method li) {
  pointer-events: none;
}

.woocommerce table.shop_table.woocommerce-checkout-review-order-table > tfoot > tr.woocommerce-shipping-totals > td > ul#shipping_method li label {
  /* padding-left: 0; */
}

.woocommerce table.shop_table.woocommerce-checkout-review-order-table > tfoot > tr.woocommerce-shipping-totals > td > ul#shipping_method li label::before {
  /* opacity: 0;
  z-index: -1; */
  pointer-events: none;
}

/* Speedy notes under the method. Column layout so the price stays on the name row. */
.woocommerce ul#shipping_method li:has(> .domashnica-speedy-disclaimer) {
  display: flex !important;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
}
.woocommerce ul#shipping_method li:has(> .domashnica-speedy-disclaimer) > label {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  width: 100%;
  flex: 0 0 auto;
}

.woocommerce-checkout ul#shipping_method li label .webselo-shipping-price,
.woocommerce-checkout ul#shipping_method li label .woocommerce-Price-amount.amount:not(.amount-eur) {
  margin-left: auto;
  flex: 0 0 auto;
}
.domashnica-speedy-disclaimer {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding-left: 26px;
  padding-left: 0;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 400;
  opacity: 0.85;
  text-align: left;
  white-space: normal;
}

.domashnica-speedy-disclaimer__line {
  display: block;
}

/* Country always hidden (BG default). Speedy delivery method must stay visible (Speedy off-screens .delivery-type-single). */
#billing_country_field,
body.speedy-single-country #billing_country_field,
body.domashnica-speedy-checkout #billing_country_field,
body.webselo-speedy-active #billing_country_field {
  display: none !important;
}

body.domashnica-speedy-checkout #billing_delivery_type_field,
body.webselo-speedy-active #billing_delivery_type_field,
body.domashnica-speedy-checkout #billing_delivery_type_field.delivery-type-single,
body.webselo-speedy-active #billing_delivery_type_field.delivery-type-single,
body.domashnica-default-checkout #billing_delivery_type_field,
body.domashnica-default-checkout #billing_delivery_type_field.delivery-type-single {
  display: block !important;
  visibility: visible !important;
  height: auto !important;
  width: auto !important;
  overflow: visible !important;
  opacity: 1 !important;
  position: static !important;
  left: auto !important;
  margin: inherit;
  padding: inherit;
  border: inherit;
}

/* Non-Speedy checkout: own body class so Speedy/Webselo cannot keep address fields hidden. */
body.domashnica-default-checkout #billing_state_field,
body.domashnica-default-checkout #billing_city_field,
body.domashnica-default-checkout #billing_address_1_field,
body.domashnica-default-checkout #billing_address_2_field,
body.domashnica-default-checkout #billing_postcode_field,
body.domashnica-default-checkout.webselo-speedy-active #billing_address_1_field,
body.domashnica-default-checkout.webselo-speedy-active.show-address-fields #billing_address_1_field,
body.domashnica-default-checkout.show-address-fields #billing_address_1_field {
  display: block !important;
  visibility: visible !important;
  height: auto !important;
  overflow: visible !important;
  opacity: 1 !important;
  position: static !important;
  left: auto !important;
  max-height: none !important;
  margin: inherit !important;
  padding: inherit !important;
}

/* Speedy Personal Address: street must stay visible; plugin hides it without webselo-address-fields-visible. */
body.domashnica-speedy-checkout.show-address-fields #billing_speedy_street_field,
body.webselo-speedy-active.show-address-fields #billing_speedy_street_field,
body.domashnica-speedy-checkout.show-address-fields #billing_speedy_street_field .woocommerce-input-wrapper,
body.webselo-speedy-active.show-address-fields #billing_speedy_street_field .woocommerce-input-wrapper {
  display: block !important;
  visibility: visible !important;
  height: auto !important;
  overflow: visible !important;
  opacity: 1 !important;
  position: relative;
  max-height: none !important;
}

/* Street suggestions: beat Greenmart header-search .ui-autocomplete rules. */
.ui-autocomplete.webselo-street-autocomplete {
  z-index: 100000 !important;
  width: auto !important;
  max-width: none !important;
  left: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  list-style: none !important;
  background: #fff !important;
  border: 1px solid #ccc !important;
}

.woocommerce-checkout .webselo-manual-address-opt-in {
  position: relative;
  z-index: 2;
}

/* Office Select2: full width, truncate long Speedy placeholder text. */
#billing_office_field .select2-container {
  width: 100% !important;
  max-width: 100%;
}
#billing_office_field .select2-selection__rendered {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100%;
}
#billing_office_field select.select2-hidden-accessible {
  max-width: 100%;
}

/* Thermo bag notice + modal */
.domashnica-thermo-notice {
  margin-bottom: 1rem;
}

.domashnica-thermo-modal[hidden] {
  display: none !important;
}

.domashnica-thermo-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.domashnica-thermo-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.domashnica-thermo-modal__dialog {
  position: relative;
  z-index: 1;
  max-width: 420px;
  width: calc(100% - 32px);
  padding: 24px;
  background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.domashnica-thermo-modal__dialog h3 {
  margin-top: 0;
}

.domashnica-thermo-modal__dialog .button {
  margin-top: 8px;
}

/* Nutrition tab */
.domashnica-nutrition__title {
  margin-bottom: 12px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.domashnica-nutrition__table {
  width: 100%;
}

.domashnica-nutrition__table th {
  width: 60%;
  text-align: left;
  font-weight: 500;
}

.domashnica-nutrition__table td {
  text-align: right;
}

/* Brand archive header */
.domashnica-brand-header {
  margin-bottom: 24px;
}

.domashnica-brand-header__banner img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
  margin-bottom: 16px;
}

.domashnica-brand-header__title {
  margin: 0 0 8px;
}

.domashnica-brand-header__desc {
  margin-bottom: 16px;
}

/* Brands listing shortcode — own layout, not product/brand-thumbnail theme cards. */
.domashnica-brands-list {
  margin: 0 0 2em;
}

.domashnica-brands-list__items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.domashnica-brands-list__item {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.domashnica-brands-list__item:first-child {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.domashnica-brands-list__card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 20px 0;
  text-decoration: none;
  color: inherit;
  box-shadow: none;
  background: transparent;
}

.domashnica-brands-list__card:hover,
.domashnica-brands-list__card:focus {
  text-decoration: none;
  color: inherit;
}

.domashnica-brands-list__media {
  flex: 0 0 120px;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.domashnica-brands-list__media img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.domashnica-brands-list__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.domashnica-brands-list__title {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.domashnica-brands-list__excerpt {
  display: block;
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0.85;
}

.domashnica-brands-list__empty {
  margin: 0;
}

.domashnica-brands-list__pagination {
  margin-top: 28px;
}

.domashnica-brands-list__pagination .page-numbers {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  justify-content: center;
}

.domashnica-brands-list__pagination .page-numbers li {
  margin: 0;
}

.domashnica-brands-list__pagination .page-numbers a,
.domashnica-brands-list__pagination .page-numbers span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: inherit;
}

.domashnica-brands-list__pagination .page-numbers .current {
  font-weight: 700;
  border-color: currentColor;
}

@media (max-width: 600px) {
  .domashnica-brands-list__card {
    gap: 14px;
    padding: 16px 0;
  }

  .domashnica-brands-list__media {
    flex-basis: 80px;
    width: 80px;
    height: 80px;
  }

  .domashnica-brands-list__title {
    font-size: 1.1rem;
  }
}
