/* ===========================
   PRODUCT TEMPLATE (Elementor)
   =========================== */

/* =========================================
   Mobile container spacing fixes
   ========================================= */
@media (max-width: 768px) {
  #mobile-container-product {
    margin: 0 !important;
    padding: 0 !important;
  }

  .elementor-element.elementor-element-a11a582 {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  .elementor-element.elementor-element-a11a582 > .elementor-widget-container {
    margin: 0 !important;
    padding: 0 !important;
  }

  .elementor-widget.elementor-element-a11a582 {
    margin-bottom: 0 !important;
  }
}

/* =========================================
   Hide stock + reset variations + variation price
   ========================================= */
p.stock { display: none !important; }
p.in-stock { display: none !important; }
a.reset_variations { display: none !important; }
.single_variation .price { display: none !important; }
select[name^="attribute_"] option[value=""] { display: none !important; }

/* =========================================
   Variations table styling
   ========================================= */
table.variations,
table.variations th,
table.variations td {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
}

table.variations {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

table.variations th.label {
  width: 0.01%;
  white-space: nowrap;
  text-align: left;
  vertical-align: middle;
  padding-right: 10px !important;
}

table.variations th.label label {
  display: inline-block;
  margin: 0;
}

table.variations td.value {
  width: 99%;
  position: relative;
}

table.variations td.value select {
  width: 100% !important;
  box-sizing: border-box;
}

table.variations select {
  border: 2px solid #E4EFE7 !important;
  border-radius: 20px !important;
  padding: 10px !important;
  font-size: 16px !important;
  width: 100% !important;
  box-sizing: border-box;
  background-color: #fff !important;
}

table.variations select {
  -webkit-appearance: none;
  appearance: none;
  background: #fff;
  border: 1px solid #E4EFE7;
  border-radius: 20px;
  padding: 10px 36px 10px 12px;
  font-size: 16px;
  width: 100%;
  line-height: 1.2;
  outline: none;
  background-clip: padding-box;
}

table.variations td.value::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 12px;
  height: 8px;
  margin-top: -4px;
  pointer-events: none;
  background: url('data:image/svg+xml;utf8,\
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 8" fill="none"><path d="M1 1.5L6 6.5L11 1.5" stroke="%23777777" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat center / contain;
}

/* =========================================
   Mobile cart layout on product
   ========================================= */
@media (max-width: 768px) {
  form.cart,
  .woocommerce-variation-add-to-cart {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px;
  }

  .woocommerce-variation-add-to-cart .quantity,
  form.cart .quantity {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    order: 1;
  }

  .woocommerce-variation-add-to-cart .single_add_to_cart_button,
  form.cart .single_add_to_cart_button {
    order: 2;
    width: 100% !important;
  }

  .quantity-button {
    flex: 0 0 80px !important;
    width: 80px !important;
    height: 40px !important;
    font-size: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  .input-text.qty {
    flex: 1 1 auto !important;
    width: 1% !important;
    min-width: 0 !important;
    height: 40px !important;
    font-size: 18px !important;
    text-align: center !important;
  }
}

@media (max-width: 340px) {
  .quantity-button {
    flex: 0 0 40px !important;
    width: 40px !important;
    height: 40px !important;
  }
}

/* =========================================
   Price widget reorder (Elementor Woo price)
   ========================================= */
.single-product .elementor-widget-woocommerce-product-price .elementor-widget-container {
  display: flex;
  flex-direction: column;
}

.single-product .elementor-widget-woocommerce-product-price .elementor-widget-container > .price {
  order: 1;
  margin: 6px 0;
}

.single-product .elementor-widget-woocommerce-product-price .elementor-widget-container > .pph-lowest-price {
  order: 2;
  font-size: 12px;
  line-height: 1.2;
  opacity: .85;
  margin: 0 0 6px 0;
}

.single-product .elementor-widget-woocommerce-product-price .elementor-widget-container > .dynamic-total-price {
  order: 3;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.2;
  opacity: .75;
  margin: 0;
}

/* Old price (del) */
.single-product .elementor-widget-woocommerce-product-price .elementor-widget-container .price del,
.single-product .elementor-widget-woocommerce-product-price .elementor-widget-container .price del .woocommerce-Price-amount {
  font-size: 16px !important;
  font-weight: 400 !important;
  opacity: .6 !important;
  color: #000 !important;
}

.single-product .elementor-widget-woocommerce-product-price .elementor-widget-container .price del {
  text-decoration-thickness: 1px !important;
}

/* Current price (ins) */
.single-product .elementor-widget-woocommerce-product-price .elementor-widget-container .price ins,
.single-product .elementor-widget-woocommerce-product-price .elementor-widget-container .price ins .woocommerce-Price-amount {
  color: #d11 !important;
  font-weight: 700 !important;
  font-size: inherit !important;
}

.single-product .elementor-widget-woocommerce-product-price .elementor-widget-container .price ins {
  text-decoration: none !important;
}

/* =========================================
   Carousel full width on mobile/tablet
   ========================================= */
@media (max-width: 994px) {
  #carousel-product {
    position: relative;
    left: 50%;
    right: 50%;
    width: 100vw !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    padding: 0 !important;
    box-sizing: border-box;
  }

  #carousel-product .swiper.elementor-loop-container {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
  }

  #carousel-product .swiper-wrapper {
    margin: 0 !important;
    padding: 0 0px !important;
  }

  #carousel-product .swiper-slide {
    padding: 0 4px !important;
    box-sizing: border-box;
  }
}

/* =========================================
   HTML widget height fix (mobile)
   ========================================= */
@media (max-width: 768px) {
  .elementor-widget-html,
  .elementor-widget-html .elementor-widget-container {
    height: auto !important;
    min-height: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
}

/* =========================================
   Custom tabs
   ========================================= */
.custom-tabs {
  display: flex;
  flex-direction: column;
  margin-bottom: 2rem;
}

.custom-tabs-nav {
  display: flex;
  gap: 1rem;
  list-style: none;
  padding-left: 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
}

.custom-tabs-nav li {
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 500;
  background: none !important;
  box-shadow: none !important;
  border: none;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
  position: relative;
}

.custom-tabs-nav li.active {
  border-color: #99BC85;
  color: #99BC85;
}

.custom-tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.custom-tab-content.active {
  display: block;
}

.custom-tab-content a.custom-link {
  text-decoration: underline;
  text-decoration-color: #000;
  color: inherit;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================
   Description "Read more" (opis)
   ========================================= */
.opis-wrapper {
  position: relative;
}

.opis-short {
  max-height: 300px;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.opis-wrapper.expanded .opis-short {
  max-height: none;
}

.toggle-opis-link {
  display: inline-block !important;
  margin-top: 10px !important;
  color: #99BC85 !important;
  cursor: pointer !important;
  font-weight: 500 !important;
  text-decoration: underline !important;
}

.opis-wrapper::after {
  content: "";
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  height: 25px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1), #fff);
  z-index: 1;
}

.opis-wrapper.expanded::after {
  display: none;
}

/* =========================================
   Mobile adjustments for tabs/content typography
   ========================================= */
@media (max-width: 768px) {
  .custom-tabs-nav {
    flex-direction: row;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    gap: 0.5rem;
    scrollbar-width: none;
  }

  .custom-tabs-nav::-webkit-scrollbar {
    display: none;
  }

  .custom-tabs-nav li {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.5rem 1rem;
    border-bottom: 3px solid transparent;
    border-left: none;
    text-align: center;
  }

  .custom-tabs-nav li.active {
    border-bottom-color: #99BC85;
    border-left: none;
  }

  .custom-tabs #desc .opis-short {
    font-size: 13.5px;
    line-height: 1.4;
  }

  .custom-tabs #desc .opis-short p {
    margin-bottom: 6px;
  }

  .custom-tabs #desc .opis-short h3 {
    font-size: 15px;
    margin: 14px 0 6px;
  }

  .custom-tabs {
    margin-top: 0 !important;
  }

  .custom-tabs-nav {
    margin-bottom: 8px !important;
  }

  .custom-tab-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }

  .custom-tabs .custom-tab-content {
    font-size: 13.5px;
    line-height: 1.4;
  }

  .custom-tabs .custom-tab-content p {
    margin-bottom: 6px;
  }

  .custom-tabs .custom-tab-content h3 {
    font-size: 15px;
    line-height: 1.3;
    margin: 14px 0 6px;
  }

  .custom-tabs .custom-tab-content h4 {
    font-size: 14px;
    line-height: 1.3;
    margin: 12px 0 6px;
  }

  .custom-tabs .custom-tab-content ul {
    margin: 6px 0 8px 18px;
  }

  .custom-tabs .custom-tab-content li {
    margin-bottom: 4px;
    line-height: 1.4;
  }

  .custom-tabs .custom-tab-content a {
    font-size: 13.5px;
  }

  .toggle-opis-link {
    margin-top: 4px !important;
    font-size: 13.5px;
  }
}
