/* Andes Cotizador 0.2.30 */

/* Botones generales */
.ac-add-quote,
.ac-submit-quote {
    border: 0;
    border-radius: 10px;
    background: #149bd3;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.ac-add-quote {
    padding: 14px 28px;
}

.ac-add-quote:hover,
.ac-submit-quote:hover {
    background: #087eae;
    color: #fff;
}

.ac-single-quote-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}

.ac-inline-status {
    display: none;
    font-size: 14px;
    color: #18864b;
}

.ac-inline-status.is-error {
    color: #c62828;
}

/* Contador */
.ac-header-button,
.ac-quote-header-link {
    position: relative !important;
}

.ac-quote-badge {
    position: absolute;
    top: -9px;
    right: -9px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef3340;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 22px;
    text-align: center;
    box-sizing: border-box;
    z-index: 20;
}

.ac-quote-badge:empty {
    display: none;
}

.ac-shortcode-badge {
    position: static;
    display: inline-block;
}

/* Contenedor único del carrito */
.ac-quote-panel {
    width: 100%;
    padding: 18px;
    color: #30363a;
    background: #fff;
    border: 1px solid #e0e6e9;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(20, 35, 45, 0.08);
    box-sizing: border-box;
    isolation: isolate;
}

.ac-panel-message {
    display: none;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #eaf7ee;
    color: #187445;
    font-size: 14px;
    font-weight: 700;
}

.ac-panel-message.is-error {
    background: #fff0f2;
    color: #b4233f;
}

.ac-empty {
    padding: 34px 20px;
    border: 1px dashed #cbd5da;
    border-radius: 14px;
    text-align: center;
    background: #f8fafb;
}

.ac-empty p {
    margin: 8px 0 0;
}

.ac-quote-items {
    overflow: hidden;
    background: #fff;
    border: 1px solid #dfe5e9;
    border-radius: 14px;
}

.ac-quote-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 12px;
    padding: 16px 18px;
    background: #f6f8f9;
    border-bottom: 1px solid #e3e8eb;
    font-size: 14px;
    font-weight: 800;
    color: #343a3e;
}

.ac-quote-head span:last-child {
    text-align: center;
}

.ac-quote-row {
    display: grid;
    grid-template-columns: 34px 62px minmax(0, 1fr) 84px;
    gap: 12px;
    align-items: center;
    min-height: 88px;
    padding: 13px 18px;
    background: #fff;
    border-bottom: 1px solid #e6eaed;
    box-sizing: border-box;
}

.ac-quote-row:last-child {
    border-bottom: 0;
}

.ac-quote-row img {
    display: block;
    width: 58px;
    height: 58px;
    object-fit: contain;
}

.ac-product-name {
    color: #148fc4;
    text-decoration: none;
    line-height: 1.35;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.ac-product-name:hover {
    color: #087eae;
    text-decoration: underline;
}

/* X de eliminar */
.ac-remove-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 34px;
    min-width: 28px;
    min-height: 34px;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    color: #69777f;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 27px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    box-shadow: none !important;
    box-sizing: border-box;
    appearance: none;
}

.ac-remove-item span {
    display: block;
    line-height: 1;
    transform: translateY(-1px);
}

.ac-remove-item:hover,
.ac-remove-item:focus-visible {
    border: 0 !important;
    background: transparent !important;
    color: #149bd3;
    outline: none;
    transform: scale(1.08);
}

.ac-remove-item.is-loading,
.ac-remove-item:disabled,
.ac-item-qty.is-loading,
.ac-clear-list.is-loading,
.ac-clear-list:disabled {
    opacity: 0.55;
    cursor: wait;
}

/* Cantidad */
.ac-item-qty {
    width: 72px;
    min-height: 42px;
    margin: 0;
    padding: 6px 8px;
    border: 1px solid #c7d0d5 !important;
    border-radius: 7px;
    background: #fff;
    box-shadow: none !important;
    color: #262b2e;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    box-sizing: border-box;
}

.ac-item-qty:focus {
    border-color: #149bd3 !important;
    outline: 2px solid rgba(20, 155, 211, 0.15);
    box-shadow: none !important;
}

/* Pie: mismo fondo blanco del carrito */
.ac-quote-footer {
    position: sticky;
    bottom: 0;
    z-index: 15;
    margin-top: 14px;
    padding: 14px 0 0;
    background: #fff;
    border-top: 1px solid #edf0f2;
}

.ac-quote-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 12px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #f1f5f7;
    color: #343a3e;
}

.ac-quote-summary strong {
    font-size: 17px;
}

.ac-quote-actions {
    display: grid;
    grid-template-columns: minmax(150px, auto) minmax(210px, 1fr);
    gap: 12px;
}

.ac-clear-list,
.ac-go-checkout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    margin: 0;
    padding: 12px 20px;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none !important;
    box-sizing: border-box;
}

/* Forzado para evitar que Elementor o el tema cambien el botón a rojo/rosa. */
.ac-quote-panel .ac-quote-actions .ac-clear-list,
.elementor-popup-modal .ac-quote-panel .ac-clear-list,
.dialog-widget-content .ac-quote-panel .ac-clear-list,
body .ac-quote-panel button.ac-clear-list {
    border: 1px solid #149bd3 !important;
    background: #fff !important;
    background-color: #fff !important;
    color: #149bd3 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.ac-quote-panel .ac-quote-actions .ac-clear-list:hover,
.ac-quote-panel .ac-quote-actions .ac-clear-list:focus,
.ac-quote-panel .ac-quote-actions .ac-clear-list:focus-visible,
.ac-quote-panel .ac-quote-actions .ac-clear-list:active,
.elementor-popup-modal .ac-quote-panel .ac-clear-list:hover,
.dialog-widget-content .ac-quote-panel .ac-clear-list:hover,
body .ac-quote-panel button.ac-clear-list:hover,
body .ac-quote-panel button.ac-clear-list:focus,
body .ac-quote-panel button.ac-clear-list:active {
    border-color: #149bd3 !important;
    background: #149bd3 !important;
    background-color: #149bd3 !important;
    color: #fff !important;
    box-shadow: none !important;
    text-shadow: none !important;
    outline: none !important;
}

.ac-go-checkout {
    border: 1px solid #149bd3;
    background: #149bd3;
    color: #fff !important;
}

.ac-go-checkout:hover,
.ac-go-checkout:focus-visible {
    border-color: #087eae;
    background: #087eae;
    color: #fff !important;
    outline: none;
}

/* Formulario interno, si se usa el shortcode correspondiente */
.ac-quote-form {
    margin-top: 20px;
    padding: 22px;
    border: 1px solid #d9dfe3;
    border-radius: 14px;
    background: #fff;
}

.ac-quote-form h3 {
    margin: 0 0 18px;
}

.ac-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.ac-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
}

.ac-form-grid input,
.ac-form-grid textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cfd6da;
    border-radius: 8px;
    box-sizing: border-box;
}

.ac-full {
    grid-column: 1 / -1;
}

.ac-submit-quote {
    width: 100%;
    margin-top: 18px;
    padding: 14px 18px;
    font-size: 16px;
}

.ac-form-message {
    margin-top: 14px;
    font-weight: 700;
}

.ac-form-message.is-success {
    color: #18864b;
}

.ac-form-message.is-error {
    color: #c62828;
}

/* WooCommerce añade este enlace automáticamente; Andes usa el botón Cotización. */
.added_to_cart.wc-forward,
a.added_to_cart,
.woocommerce a.added_to_cart {
    display: none !important;
}

/* YITH no debe mostrar mensajes ni enlaces hacia su lista paralela. */
[class*="yith_ywraq_add_item_product_message"],
[class*="yith_ywraq_add_item_response_message"],
[class*="yith_ywraq_add_item_browse_message"] {
    display: none !important;
}

/* Los dos botones reales deben conservar su diseño y permanecer visibles. */
.yith-ywraq-add-to-quote .yith-ywraq-add-button,
.yith-ywraq-add-to-quote .add-request-quote-button[data-ac-keep-visible],
.uc-button-addcart.add_to_cart_button.ajax_add_to_cart[data-ac-keep-visible] {
    visibility: visible !important;
    opacity: 1 !important;
}

.yith-ywraq-add-to-quote .yith-ywraq-add-button {
    display: block !important;
}

.ac-quote-loading {
    opacity: 0.65 !important;
    pointer-events: none !important;
    cursor: wait !important;
}

/* Dentro del popup solo se desplaza la lista; acciones y total quedan visibles. */
.elementor-popup-modal .ac-quote-panel,
.dialog-widget-content .ac-quote-panel {
    display: flex;
    flex-direction: column;
    max-height: min(690px, calc(100dvh - 270px));
    min-height: 300px;
    overflow: hidden;
}

.elementor-popup-modal .ac-quote-items,
.dialog-widget-content .ac-quote-items {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.elementor-popup-modal .ac-quote-head,
.dialog-widget-content .ac-quote-head {
    position: sticky;
    top: 0;
    z-index: 4;
}

.elementor-popup-modal .ac-quote-footer,
.dialog-widget-content .ac-quote-footer {
    position: relative;
    bottom: auto;
    flex: 0 0 auto;
    z-index: 5;
    padding: 14px 0 8px;
    box-shadow: 0 -12px 20px rgba(255, 255, 255, 0.96);
}

/* Botón único al finalizar el formulario */
.woocommerce-checkout #place_order.ac-final-order-button,
.woocommerce-checkout #place_order {
    width: 100%;
    min-height: 52px;
    padding: 14px 22px;
    border: 0;
    border-radius: 9px;
    background: #149bd3;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
}

.woocommerce-checkout #place_order:hover {
    background: #087eae;
    color: #fff;
}

@media (max-width: 640px) {
    .elementor-popup-modal .ac-quote-panel,
    .dialog-widget-content .ac-quote-panel {
        max-height: calc(100dvh - 235px);
        min-height: 280px;
    }
    .ac-quote-panel {
        padding: 12px;
        border-radius: 14px;
    }

    .ac-quote-head {
        display: none;
    }

    .ac-quote-row {
        grid-template-columns: 30px 52px minmax(0, 1fr);
        gap: 10px;
        min-height: 92px;
        padding: 12px;
    }

    .ac-quote-row img {
        width: 50px;
        height: 50px;
    }

    .ac-item-qty {
        grid-column: 3;
        width: 82px;
        justify-self: start;
    }

    .ac-quote-actions {
        grid-template-columns: 1fr;
    }

    .ac-clear-list,
    .ac-go-checkout {
        width: 100%;
    }

    .ac-form-grid {
        grid-template-columns: 1fr;
    }

    .ac-full {
        grid-column: auto;
    }
}


/* Mensaje final restaurado: no mover ni reposicionar con JavaScript */
.woocommerce-order-received .woocommerce-notice.woocommerce-notice--success,
.woocommerce-order-received .woocommerce-thankyou-order-received {
    display: none !important;
}

.ac-thankyou-row {
    position: relative;
    z-index: 5;
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin: -36px 0 30px;
    padding: 0 14px;
    box-sizing: border-box;
}

.ac-thankyou-message {
    width: min(420px, 100%);
    margin: 0;
    padding: 26px 24px;
    border: 1px solid #dce6eb;
    border-radius: 16px;
    background: #f7fbfd;
    text-align: center;
    box-sizing: border-box;
    box-shadow: 0 10px 30px rgba(20, 35, 45, 0.08);
    transform: translateX(20px);
}

.ac-thankyou-message h2 {
    margin: 0 0 8px;
    color: #149bd3;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.2;
}

.ac-thankyou-message p {
    margin: 0;
    color: #30363a;
    font-size: 18px;
    line-height: 1.45;
}

@media (max-width: 991px) {
    .ac-thankyou-row {
        justify-content: center;
        margin: 0 0 24px;
        padding: 0;
    }

    .ac-thankyou-message {
        width: 100%;
        padding: 22px 16px;
        transform: none;
    }

    .ac-thankyou-message h2 {
        font-size: 26px;
    }

    .ac-thankyou-message p {
        font-size: 16px;
    }
}


/* 0.2.25 — ficha principal: cantidad, Cotizar y Ficha Técnica alineados. */
body.single-product form.cart.ac-single-product-cart {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    column-gap: 20px !important;
    row-gap: 10px !important;
}

body.single-product form.cart.ac-single-product-cart .quantity,
body.single-product form.cart.ac-single-product-cart .yith-ywraq-add-to-quote,
body.single-product form.cart.ac-single-product-cart .yith-ywraq-add-button {
    display: inline-flex !important;
    align-items: center !important;
    align-self: center !important;
    height: 52px !important;
    min-height: 52px !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

body.single-product form.cart.ac-single-product-cart .quantity input.qty,
body.single-product form.cart.ac-single-product-cart input.qty,
body.single-product .elementor-widget-woocommerce-product-add-to-cart form.cart .quantity input[type="number"] {
    display: block !important;
    width: 62px !important;
    min-width: 62px !important;
    max-width: 62px !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    margin: 0 !important;
    padding: 0 8px !important;
    border-width: 1px !important;
    border-style: solid !important;
    line-height: 50px !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

body.single-product form.cart.ac-single-product-cart .add-request-quote-button,
body.single-product form.cart.ac-single-product-cart a.add-request-quote-button,
body.single-product form.cart.ac-single-product-cart button.add-request-quote-button,
body.single-product .ac-tech-sheet-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: center !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
    vertical-align: middle !important;
}

/* Oculta únicamente los asistentes flotantes mientras está abierto el popup. */
body.ac-quote-popup-open .ac-hide-during-quote {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}


/* 0.2.27 — controles de la ficha: altura y separación uniforme. */
body.single-product .elementor-widget-woocommerce-product-add-to-cart form.cart .quantity,
body.single-product .elementor-widget-woocommerce-product-add-to-cart form.cart .yith-ywraq-add-to-quote,
body.single-product .elementor-widget-woocommerce-product-add-to-cart form.cart .yith-ywraq-add-button {
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

body.single-product .elementor-widget-woocommerce-product-add-to-cart form.cart .quantity input.qty,
body.single-product .elementor-widget-woocommerce-product-add-to-cart form.cart .add-request-quote-button,
body.single-product .elementor-widget-woocommerce-product-add-to-cart form.cart a.add-request-quote-button,
body.single-product .elementor-widget-woocommerce-product-add-to-cart form.cart button.add-request-quote-button,
body.single-product a.ac-tech-sheet-button,
body.single-product button.ac-tech-sheet-button {
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    box-sizing: border-box !important;
}

body.single-product .elementor-widget-woocommerce-product-add-to-cart form.cart .add-request-quote-button,
body.single-product .elementor-widget-woocommerce-product-add-to-cart form.cart a.add-request-quote-button,
body.single-product .elementor-widget-woocommerce-product-add-to-cart form.cart button.add-request-quote-button,
body.single-product a.ac-tech-sheet-button,
body.single-product button.ac-tech-sheet-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1.2 !important;
}


/* 0.2.29 — controles estables: sin cálculos JS ni desplazamientos por píxeles. */
body.single-product .elementor-widget-woocommerce-product-add-to-cart form.cart .quantity,
body.single-product .elementor-widget-woocommerce-product-add-to-cart form.cart .yith-ywraq-add-to-quote,
body.single-product .elementor-widget-woocommerce-product-add-to-cart form.cart .yith-ywraq-add-button,
body.single-product .ac-tech-sheet-button,
body.single-product .ac-tech-sheet-button.elementor-button {
    margin-left: 0 !important;
    margin-right: 0 !important;
}


/* 0.2.29 — impedir movimientos laterales o verticales al cargar/agregar. */
body.single-product form.cart.ac-single-product-cart .quantity,
body.single-product form.cart.ac-single-product-cart .quantity input.qty,
body.single-product form.cart.ac-single-product-cart .yith-ywraq-add-to-quote,
body.single-product form.cart.ac-single-product-cart .yith-ywraq-add-button,
body.single-product form.cart.ac-single-product-cart .add-request-quote-button,
body.single-product .ac-tech-sheet-button {
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    translate: none !important;
}

body.single-product form.cart.ac-single-product-cart {
    column-gap: 20px !important;
}


/* 0.2.30 — separación fija entre Cantidad y Cotizar.
   YITH envuelve Cotizar en un bloque propio, por eso el gap del formulario no siempre se aplica. */
body.single-product form.cart.ac-single-product-cart > .quantity + .yith-ywraq-add-to-quote,
body.single-product form.cart.ac-single-product-cart > .quantity + .yith-ywraq-add-button,
body.single-product .elementor-widget-woocommerce-product-add-to-cart form.cart > .quantity + .yith-ywraq-add-to-quote,
body.single-product .elementor-widget-woocommerce-product-add-to-cart form.cart > .quantity + .yith-ywraq-add-button {
    margin-left: 20px !important;
}
