/* Estilos para items custom de la calculadora en carrito y checkout */

/* Botones de accion del carrito: Finalizar compra + Seguir comprando */
.wc-proceed-to-checkout {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.wc-proceed-to-checkout .checkout-button {
    flex: 1 1 auto;
}

.calc-seguir-comprando {
    flex: 0 0 auto;
    background: #fff !important;
    color: #2e4b6e !important;
    border: 2px solid #2e4b6e !important;
    font-size: 0.9em !important;
    padding: 12px 20px !important;
    text-align: center;
    border-radius: 12px !important;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.calc-seguir-comprando:hover {
    background: #2e4b6e !important;
    color: #fff !important;
}

/* Ocultar precio tachado en todas sus formas */
.calc-custom-item del,
.calc-custom-item ins,
.calc-custom-item .price del,
.calc-custom-item .price ins,
.calc-custom-item .woocommerce-Price-amount del,
.calc-custom-item .amount del,
.woocommerce-checkout-review-order-table .calc-custom-item del,
.woocommerce-checkout-review-order-table .calc-custom-item ins {
    display: none !important;
}

/* Ocultar descripcion corta del producto */
.calc-custom-item .product-short-description,
.calc-custom-item .cart_short_description,
.calc-custom-item p.product-description,
.calc-custom-item .woocommerce-cart-item__description {
    display: none !important;
}

/* Item meta: una sola entrada con lineas compactas */
.calc-custom-item .wc-item-meta,
.calc-custom-item dl.variation {
    margin: 6px 0 0 0 !important;
    font-size: 0.9em;
    line-height: 1.6;
}

/* Ocultar la etiqueta "Detalle:" — solo mostrar el valor */
.calc-custom-item dl.variation dt,
.calc-custom-item .wc-item-meta .wc-item-meta-label {
    display: none !important;
}

/* dd ocupa toda la anchura sin sangria */
.calc-custom-item dl.variation dd {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

/* Anular margenes de <p> generados por wpautop — block para respetar saltos de linea */
.calc-custom-item dl.variation dd p,
.calc-custom-item .wc-item-meta p {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.6;
}

/* Imagen del distribuidor */
.calc-cart-thumbnail {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Cantidad total: solo lectura */
.calc-total-qty-display {
    display: block;
    text-align: center;
    font-weight: 600;
    font-size: 1em;
    color: #1a1a1a;
}

/* Editor de cantidades por color */
.calc-qty-editor {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e8e8e8;
}

.calc-color-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.calc-color-label {
    font-weight: 600;
    font-size: 14px !important;
    color: #333;
    width: 74% !important;
}

.calc-color-qty-input {
    width: 20%;
    padding: 0 !important;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    font-size: 14px !important;
    line-height: 19px;
}

.calc-color-qty-input:focus {
    outline: none;
    border-color: #2e4b6e;
}

.calc-color-uds {
    font-size: 0.85em;
    color: #666;
}

.calc-update-link {
    display: inline-block;
    margin-top: 7px;
    font-size: 0.8em;
    color: #6b8aad;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}

.calc-update-link:hover {
    color: #2e4b6e;
    text-decoration: none;
}

.calc-update-link.calc-updating {
    color: #aaa;
    cursor: wait;
    pointer-events: none;
}

/* ============================================================
   CART - MOBILE ONLY
   ============================================================ */
@media (max-width: 768px) {

    .calc-custom-item dl.variation dd p,
    .calc-custom-item .wc-item-meta p {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1.6;
        text-align: left;
    }

    .calc-color-label {
        width: 50% !important;
        text-align: left;
    }

    .calc-color-qty-input {
        width: 30% !important;
        text-align: right;
    }

    .woocommerce table.shop_table_responsive tr td::before,
    .woocommerce-page table.shop_table_responsive tr td::before {
        content: attr(data-title) ": ";
        font-weight: 700;
        float: none;
        text-align: left;
        display: block;
    }

    .product-name a {
        text-align: left !important;
        display: block;
    }

    .product-price::before,
    .product-quantity::before,
    .product-subtotal::before {
        float: left !important;
    }

    .calc-total-qty-display {
        text-align: right;
    }

    td.product-price,
    td.product-quantity,
    td.product-subtotal {
        padding: 0 !important;
    }
}

#add_payment_method table.cart td, #add_payment_method table.cart th, .woocommerce-cart table.cart td, .woocommerce-cart table.cart th, .woocommerce-checkout table.cart td, .woocommerce-checkout table.cart th {
    vertical-align: top !important;
}