/* Carrito estilo AliExpress (Cesta + Resumen) + Checkout */

.woocommerce-cart .doro-page__title,
.woocommerce-cart .entry-title:not(.doro-cesta__title) {
    display: none !important;
}

.woocommerce-cart .doro-page__container,
.woocommerce-checkout .doro-page__container,
.doro-cart > .woocommerce,
.doro-checkout > .woocommerce {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg) var(--spacing-2xl);
    box-sizing: border-box;
    width: 100%;
}

.doro-cart,
.doro-checkout,
.woocommerce-cart .doro-page,
.woocommerce-checkout .doro-page {
    width: 100%;
    background: #f2f2f2;
    min-height: 50vh;
}

.woocommerce-cart .doro-page__article,
.woocommerce-checkout .doro-page__article {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

.woocommerce-cart .doro-page__container,
.woocommerce-checkout .doro-page__container {
    padding-top: var(--spacing-xl);
    padding-bottom: var(--spacing-2xl);
}

.woocommerce-cart .woocommerce {
    display: block;
    width: 100%;
}

/* —— Shell Cesta —— */
.doro-cesta {
    width: 100%;
}

.doro-cesta__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: var(--spacing-lg);
    align-items: start;
}

.doro-cesta__main {
    background: var(--color-white);
    border-radius: 12px;
    padding: var(--spacing-lg) var(--spacing-xl) var(--spacing-xl);
    min-width: 0;
}

.doro-cesta__title {
    margin: 0 0 var(--spacing-lg);
    font-size: 22px;
    font-weight: 700;
    color: var(--color-dark);
}

.doro-cesta__aside {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    position: sticky;
    top: 16px;
}

/* Vacío */
.doro-cesta-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: clamp(40px, 7vw, 80px) var(--spacing-md) clamp(48px, 8vw, 96px);
}

.doro-cesta-empty__image {
    width: min(200px, 55vw);
    height: auto;
    margin: 0 0 var(--spacing-md);
    display: block;
}

.doro-cesta-empty__text {
    margin: 0 0 var(--spacing-lg);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-dark);
}

.doro-cesta-empty__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: min(280px, 100%);
}

.doro-cesta-empty__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    padding: 0 20px;
    border-radius: 999px;
    font-weight: 700;
    font-size: var(--font-size-base);
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    transition: opacity var(--transition);
}

.doro-cesta-empty__btn:hover {
    opacity: 0.92;
}

.doro-cesta-empty__btn--primary {
    background: var(--color-red-accent);
    color: var(--color-white) !important;
}

.doro-cesta-empty__btn--dark {
    background: var(--color-dark);
    color: var(--color-white) !important;
}

/* Resumen */
.doro-cesta-summary {
    background: var(--color-white);
    border-radius: 12px;
    padding: var(--spacing-lg);
}

.doro-cesta-summary__title {
    margin: 0 0 var(--spacing-lg);
    font-size: 18px;
    font-weight: 700;
}

.doro-cesta-summary__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-size-base);
    color: var(--color-dark);
}

.doro-cesta-summary__total {
    font-size: 22px;
    font-weight: 700;
}

.doro-cesta-summary__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    border-radius: 999px;
    background: var(--color-red-accent);
    color: var(--color-white) !important;
    font-weight: 700;
    font-size: var(--font-size-base);
    text-decoration: none !important;
    border: none;
}

.doro-cesta-summary__cta:hover {
    opacity: 0.92;
    color: var(--color-white) !important;
}

.doro-cesta-summary__cta.is-disabled {
    opacity: 0.55;
    pointer-events: none;
    cursor: not-allowed;
}

/* Trust */
.doro-cesta-trust {
    background: var(--color-white);
    border-radius: 12px;
    padding: 4px 0;
    overflow: hidden;
}

.doro-cesta-trust__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--color-dark);
    text-decoration: none;
    border-bottom: 1px solid var(--color-grey-border);
}

.doro-cesta-trust__item:last-child {
    border-bottom: none;
}

.doro-cesta-trust__item--static {
    cursor: default;
}

.doro-cesta-trust__icon {
    flex-shrink: 0;
    color: var(--color-dark);
}

.doro-cesta-trust__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.doro-cesta-trust__body strong {
    font-size: var(--font-size-sm);
    font-weight: 700;
}

.doro-cesta-trust__body small {
    font-size: 11px;
    color: var(--color-grey-text);
}

.doro-cesta-trust__chevron {
    color: var(--color-grey-text);
    font-size: 18px;
    line-height: 1;
}

/* Recomendados */
.doro-cesta-recs {
    margin-top: var(--spacing-xl);
}

.doro-cesta-recs__title {
    margin: 0 0 var(--spacing-md);
    font-size: 18px;
    font-weight: 700;
}

.doro-cesta-recs__grid.products {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--spacing-md);
    list-style: none;
    margin: 0;
    padding: 0;
}

.doro-cesta-recs__grid .home-product-card {
    width: auto;
}

/* Tabla carrito (lleno) */
.doro-cesta .woocommerce-cart-form {
    margin: 0;
}

.doro-cesta .shop_table {
    width: 100%;
    border-collapse: collapse;
}

.doro-cesta .shop_table th {
    text-align: left;
    padding: 12px 8px;
    font-size: var(--font-size-sm);
    color: var(--color-grey-text);
    border-bottom: 1px solid var(--color-grey-border);
}

.doro-cesta .shop_table td {
    padding: 14px 8px;
    vertical-align: middle;
    border-bottom: 1px solid var(--color-grey-border);
    font-size: var(--font-size-base);
}

.doro-cesta .product-thumbnail img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    background: var(--color-grey-bg);
    border-radius: var(--radius-sm);
}

.doro-cesta .product-name a {
    color: var(--color-dark);
    font-weight: 600;
    text-decoration: none;
}

.doro-cesta .product-remove a {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--color-grey-text);
    text-decoration: none;
}

.doro-cesta .product-remove a:hover {
    background: #fdecea;
    color: var(--color-red-accent);
}

.doro-cesta .quantity .qty {
    width: 52px;
    height: 36px;
    text-align: center;
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
}

.doro-cesta .coupon {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.doro-cesta .coupon .input-text {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--color-grey-border);
    border-radius: 999px;
    font-family: inherit;
}

.doro-cesta .actions .button {
    height: 40px;
    padding: 0 16px;
    border: none;
    border-radius: 999px;
    background: var(--color-dark);
    color: var(--color-white);
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

@media (max-width: 960px) {
    .doro-cesta__grid {
        grid-template-columns: 1fr;
    }

    .doro-cesta__aside {
        position: static;
    }

    .doro-cesta-recs__grid.products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .doro-cesta__main {
        padding: var(--spacing-md);
    }

    .doro-cesta .shop_table thead {
        display: none;
    }

    .doro-cesta .shop_table,
    .doro-cesta .shop_table tbody,
    .doro-cesta .shop_table tr,
    .doro-cesta .shop_table td {
        display: block;
        width: 100%;
    }

    .doro-cesta-recs__grid.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* —— Checkout AliExpress —— */
.woocommerce-checkout .doro-page__title,
.woocommerce-checkout .entry-title:not(.doro-checkout-card__title) {
    display: none !important;
}

.woocommerce-checkout .woocommerce {
    display: block;
    width: 100%;
}

.doro-checkout-form {
    width: 100%;
}

.doro-checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: var(--spacing-lg);
    align-items: start;
}

.doro-checkout-main {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    min-width: 0;
}

.doro-checkout-aside {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    position: sticky;
    top: 80px;
}

.doro-checkout-card {
    background: var(--color-white);
    border-radius: 12px;
    padding: var(--spacing-lg);
}

.doro-checkout-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.doro-checkout-card__title {
    margin: 0 0 var(--spacing-md);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-dark);
}

.doro-checkout-card__head .doro-checkout-card__title {
    margin: 0;
}

.doro-checkout-card__link {
    border: none;
    background: transparent;
    color: #2e6bff;
    font-weight: 700;
    font-size: var(--font-size-sm);
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.doro-checkout-card__link:hover {
    text-decoration: underline;
}

.doro-checkout-address__empty {
    margin: 0;
    color: var(--color-grey-text);
    font-size: var(--font-size-sm);
}

.doro-checkout-address__card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--color-grey-border);
    border-radius: 10px;
    background: #fafafa;
    font-size: var(--font-size-sm);
}

.doro-checkout-address__card strong {
    font-size: var(--font-size-base);
}

/* Payment list */
.doro-checkout-payment {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.doro-checkout-payment ul.payment_methods {
    list-style: none;
    margin: 0;
    padding: 0;
    border: none;
}

.doro-checkout-payment ul.payment_methods li {
    margin: 0 0 10px;
    padding: 14px 16px;
    border: 1px solid var(--color-grey-border) !important;
    border-radius: 10px;
    background: var(--color-white);
}

.doro-checkout-payment ul.payment_methods li:last-child {
    margin-bottom: 0;
}

.doro-checkout-payment ul.payment_methods label {
    font-weight: 600;
    cursor: pointer;
}

.doro-checkout-payment .payment_box {
    margin-top: 10px;
    padding: 12px;
    background: #f7f7f7;
    border-radius: 8px;
    font-size: var(--font-size-sm);
    color: var(--color-grey-text);
}

/* Products in checkout */
.doro-checkout-products {
    width: 100%;
    border-collapse: collapse;
}

.doro-checkout-products td {
    padding: 12px 0;
    border-bottom: 1px solid var(--color-grey-border);
    vertical-align: middle;
}

.doro-checkout-products tr:last-child td {
    border-bottom: none;
}

.doro-checkout-products .product-thumbnail img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: var(--color-grey-bg);
    border-radius: 8px;
}

.doro-checkout-products .product-name {
    padding-left: 12px;
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.doro-checkout-products .product-total {
    text-align: right;
    font-weight: 700;
    white-space: nowrap;
}

/* Summary sidebar */
.doro-checkout-summary {
    background: var(--color-white);
    border-radius: 12px;
    padding: var(--spacing-lg);
}

.doro-checkout-summary__title {
    margin: 0 0 var(--spacing-lg);
    font-size: 18px;
    font-weight: 700;
}

.doro-checkout-summary__row,
.doro-checkout-summary .woocommerce-shipping-totals td,
.doro-checkout-summary .woocommerce-shipping-totals th {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    font-size: var(--font-size-sm);
    border: none;
}

.doro-checkout-summary table {
    width: 100%;
}

.doro-checkout-summary__tax-note {
    margin: 8px 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #eaf8ef;
    color: #1f7a3f;
    font-size: 12px;
    font-weight: 600;
}

.doro-checkout-summary__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 12px 0 16px;
    border-top: 1px solid var(--color-grey-border);
    font-size: var(--font-size-base);
}

.doro-checkout-summary__total strong {
    font-size: 24px;
    font-weight: 700;
}

.doro-checkout-summary__cta,
#place_order.doro-checkout-summary__cta {
    display: flex !important;
    width: 100%;
    height: 48px;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    background: var(--color-red-accent) !important;
    color: var(--color-white) !important;
    font-weight: 700;
    font-size: var(--font-size-base);
    font-family: inherit;
    cursor: pointer;
}

.doro-checkout-summary__cta:hover {
    opacity: 0.92;
}

.doro-checkout-summary__legal {
    margin: 12px 0 0;
    font-size: 11px;
    color: var(--color-grey-text);
    line-height: 1.4;
}

.doro-checkout-summary .woocommerce-terms-and-conditions-wrapper {
    margin-bottom: 12px;
    font-size: 12px;
}

/* Modal dirección */
body.doro-modal-open {
    overflow: hidden;
}

.doro-modal {
    position: fixed;
    inset: 0;
    z-index: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

.doro-modal[hidden] {
    display: none !important;
}

.doro-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.doro-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: min(90vh, 720px);
    overflow: hidden;
    background: var(--color-white);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
}

.doro-modal__header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: var(--spacing-lg) var(--spacing-xl) var(--spacing-md);
    flex: 0 0 auto;
}

.doro-modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

.doro-modal__close {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    color: var(--color-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.doro-modal__close:hover {
    background: var(--color-grey-bg);
}

.doro-modal__body {
    padding: 0 var(--spacing-xl) var(--spacing-md);
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.doro-modal__fields {
    display: block;
    width: 100%;
}

/* Por si algun plugin reinyecta notas / envio dentro del modal. */
.doro-modal__body .woocommerce-shipping-fields,
.doro-modal__body .woocommerce-additional-fields,
.doro-modal__body .woocommerce-shipping-fields-wrapper {
    display: none !important;
}

.doro-modal__body .woocommerce-billing-fields > h3 {
    font-size: 14px;
    margin: 0 0 12px;
}

.doro-modal__body .woocommerce-billing-fields__field-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    width: 100%;
}

.doro-modal__body .form-row,
.doro-modal__body p.form-row {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
    float: none !important;
    clear: none !important;
    box-sizing: border-box;
}

.doro-modal__body .form-row-wide,
.doro-modal__body .address-field.form-row-wide,
.doro-modal__body #billing_country_field,
.doro-modal__body #billing_address_1_field,
.doro-modal__body #billing_address_2_field,
.doro-modal__body #billing_phone_field,
.doro-modal__body #billing_email_field,
.doro-modal__body #billing_company_field {
    grid-column: 1 / -1;
}

.doro-modal__body .form-row-first,
.doro-modal__body .form-row-last {
    width: 100% !important;
    float: none !important;
}

.doro-modal__body::after {
    content: "";
    display: table;
    clear: both;
}

.doro-modal__body label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
}

.doro-modal__body .input-text,
.doro-modal__body select,
.doro-modal__body textarea,
.doro-modal__body .select2-selection--single,
.doro-modal__body .select2-container {
    width: 100% !important;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--color-grey-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: var(--font-size-base);
    box-sizing: border-box;
}

.doro-modal__body .select2-container .select2-selection--single {
    height: 44px;
    display: flex;
    align-items: center;
}

.doro-modal__body .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 44px;
    padding-left: 0;
}

.doro-modal__body .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px;
}

.doro-modal__footer {
    display: flex;
    gap: 10px;
    padding: var(--spacing-md) var(--spacing-xl) var(--spacing-lg);
    flex-wrap: wrap;
    flex: 0 0 auto;
    border-top: 1px solid var(--color-grey-border);
    background: var(--color-white);
}

.doro-modal__btn {
    height: 44px;
    padding: 0 22px;
    border-radius: 999px;
    font-weight: 700;
    font-family: inherit;
    font-size: var(--font-size-base);
    cursor: pointer;
}

.doro-modal__btn--primary {
    border: none;
    background: var(--color-red-accent);
    color: var(--color-white);
}

.doro-modal__btn--ghost {
    border: 1px solid var(--color-grey-border);
    background: var(--color-white);
    color: var(--color-dark);
}

/* Pagina Gracias / pedido recibido */
.doro-thankyou {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg) var(--spacing-2xl);
}

.doro-thankyou__card {
    background: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: 16px;
    padding: 36px 28px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.doro-thankyou__card--error {
    border-color: #f5c2c0;
    background: #fff8f8;
}

.doro-thankyou__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: #e8f8ef;
    color: #1e8e4f;
}

.doro-thankyou__title {
    margin: 0 0 10px;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.doro-thankyou__text {
    margin: 0 auto 22px;
    max-width: 42ch;
    color: var(--color-grey-text);
    line-height: 1.5;
}

.doro-thankyou__meta {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    text-align: left;
}

.doro-thankyou__meta li {
    background: #fafafa;
    border: 1px solid var(--color-grey-border);
    border-radius: 10px;
    padding: 12px 14px;
}

.doro-thankyou__meta span {
    display: block;
    font-size: 12px;
    color: var(--color-grey-text);
    margin-bottom: 4px;
}

.doro-thankyou__meta strong {
    font-size: 14px;
    color: var(--color-dark);
}

.doro-thankyou__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.doro-thankyou__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
}

.doro-thankyou__btn--primary {
    background: var(--color-orange);
    color: #fff;
}

.doro-thankyou__btn--secondary {
    background: var(--color-dark);
    color: #fff;
}

.doro-thankyou__btn--ghost {
    border: 1px solid var(--color-grey-border);
    background: #fff;
    color: var(--color-dark);
}

.doro-thankyou__details {
    margin-top: var(--spacing-xl);
}

.woocommerce-order-received .doro-page__header {
    display: none;
}

@media (max-width: 560px) {
    .doro-thankyou__meta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .doro-checkout-layout {
        grid-template-columns: 1fr;
    }

    .doro-checkout-aside {
        position: static;
    }
}

@media (max-width: 560px) {
    .doro-modal__body .woocommerce-billing-fields__field-wrapper {
        grid-template-columns: 1fr;
    }

    .doro-modal {
        padding: var(--spacing-md);
    }

    .doro-modal__dialog {
        max-height: 92vh;
    }
}

