/**
 * Botón contador (plato) + offcanvas carrito (slide-in-right).
 */

body.improved-woo-cart-drawer-open {
    overflow: hidden;
}

/* ——— Trigger: rectángulo con imagen plato ——— */
.improved-woo-cart-drawer-root{
    display: inline-block;
    text-align: initial;
}


.improved-woo-cart-drawer-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-width: 56px;
    min-height: 44px;
    padding: 6px 12px;
    box-sizing: border-box;
    border: none !important;
    cursor: pointer;
    font-family: inherit;
    background-color: transparent !important;
    background-image: none;
    font-weight: 600;
    font-size: 0.7rem;
    line-height: 1;
    color: #1a1a1a;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.9);
}

.improved-woo-cart-drawer-trigger::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: url("images/plato.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.22s ease;
}

.improved-woo-cart-drawer-trigger:hover::before {
    transform: scale(1.08);
}

.improved-woo-cart-drawer-trigger:hover,
.improved-woo-cart-drawer-trigger:focus {
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    color: #1a1a1a !important;
}

.improved-woo-cart-drawer-count {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

/* ——— Panel offcanvas ——— */
.improved-woo-cart-drawer-panel {
    position: fixed;
    inset: 0;
    z-index: 100000;
    pointer-events: none;
}

.improved-woo-cart-drawer-panel.is-open {
    pointer-events: auto;
}

.improved-woo-cart-drawer-panel[hidden] {
    display: none !important;
}

.improved-woo-cart-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.improved-woo-cart-drawer-panel.is-open .improved-woo-cart-drawer-backdrop {
    opacity: 1;
}

.improved-woo-cart-drawer-sheet {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 100vw);
    max-width: 100%;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.improved-woo-cart-drawer-panel.is-open .improved-woo-cart-drawer-sheet {
    transform: translateX(0);
}

.improved-woo-cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.improved-woo-cart-drawer-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
}

.improved-woo-cart-drawer-close {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    font-size: 1.75rem !important;
    line-height: 1 !important;
    cursor: pointer !important;
    color: #1a1a1a !important;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.improved-woo-cart-drawer-close:hover {
    background: #f0f0f0;
}

.improved-woo-cart-drawer-items {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 16px 16px;
    -webkit-overflow-scrolling: touch;
}

.improved-woo-cart-drawer-footer {
    flex-shrink: 0;
    background: #fff;
    padding: 16px 18px calc(16px + env(safe-area-inset-bottom, 0));
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}

.improved-woo-cart-drawer-checkout-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 20px;
    border-radius: 999px;
    color: #1a1a1a;
}

.improved-woo-cart-drawer-checkout-label-text {
    font-size: 1rem;
    font-weight: 500;
    color: #6d695d;
}

.improved-woo-cart-drawer-checkout-label-total {
    margin-left: auto;
    font-size: 1.2rem;
    font-weight: 700;
    white-space: nowrap;
}

.improved-woo-cart-drawer-next-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 20px !important;
    text-align: left;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none !important;
    color: #fff;
    background: #1a1a1a !important;
    border: none !important;
    border-radius: 999px !important;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.improved-woo-cart-drawer-next-btn-total {
    margin-left: auto;
    font-weight: 700;
    white-space: nowrap;
}

.improved-woo-cart-drawer-next-btn-previous-total {
    color: #b0b0b0;
    text-decoration: line-through;
    font-size: 0.9rem;
    white-space: nowrap;
}

.improved-woo-cart-drawer-next-btn-previous-total.is-hidden {
    display: none;
}

.improved-woo-cart-drawer-next-btn:hover {
    background: #333 !important;
    color: #fff !important;
    text-decoration: none;
}

.improved-woo-cart-drawer-next-btn:focus {
    outline: 2px solid #1a1a1a !important;
    outline-offset: 2px !important;
}

.improved-woo-cart-drawer-next-btn:disabled {
    opacity: 0.45 !important;
    cursor: not-allowed;
}

body.improved-woo-delivery-modal-open {
    overflow: hidden;
}

/* ——— Modal entrega ——— */
.improved-woo-delivery-modal {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

.improved-woo-delivery-modal[hidden] {
    display: none !important;
}

.improved-woo-delivery-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.improved-woo-delivery-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: min(90vh, 640px);
    margin: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    min-height: 220px;
    animation: improved-woo-delivery-slide-up 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 480px) {
    .improved-woo-delivery-modal {
        align-items: center;
        padding: 20px;
    }

    .improved-woo-delivery-modal-dialog {
        border-radius: 20px;
        max-height: min(85vh, 560px);
    }
}

@keyframes improved-woo-delivery-slide-up {
    from {
        transform: translateY(100%);
        opacity: 0.85;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.improved-woo-delivery-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.improved-woo-delivery-modal-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.improved-woo-delivery-modal-close {
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: #1a1a1a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.improved-woo-delivery-modal-close:hover {
    background: #f0f0f0;
}

.improved-woo-delivery-modal-body {
    /* No usar flex:1 aquí: con altura automática del diálogo el ítem puede colapsar a 0px en columna flex. */
    flex: 0 1 auto;
    min-height: min(40vh, 280px);
    overflow-y: auto;
    padding: 14px 18px;
    -webkit-overflow-scrolling: touch;
}

.improved-woo-delivery-hint {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: #555;
}

.improved-woo-delivery-selected-day {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 10px;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: #f3f3f3;
    color: #1a1a1a;
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.2;
}

.improved-woo-delivery-view-slots-btn {
    cursor: pointer;
    margin-top: 6px;
}

.improved-woo-delivery-view-slots-btn[hidden] {
    display: none !important;
}

.improved-woo-delivery-day-list,
.improved-woo-delivery-slot-list {
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.improved-woo-delivery-day-list button,
.improved-woo-delivery-slot-list button {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    text-align: left;
    font-family: inherit;
    font-size: 0.95rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    background: #fafafa;
    cursor: pointer;
    color: #1a1a1a;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.improved-woo-delivery-day-list button:hover,
.improved-woo-delivery-slot-list button:hover {
    background: #dcdcdc;
    border-color: rgba(0, 0, 0, 0.2);
}

.improved-woo-delivery-day-list button.is-selected,
.improved-woo-delivery-slot-list button.is-selected {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #fff;
}

.improved-woo-delivery-day-list button:hover::before,
.improved-woo-delivery-slot-list button:hover::before,
.improved-woo-delivery-day-list button.is-selected::before,
.improved-woo-delivery-slot-list button.is-selected::before {
    content: "\203A";
    display: inline-block;
    margin-right: 0.35rem;
    font-size: 1.05em;
    font-weight: 600;
    line-height: 1;
}

.improved-woo-delivery-no-days {
    margin: 0 0 14px;
    font-size: 0.9rem;
    color: #666;
}

.improved-woo-delivery-checkout-fallback {
    display: inline-block;
    margin-top: 4px;
    padding: 12px 20px;
    font-weight: 600;
    text-decoration: none !important;
    color: #fff !important;
    background: #1a1a1a;
    border-radius: 999px;
}

.improved-woo-delivery-checkout-fallback:hover {
    background: #333;
    color: #fff !important;
}

.improved-woo-delivery-checkout-fallback[hidden] {
    display: none !important;
}

.improved-woo-delivery-nav-btn,
.improved-woo-delivery-nav-btn:focus {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 14px 10px 10px;
    font-family: inherit;
    font-size: 0.9rem;
    border: none;
    background: transparent;
    color: #6d695d;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.improved-woo-delivery-nav-label {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.improved-woo-delivery-back-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 0;
    transition: transform 0.22s ease, margin 0.22s ease;
}

.improved-woo-delivery-forward-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 0;
    transition: transform 0.22s ease, margin 0.22s ease;
}

.improved-woo-delivery-nav-nav-icon svg {
    display: block;
}

.improved-woo-delivery-nav-btn:hover,
.improved-woo-delivery-nav-btn:focus-visible {
    background: transparent !important;
    color: #6d695d;
    box-shadow: none !important;
}

.improved-woo-delivery-back-btn:hover .improved-woo-delivery-back-btn-icon,
.improved-woo-delivery-back-btn:focus-visible .improved-woo-delivery-back-btn-icon {
    transform: translateX(-5px);
}

.improved-woo-delivery-forward-btn:hover .improved-woo-delivery-forward-btn-icon,
.improved-woo-delivery-forward-btn:focus-visible .improved-woo-delivery-forward-btn-icon {
    transform: translateX(5px);
}

.improved-woo-delivery-modal-footer {
    flex-shrink: 0;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0));
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.improved-woo-delivery-continue-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 20px;
    text-align: center;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #1a1a1a;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.improved-woo-delivery-continue-btn:hover:not(:disabled) {
    background: #333;
}

.improved-woo-delivery-continue-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.improved-woo-cart-drawer-items-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.improved-woo-cart-drawer-slot {
    width: 100%;
}

.improved-woo-cart-drawer-empty {
    margin: 2rem 0;
    text-align: center;
    color: #666;
    font-size: 0.95rem;
}

.improved-woo-cart-drawer-min-order-alert,
.improved-woo-cart-drawer-min-order-feedback {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #f1aeb5;
    background: #f8d7da;
    color: #842029;
    font-size: 0.88rem;
    line-height: 1.35;
}

.improved-woo-cart-drawer-min-order-feedback {
    margin: 10px 0 0;
}

/* ——— Card línea carrito: 1/3 imagen, 2/3 texto + controles ——— */
.improved-woo-cart-drawer-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 18px;
    padding: 0px;
    background: #ebe9e4;
    border-radius: 25px;
}

.improved-woo-cart-drawer-card-media {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    align-self: flex-start;
    position: relative;
}

.improved-woo-cart-drawer-card-media .improved-woo-badge {
    position: absolute;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 16px;
    z-index: 3;
    pointer-events: none;
}

.improved-woo-cart-drawer-card-media .improved-woo-badge-sale {
    top: 8px;
    right: 8px;
    left: auto;
    background: #c62828;
    color: #fff;
}

.improved-woo-cart-drawer-card-image-link {
    display: block;
    border-radius: 25px 0 0 25px;
    overflow: hidden;
    background: #f5f5f5;
}

.improved-woo-cart-drawer-card-media img,
.improved-woo-cart-drawer-thumb-img {
    width: 100%;
    height: auto;
    display: block;
    vertical-align: middle;
    object-fit: cover;
    aspect-ratio: 1;
}

.improved-woo-cart-drawer-item-price-tag {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 2;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: rgba(26, 26, 26, 0.9);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.improved-woo-cart-drawer-item-price-tag__regular {
    text-decoration: line-through;
    opacity: 0.72;
    font-weight: 500;
}

.improved-woo-cart-drawer-item-price-tag__current {
    font-weight: 700;
}

.improved-woo-cart-drawer-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    gap: 8px;
}

.improved-woo-cart-drawer-card-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.3;
    text-align: left;
    align-self: flex-start;
    padding: 10px !important;
    color: #6d695d !important;
}

.improved-woo-cart-drawer-card-controls {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    width: 100%;
    align-content: center;
    flex-direction: row;
    flex-wrap: nowrap;
}

.improved-woo-cart-drawer-card-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    color: #6d695d;
    padding: 0.5rem 1.3rem 0.5rem;
}

.improved-woo-cart-drawer-item-subtotal {
    font-size: 1rem;
    font-weight: 600;
    color: #4c4a42;
    min-width: 0;
    white-space: nowrap;
}


/* Mismo estilo de botones +/- que en el loop: footer oscuro compacto */
.improved-woo-cart-drawer-qty-footer.improved-woo-card-footer {
    padding: 8px 10px;
    border-radius: 999px;
    width: auto;
    min-height: 0;
    display: inline-flex;
    justify-content: flex-end;
    background-color: transparent;
    margin-left: auto;
}

.improved-woo-cart-drawer-qty-footer .improved-woo-qty-btn {
    background-color: #6d695d !important;
    color: #fff !important;
    width: 35px;
    height: 35px;
    min-width: 35px;
    min-height: 35px;
    font-size: 18px;
    border-radius: 50% !important;
    border: none !important;
}

.improved-woo-cart-drawer-qty-footer .improved-woo-qty-btn:hover {
    background-color: #333 !important;
    color: #fff;    
}
.improved-woo-cart-drawer-qty-footer .improved-woo-qty-display{
    color: #6d695d !important;
}

/* Checkout page: quantity controls are read-only in drawer. */
.woocommerce-checkout .improved-woo-cart-drawer-qty-footer {
    display: none !important;
}

.woocommerce-checkout .improved-woo-cart-drawer-qty-display {
    font-size: 1.08rem;
    font-weight: 600;
}

.improved-woo-cart-drawer-qty-footer .improved-woo-card-footer-controls {
    margin-left: 0;
}

.improved-woo-cart-drawer-order-details {
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    background: #f8f7f4;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.improved-woo-cart-drawer-order-details-title {
    margin: 0 0 4px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #4c4a42;
}

.improved-woo-cart-drawer-order-details-row {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    align-items: flex-start;
}
.improved-woo-cart-drawer-order-details-row.improved-woo-cart-drawer-order-details-row--shipping_address {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 12px;
}

.improved-woo-cart-drawer-order-details-label {
    font-size: 0.8rem;
    color: #7d796d;
    flex: 0 0 auto;
}

.improved-woo-cart-drawer-order-details-value {
    text-align: right;
    font-size: 0.84rem;
    color: #4c4a42;
    min-width: 0;
}

.improved-woo-cart-drawer-coupon-line {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.improved-woo-cart-drawer-coupon-label {
    color: #7d796d;
}

.improved-woo-cart-drawer-coupon-value {
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
}

.improved-woo-cart-drawer-coupon-tag {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    padding: 10px 12px 10px 25px;
    border-radius: 25px;
    border: 1px solid rgb(125, 190, 151);
    background: #daefe0;
    color: #186536;
}

.improved-woo-cart-drawer-coupon-tag__text {
    display: flex;
    gap: 10px;
    min-width: 0;
    align-items: center;
}

.improved-woo-cart-drawer-coupon-tag__label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-align: left;
}

.improved-woo-cart-drawer-coupon-tag__value {
    font-size: 0.9rem;
    font-weight: 600;
    word-break: break-word;
}

.improved-woo-cart-drawer-coupon-tag__remove {
    width: 1.4rem !important;
    height: 1.4rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #548867 !important;
    color: #bfe6d7 !important;
    font-size: 1rem;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 0 !important;
    flex: 0 0 auto;
}

.improved-woo-cart-drawer-coupon-tag__remove:hover {
    background: #1a1a1a;
    color: #fff;
}

@media (max-width: 420px) {
    .improved-woo-cart-drawer-panel {
        width: 95vw;
        right: 0;
        left: auto;
        margin-left: auto;
    }
    .improved-woo-cart-drawer-card-controls {
        align-items: stretch;
        gap: 8px;
    }

    .improved-woo-cart-drawer-item-subtotal {
        white-space: normal;
    }

    .improved-woo-cart-drawer-order-details-row {
        flex-direction: column;
        gap: 2px;
    }

    .improved-woo-cart-drawer-order-details-value {
        text-align: left;
    }
}
