/* AETA Delivery UX – cart + classic checkout; nu atinge calculele WooCommerce. */
body.aeta-livrare-ux .woocommerce-shipping-methods,
body.aeta-livrare-ux ul#shipping_method {
    list-style: none !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 0 !important;
    margin: 0 0 8px !important;
    width: 100%;
    max-width: 100%;
}

body.aeta-livrare-ux .woocommerce-shipping-methods > li,
body.aeta-livrare-ux ul#shipping_method > li {
    position: relative;
    display: block !important;
    width: 100%;
    margin: 0 !important;
    padding: 13px 14px !important;
    background: #fff;
    border: 1px solid #dedede;
    border-radius: 13px;
    box-sizing: border-box;
    color: #141414;
    box-shadow: none;
    line-height: 1.5;
    text-align: left;
    transition: border-color .15s ease, background-color .15s ease;
}

body.aeta-livrare-ux ul#shipping_method > li.aeta-method-selected,
body.aeta-livrare-ux ul#shipping_method > li:has(input.shipping_method:checked) {
    border-color: #202020;
    background: #fdfdfd;
}

body.aeta-livrare-ux ul#shipping_method > li > input.shipping_method[type="radio"] {
    appearance: auto;
    position: absolute !important;
    left: 14px;
    top: 18px;
    width: 17px !important;
    height: 17px !important;
    margin: 0 !important;
    padding: 0 !important;
    accent-color: #151515;
    cursor: pointer;
    float: none !important;
}

body.aeta-livrare-ux ul#shipping_method > li > label {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100% !important;
    min-height: 22px;
    padding: 0 0 0 28px !important;
    margin: 0 !important;
    float: none !important;
    text-align: left !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #141414;
    cursor: pointer;
    box-sizing: border-box;
}

body.aeta-livrare-ux ul#shipping_method > li > input[type="hidden"] + label {
    padding-left: 0 !important;
}

body.aeta-livrare-ux .aeta-delivery-icon {
    flex: 0 0 auto;
    display: inline-flex;
    width: 21px;
    height: 21px;
    align-items: center;
    justify-content: center;
    color: #555;
}

body.aeta-livrare-ux .aeta-delivery-icon svg {
    display: block;
    max-width: 100%;
    height: auto;
}

body.aeta-livrare-ux .aeta-delivery-method-name {
    flex: 1 1 155px;
    min-width: 0;
    text-align: left;
}

body.aeta-livrare-ux ul#shipping_method > li > label .woocommerce-Price-amount,
body.aeta-livrare-ux .aeta-delivery-free {
    flex: 0 0 auto;
    white-space: nowrap;
    margin-left: auto;
    font-size: 14px;
    font-weight: 700;
    color: #141414;
}

body.aeta-livrare-ux .aeta-delivery-free {
    font-weight: 600;
}

body.aeta-livrare-ux .aeta-delivery-extra {
    display: none;
    margin: 7px 0 0 28px;
    padding-top: 8px;
    border-top: 1px solid #e8e8e8;
    font-size: 12.5px;
    line-height: 1.6;
    color: #565656;
}

body.aeta-livrare-ux li.aeta-method-selected .aeta-delivery-extra,
body.aeta-livrare-ux li:has(input.shipping_method:checked) .aeta-delivery-extra,
body.aeta-livrare-ux li:has(input.shipping_method[type="hidden"]) .aeta-delivery-extra {
    display: block;
}

body.aeta-livrare-ux .aeta-delivery-extra p {
    margin: 0 0 5px !important;
    padding: 0;
}

body.aeta-livrare-ux .aeta-delivery-extra p:last-child {
    margin-bottom: 0 !important;
}

body.aeta-livrare-ux .aeta-delivery-eyebrow {
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .045em;
    color: #7a7a7a;
}

body.aeta-livrare-ux .aeta-pickup-extra address {
    display: block;
    margin: 0 0 4px;
    font-style: normal;
    font-size: 13px;
    font-weight: 600;
    color: #262626;
}

body.aeta-livrare-ux .aeta-delivery-maps {
    display: inline-block;
    padding: 2px 0;
    font-size: 12.5px;
    text-decoration: underline;
    text-underline-offset: 2px;
    color: #202020;
}

body.aeta-livrare-ux .aeta-delivery-maps:hover {
    color: #666;
}

body.aeta-livrare-ux .aeta-delivery-hours,
body.aeta-livrare-ux .aeta-pickup-extra .aeta-delivery-muted {
    margin-top: 6px !important;
}

/* La ridicare dispare mesajul redundant „Livrare la București” și linkul de schimbare a destinației. */
body.aeta-livrare-ux .woocommerce-shipping-totals.aeta-pickup-selected .woocommerce-shipping-destination,
body.aeta-livrare-ux .woocommerce-shipping-totals.aeta-pickup-selected .woocommerce-shipping-calculator,
body.aeta-livrare-ux .woocommerce-shipping-totals:has(input.shipping_method:checked[value^="local_pickup"]) .woocommerce-shipping-destination,
body.aeta-livrare-ux .woocommerce-shipping-totals:has(input.shipping_method:checked[value^="local_pickup"]) .woocommerce-shipping-calculator {
    display: none !important;
}

body.aeta-livrare-ux .cart_totals > h2,
body.aeta-livrare-ux .cart_totals .widget-title {
    font-weight: 600;
    letter-spacing: -.02em;
}

@media (max-width: 767px) {
    body.aeta-livrare-ux ul#shipping_method > li {
        padding: 13px 12px !important;
    }

    body.aeta-livrare-ux ul#shipping_method > li > input.shipping_method[type="radio"] {
        left: 12px;
        top: 17px;
    }

    body.aeta-livrare-ux ul#shipping_method > li > label {
        padding-left: 26px !important;
        gap: 6px;
        font-size: 13px;
    }

    body.aeta-livrare-ux .aeta-delivery-method-name {
        flex-basis: 100px;
    }

    body.aeta-livrare-ux .aeta-delivery-extra {
        margin-left: 26px;
    }
}


/* v1.1.0: sumarul coșului — împiedică micșorarea primei coloane de către cardurile de livrare.
   Doar coșul clasic; tabelul de checkout și tabelul de produse rămân intacte. */
body.aeta-livrare-ux.woocommerce-cart .cart_totals table.shop_table,
body.aeta-livrare-ux.woocommerce-cart .cart_totals table.shop_table > tbody {
    display: block !important;
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
}

body.aeta-livrare-ux.woocommerce-cart .cart_totals table.shop_table > tbody > tr {
    display: grid !important;
    grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    align-items: center;
    box-sizing: border-box;
    padding: 15px 0 !important;
    border-bottom: 1px solid #e7e7e7;
}

body.aeta-livrare-ux.woocommerce-cart .cart_totals table.shop_table > tbody > tr > th,
body.aeta-livrare-ux.woocommerce-cart .cart_totals table.shop_table > tbody > tr > td {
    display: block !important;
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent;
}

body.aeta-livrare-ux.woocommerce-cart .cart_totals table.shop_table > tbody > tr > th {
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
    text-align: left !important;
}

body.aeta-livrare-ux.woocommerce-cart .cart_totals table.shop_table > tbody > tr > td {
    text-align: right !important;
}

/* Metodele de livrare ocupă toată lățimea sumarului, nu doar coloana dreaptă. */
body.aeta-livrare-ux.woocommerce-cart .cart_totals table.shop_table > tbody > tr.woocommerce-shipping-totals,
body.aeta-livrare-ux.woocommerce-cart .cart_totals table.shop_table > tbody > tr.shipping {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
    align-items: start;
}

body.aeta-livrare-ux.woocommerce-cart .cart_totals table.shop_table > tbody > tr.woocommerce-shipping-totals > td,
body.aeta-livrare-ux.woocommerce-cart .cart_totals table.shop_table > tbody > tr.shipping > td {
    text-align: left !important;
}

/* WoodMart/WooCommerce poate afișa etichete duplicate prin pseudo-elemente pe mobil. */
body.aeta-livrare-ux.woocommerce-cart .cart_totals table.shop_table > tbody > tr > td::before {
    display: none !important;
}

body.aeta-livrare-ux.woocommerce-cart .cart_totals table.shop_table .woocommerce-shipping-destination,
body.aeta-livrare-ux.woocommerce-cart .cart_totals table.shop_table .woocommerce-shipping-calculator {
    text-align: left;
}

/* Nume și tarif pe un singur rând ori de câte ori spațiul permite. */
body.aeta-livrare-ux .aeta-delivery-method-name {
    flex-basis: auto;
}

@media (max-width: 767px) {
    body.aeta-livrare-ux.woocommerce-cart .cart_totals table.shop_table > tbody > tr {
        grid-template-columns: minmax(0, 43%) minmax(0, 1fr);
    }
    body.aeta-livrare-ux.woocommerce-cart .cart_totals table.shop_table > tbody > tr.woocommerce-shipping-totals,
    body.aeta-livrare-ux.woocommerce-cart .cart_totals table.shop_table > tbody > tr.shipping {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* v1.2.0 – Checkout clasic: păstrăm tabelul de produse/totaluri intact.
   Doar rândul de livrare ocupă 2 coloane; „Livrare” devine un titlu normal
   deasupra cardurilor, în loc să stea în coloana din stânga. */
body.aeta-livrare-ux.woocommerce-checkout .woocommerce-checkout-review-order-table
  tr.aeta-checkout-shipping-wide > th {
    display: none !important;
}

body.aeta-livrare-ux.woocommerce-checkout .woocommerce-checkout-review-order-table
  tr.aeta-checkout-shipping-wide > td {
    display: table-cell !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 16px 0 !important;
    text-align: left !important;
    vertical-align: top !important;
    box-sizing: border-box;
}

body.aeta-livrare-ux.woocommerce-checkout .woocommerce-checkout-review-order-table
  tr.aeta-checkout-shipping-wide > td::before {
    display: none !important;
}

body.aeta-livrare-ux.woocommerce-checkout .woocommerce-checkout-review-order-table
  .aeta-checkout-shipping-title {
    display: block;
    margin: 0 0 11px;
    padding: 0;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 600;
    text-align: left;
    color: #141414;
}

body.aeta-livrare-ux.woocommerce-checkout .woocommerce-checkout-review-order-table
  tr.aeta-checkout-shipping-wide #shipping_method {
    margin-bottom: 0 !important;
}

body.aeta-livrare-ux.woocommerce-checkout .woocommerce-checkout-review-order-table
  tr.aeta-checkout-shipping-wide .woocommerce-shipping-destination,
body.aeta-livrare-ux.woocommerce-checkout .woocommerce-checkout-review-order-table
  tr.aeta-checkout-shipping-wide .woocommerce-shipping-calculator {
    text-align: left !important;
}

@media (max-width: 767px) {
    body.aeta-livrare-ux.woocommerce-checkout .woocommerce-checkout-review-order-table
      tr.aeta-checkout-shipping-wide > td {
        padding: 12px 0 !important;
    }
}
