/* ==========================================================
   SOWIESO.MEDIA — WooCommerce Service Selection / Checkout
   Production baseline — final 2026-10-01
   ========================================================== */

/* ----------------------------------------------------------
   1. CART — DESKTOP / GLOBAL
   ---------------------------------------------------------- */

/* Hide manual cart update button. Auto-update is handled by JS in functions.php. */
.woocommerce-cart button[name="update_cart"] {
  display: none !important;
}

/* Stabilize cart table layout. */
.woocommerce-cart table.shop_table.cart {
  width: 100% !important;
  table-layout: fixed !important;
}

.woocommerce-cart table.shop_table.cart th.product-remove,
.woocommerce-cart table.shop_table.cart td.product-remove {
  width: 64px !important;
}

.woocommerce-cart table.shop_table.cart th.product-thumbnail,
.woocommerce-cart table.shop_table.cart td.product-thumbnail {
  width: 92px !important;
}

.woocommerce-cart table.shop_table.cart th.product-name,
.woocommerce-cart table.shop_table.cart td.product-name {
  width: 40% !important;
  max-width: 420px !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
}

.woocommerce-cart table.shop_table.cart th.product-price,
.woocommerce-cart table.shop_table.cart td.product-price,
.woocommerce-cart table.shop_table.cart th.product-quantity,
.woocommerce-cart table.shop_table.cart td.product-quantity {
  width: 13% !important;
  white-space: nowrap !important;
}

.woocommerce-cart table.shop_table.cart th.product-subtotal,
.woocommerce-cart table.shop_table.cart td.product-subtotal {
  width: 18% !important;
  white-space: nowrap !important;
}

/* Cart product thumbnail. */
.woocommerce-cart td.product-thumbnail img {
  min-width: 72px !important;
  width: 72px !important;
  height: 72px !important;
  object-fit: cover !important;
  border-radius: 8px !important;
}

/* Cart service title. */
.woocommerce-cart td.product-name a {
  display: inline-block !important;
  max-width: 100% !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
}

/* Cart service short description. Text is trimmed in functions.php. */
.woocommerce-cart .sowieso-cart-desc,
.woocommerce-cart .sowieso-cart-desc p {
  display: block !important;
  max-width: 360px !important;
  margin-top: 8px !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  color: rgba(255, 255, 255, 0.72) !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

/* ----------------------------------------------------------
   2. QUANTITY — CART + SINGLE PRODUCT
   ---------------------------------------------------------- */

.woocommerce-cart .quantity,
.single-product .quantity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.woocommerce-cart .quantity input.qty,
.single-product .quantity input.qty {
  width: 44px;
  height: 44px;
  min-width: 44px !important;
  max-width: 44px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #fff !important;
  text-align: center !important;
  font-size: 18px;
  font-weight: 600;
  line-height: 44px !important;
  appearance: textfield !important;
  -moz-appearance: textfield !important;
  -webkit-appearance: none !important;
}

.woocommerce-cart .quantity input.qty::-webkit-outer-spin-button,
.woocommerce-cart .quantity input.qty::-webkit-inner-spin-button,
.single-product .quantity input.qty::-webkit-outer-spin-button,
.single-product .quantity input.qty::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  appearance: none !important;
  margin: 0 !important;
  display: none !important;
}

.woocommerce-cart .quantity::before,
.woocommerce-cart .quantity::after,
.single-product .quantity::before,
.single-product .quantity::after {
  display: none !important;
  content: none !important;
}

/* Hide theme/plugin +/- controls. */
.woocommerce .quantity .plus,
.woocommerce .quantity .minus,
button.plus,
button.minus,
a.plus,
a.minus,
span.plus,
span.minus {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ----------------------------------------------------------
   3. CART REMOVE BUTTON
   ---------------------------------------------------------- */

.woocommerce-cart a.remove.sowieso-remove-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.8) !important;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.woocommerce-cart a.remove.sowieso-remove-icon svg {
  width: 16px;
  height: 16px;
  transition: all 0.2s ease;
}

.woocommerce-cart a.remove.sowieso-remove-icon:hover {
  color: #b7ff3c !important;
  border-color: rgba(183, 255, 60, 0.4);
  background: rgba(183, 255, 60, 0.08);
}

.woocommerce-cart a.remove.sowieso-remove-icon:hover svg {
  transform: scale(1.08);
}

/* ----------------------------------------------------------
   4. SINGLE PRODUCT DESCRIPTION
   ---------------------------------------------------------- */

/* Product description bullets reset (handled by Elementor icons). */
.single-product .woocommerce-Tabs-panel li::marker,
.single-product .woocommerce-Tabs-panel--description li::marker,
.single-product .wc-tab li::marker,
.single-product .entry-content li::marker {
  color: inherit !important;
}

.single-product .woocommerce-Tabs-panel li::before,
.single-product .woocommerce-Tabs-panel--description li::before,
.single-product .wc-tab li::before,
.single-product .entry-content li::before {
  content: none !important;
}

/* Woo product description icons (Font Awesome). */
.single-product .woocommerce-Tabs-panel i.far.fa-dot-circle {
  color: #caf566 !important;
}

/* ----------------------------------------------------------
   5. FLOATING SERVICE SELECTION
   ---------------------------------------------------------- */

.sowieso-floating-cart {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: rgba(12, 12, 12, 0.5);
  border: 1px solid rgba(202, 246, 102, 0.35);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.sowieso-floating-cart:hover {
  color: #caf666;
  border-color: #caf666;
  background: rgba(20, 20, 20, 0.96);
}

.sowieso-floating-cart-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #caf666;
  color: #000;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

/* ----------------------------------------------------------
   CHECKOUT — DESKTOP VALIDATION NOTICE
   Keep WooCommerce errors out of the checkout layout flow.
   ---------------------------------------------------------- */

@media (min-width: 768px) {

  body.woocommerce-checkout .woocommerce-NoticeGroup-checkout {
    position: fixed !important;
    top: 70px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: min(520px, calc(100vw - 40px)) !important;
    margin: 0 !important;
    z-index: 10000 !important;
  }

  body.woocommerce-checkout .woocommerce-NoticeGroup-checkout ul.woocommerce-error {
    margin: 0 !important;
  }
}

/* ==========================================================
   6. MOBILE — CART + CHECKOUT
   ========================================================== */

@media (max-width: 767px) {

  /* Cart: force WooCommerce table into mobile cards. */
  body.woocommerce-cart table.shop_table.cart,
  body.woocommerce-cart table.shop_table.cart tbody,
  body.woocommerce-cart table.shop_table.cart tr,
  body.woocommerce-cart table.shop_table.cart td {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  body.woocommerce-cart table.shop_table.cart thead {
    display: none !important;
  }

  body.woocommerce-cart table.shop_table.cart tr.cart_item {
    position: relative;
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
  }

  /* Added-to-cart notice button. */
  body.woocommerce-cart .woocommerce-message .button {
    float: none !important;
    display: table !important;
    margin: 16px auto 0 !important;
    transform: translateX(-20px);
  }

  /* Cart remove button. */
  body.woocommerce-cart td.product-remove {
    position: absolute !important;
    top: 60px !important;
    right: 14px;
    transform: none !important;
    width: auto !important;
    max-width: none !important;
    padding: 0 !important;
    z-index: 3;
  }

  body.woocommerce-cart td.product-remove::before {
    content: none !important;
    display: none !important;
  }

  /* Cart thumbnail. */
  body.woocommerce-cart td.product-thumbnail {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 18px;
    padding-right: 64px !important;
    text-align: left !important;
  }

  body.woocommerce-cart td.product-thumbnail::before {
    content: none !important;
    display: none !important;
  }

  body.woocommerce-cart td.product-thumbnail img {
    width: 82px !important;
    height: 82px !important;
    min-width: 82px !important;
    object-fit: cover !important;
  }

  /* Cart service title / description.
     These selectors intentionally override WooCommerce responsive-table rules. */
  body.woocommerce-cart table.shop_table_responsive tr td.product-name,
  body.woocommerce-cart table.shop_table_responsive tbody tr td.product-name,
  body.woocommerce-cart .woocommerce-cart-form table.shop_table tr.cart_item td.product-name {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 0 14px 0 !important;
    padding: 0 54px 16px 0 !important;
    box-sizing: border-box !important;
    clear: both !important;
    text-align: left !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
  }

  body.woocommerce-cart table.shop_table_responsive tr td.product-name::before,
  body.woocommerce-cart table.shop_table_responsive tbody tr td.product-name::before,
  body.woocommerce-cart .woocommerce-cart-form table.shop_table tr.cart_item td.product-name::before {
    content: "Leistung:" !important;
    display: block !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
    margin: 0 0 10px 0 !important;
    padding: 0 !important;
    text-align: left !important;
    font-weight: 700 !important;
    color: #fff !important;
    line-height: 1.3 !important;
  }

  body.woocommerce-cart table.shop_table_responsive tr td.product-name > a,
  body.woocommerce-cart .woocommerce-cart-form table.shop_table tr.cart_item td.product-name > a {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    text-align: left !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
  }

  body.woocommerce-cart table.shop_table_responsive tr td.product-name .sowieso-cart-desc,
  body.woocommerce-cart table.shop_table_responsive tr td.product-name .sowieso-cart-desc p,
  body.woocommerce-cart .woocommerce-cart-form table.shop_table tr.cart_item td.product-name .sowieso-cart-desc,
  body.woocommerce-cart .woocommerce-cart-form table.shop_table tr.cart_item td.product-name .sowieso-cart-desc p {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    margin: 8px 0 0 0 !important;
    padding: 0 !important;
    text-align: left !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    line-height: 1.45 !important;
  }

  /* Cart price / quantity / subtotal rows. */
  body.woocommerce-cart td.product-price,
  body.woocommerce-cart td.product-quantity,
  body.woocommerce-cart td.product-subtotal {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: center !important;
    column-gap: 18px;
    min-height: 54px;
    padding: 10px 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left !important;
    white-space: normal !important;
  }

  body.woocommerce-cart td.product-price::before,
  body.woocommerce-cart td.product-quantity::before,
  body.woocommerce-cart td.product-subtotal::before {
    grid-column: 1;
    justify-self: start !important;
    align-self: center !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 44px !important;
    font-weight: 700 !important;
    color: rgba(255, 255, 255, 0.85) !important;
    text-align: left !important;
    float: none !important;
    width: auto !important;
  }

  body.woocommerce-cart td.product-price::before {
    content: "Preis:" !important;
  }

  body.woocommerce-cart td.product-quantity::before {
    content: "Anzahl:" !important;
  }

  body.woocommerce-cart td.product-subtotal::before {
    content: "Zwischensumme:" !important;
  }

  body.woocommerce-cart td.product-price .amount,
  body.woocommerce-cart td.product-price .woocommerce-Price-amount,
  body.woocommerce-cart td.product-subtotal .amount,
  body.woocommerce-cart td.product-subtotal .woocommerce-Price-amount,
  body.woocommerce-cart td.product-quantity .quantity {
    grid-column: 2;
    justify-self: end !important;
    align-self: center !important;
    margin: 0 !important;
    text-align: right !important;
    line-height: 44px !important;
    white-space: nowrap !important;
  }

  body.woocommerce-cart td.product-quantity .quantity {
    line-height: 1 !important;
  }

  /* Cart totals / CTA. */
  body.woocommerce-cart .cart-collaterals,
  body.woocommerce-cart .cart_totals {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
  }

  body.woocommerce-cart .checkout-button {
    width: 100% !important;
    text-align: center !important;
  }

  /* Checkout layout. */
  body.woocommerce-checkout .col2-set,
  body.woocommerce-checkout .woocommerce-checkout-review-order {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
  }

  body.woocommerce-checkout input,
  body.woocommerce-checkout textarea,
  body.woocommerce-checkout select {
    width: 100% !important;
    max-width: 100% !important;
  }

  body.woocommerce-checkout table.shop_table {
    width: 100% !important;
    table-layout: auto !important;
  }

  /* Checkout product: thumbnail + service title stay in separate columns. */
  body.woocommerce-checkout .sowieso-checkout-item {
    display: grid !important;
    grid-template-columns: 82px minmax(0, 1fr) !important;
    column-gap: 16px !important;
    align-items: center !important;
    width: 100% !important;
  }

  body.woocommerce-checkout .sowieso-checkout-thumb {
    width: 82px !important;
    height: 82px !important;
    min-width: 82px !important;
    margin: 0 !important;
    float: none !important;
    object-fit: cover !important;
  }

  body.woocommerce-checkout .sowieso-checkout-item > span {
    min-width: 0 !important;
    display: block !important;
    margin: 0 !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
  }

  /* Floating service selection on mobile. */
  .sowieso-floating-cart {
    right: 14px;
    bottom: 22px;
    top: auto;
    transform: none;
    width: 52px;
    height: 52px;
  }
}