html.wcsimple-lock,
body.wcsimple-lock {
    overflow: hidden !important;
}

.wcsimple {
    --wcsimple-green: #5f8f2f;
    --wcsimple-green-dark: #4f7c26;
    --wcsimple-text: #20231f;
    --wcsimple-muted: #71766f;
    --wcsimple-border: #e7e9e5;
    --wcsimple-soft: #f6f7f4;
    --wcsimple-drawer-width: 430px;
    position: fixed;
    inset: 0;
    z-index: 999999;
    pointer-events: none;
    visibility: hidden;
}

.wcsimple.is-open {
    pointer-events: auto;
    visibility: visible;
}

.wcsimple__overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 24, 18, .34);
    opacity: 0;
    transition: opacity .22s ease;
}

.wcsimple.is-open .wcsimple__overlay {
    opacity: 1;
}

.wcsimple__drawer {
    position: absolute;
    top: 0;
    right: 0;
    width: min(var(--wcsimple-drawer-width), calc(100vw - 24px));
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: -14px 0 42px rgba(0, 0, 0, .14);
    transform: translateX(102%);
    transition: transform .25s ease;
    outline: none;
}

.wcsimple.is-open .wcsimple__drawer {
    transform: translateX(0);
}

.wcsimple__header {
    min-height: 72px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--wcsimple-border);
    background: #fff;
}

.wcsimple__title {
    margin: 0 !important;
    font-size: 22px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    color: var(--wcsimple-text) !important;
}

.wcsimple__close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--wcsimple-text);
    font-size: 34px;
    line-height: 36px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wcsimple__close:hover,
.wcsimple__close:focus-visible {
    background: var(--wcsimple-soft);
}

.wcsimple__content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.wcsimple.is-loading .wcsimple__content::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.58);
    z-index: 20;
}

.wcsimple.is-loading .wcsimple__content::before {
    content: '';
    position: absolute;
    z-index: 21;
    width: 24px;
    height: 24px;
    border: 3px solid #dfe4db;
    border-top-color: var(--wcsimple-green);
    border-radius: 50%;
    left: 50%;
    top: 50%;
    margin: -12px 0 0 -12px;
    animation: wcsimple-spin .7s linear infinite;
}

@keyframes wcsimple-spin { to { transform: rotate(360deg); } }

.wcsimple-shipping {
    padding: 16px 20px 14px;
    border-bottom: 1px solid var(--wcsimple-border);
    background: #fff;
}

.wcsimple-shipping__track {
    height: 8px;
    background: #e9eee3;
    border-radius: 999px;
    overflow: hidden;
}

.wcsimple-shipping__bar {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--wcsimple-green);
    transition: width .3s ease;
}

.wcsimple-shipping__text {
    margin: 9px 0 0 !important;
    text-align: center;
    color: #3f4938;
    font-size: 13px;
    line-height: 1.4;
}

.wcsimple-shipping.is-complete .wcsimple-shipping__text {
    font-weight: 700;
    color: var(--wcsimple-green-dark);
}

.wcsimple__items {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 20px;
}

.wcsimple-item {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid var(--wcsimple-border);
}

.wcsimple-item__image a,
.wcsimple-item__image {
    display: block;
}

.wcsimple-item__image img {
    width: 88px !important;
    height: 88px !important;
    object-fit: contain;
    display: block;
    background: #fff;
    border: 1px solid #eef0ec;
    border-radius: 8px;
}

.wcsimple-item__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
}

.wcsimple-item__top,
.wcsimple-item__bottom {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.wcsimple-item__bottom {
    align-items: center;
}

.wcsimple-item__name {
    min-width: 0;
    color: var(--wcsimple-text);
    font-size: 14px;
    line-height: 1.35;
    font-weight: 600;
}

.wcsimple-item__name a {
    color: inherit !important;
    text-decoration: none !important;
}

.wcsimple-item__name a:hover {
    text-decoration: underline !important;
}

.wcsimple-item__meta {
    margin-top: 5px;
    color: var(--wcsimple-muted);
    font-size: 12px;
    font-weight: 400;
}

.wcsimple-item__meta dl,
.wcsimple-item__meta p {
    margin: 0 !important;
}

.wcsimple-item__remove {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: #878d84;
    padding: 2px 4px;
    cursor: pointer;
    font-size: 19px;
}

.wcsimple-item__remove:hover {
    color: #b33a3a;
}

.wcsimple-item__price {
    white-space: nowrap;
    font-size: 15px;
    font-weight: 700;
    color: var(--wcsimple-text);
}

.wcsimple-qty {
    display: inline-grid;
    grid-template-columns: 34px 42px 34px;
    height: 36px;
    border: 1px solid #dfe3dc;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.wcsimple-qty__button,
.wcsimple-qty__input {
    appearance: none;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--wcsimple-text) !important;
    box-shadow: none !important;
    min-width: 0;
    height: 34px !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center;
    font-size: 16px;
}

.wcsimple-qty__button {
    cursor: pointer;
    font-size: 20px;
}

.wcsimple-qty__button:hover {
    background: var(--wcsimple-soft) !important;
}

.wcsimple-qty__input {
    width: 42px !important;
    font-size: 14px;
    font-weight: 700;
    -moz-appearance: textfield;
}

.wcsimple-qty__input::-webkit-outer-spin-button,
.wcsimple-qty__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wcsimple__footer {
    flex: 0 0 auto;
    padding: 18px 20px 20px;
    background: #fff;
    border-top: 1px solid var(--wcsimple-border);
    box-shadow: 0 -8px 26px rgba(0,0,0,.035);
}

.wcsimple__total-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    color: var(--wcsimple-text);
    font-size: 14px;
}

.wcsimple__total-row strong {
    font-size: 19px;
}


.wcsimple-cart-totals {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--wcsimple-border);
}

.wcsimple-cart-totals__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 0;
    color: var(--wcsimple-text);
    font-size: 14px;
}

.wcsimple-cart-totals__row strong {
    margin-left: auto;
    text-align: right;
    font-weight: 600;
}

.wcsimple-cart-totals__row--total {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--wcsimple-border);
    font-size: 17px;
    font-weight: 700;
}

.wcsimple-cart-totals__row--total strong {
    color: var(--wcsimple-green-dark);
    font-size: 22px;
}

.wcsimple-cart-totals__tax-note {
    margin-top: 2px;
    text-align: right;
    color: var(--wcsimple-muted);
    font-size: 11px;
    line-height: 1.35;
}

.wcsimple-cart-totals__tax-note span + span::before {
    content: ' · ';
}

.wcsimple__shipping-note {
    margin: 5px 0 15px !important;
    color: var(--wcsimple-muted);
    font-size: 12px;
    line-height: 1.35;
}

.wcsimple__checkout {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    width: 100%;
    border-radius: 8px;
    background: var(--wcsimple-green) !important;
    color: #fff !important;
    text-decoration: none !important;
    text-transform: none !important;
    font-size: 15px;
    font-weight: 700;
    transition: background .15s ease, transform .15s ease;
}

.wcsimple__checkout:hover {
    background: var(--wcsimple-green-dark) !important;
}

.wcsimple__checkout:active {
    transform: translateY(1px);
}

.wcsimple__view-cart {
    display: block;
    margin-top: 11px;
    text-align: center;
    color: #4a5047 !important;
    text-decoration: underline !important;
    font-size: 13px;
}

.wcsimple__empty {
    margin: auto;
    padding: 40px 24px;
    text-align: center;
    color: var(--wcsimple-text);
}

.wcsimple__empty-icon {
    font-size: 42px;
    margin-bottom: 12px;
    filter: grayscale(1);
    opacity: .55;
}

.wcsimple__empty p {
    margin: 0 0 18px !important;
}

.wcsimple__continue {
    border: 1px solid #d9ddd5;
    border-radius: 8px;
    background: #fff;
    color: var(--wcsimple-text);
    padding: 11px 18px;
    cursor: pointer;
    font-weight: 600;
}

.wcsimple-open-cart {
    cursor: pointer;
}

.wcsimple-button-count {
    display: inline-flex;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    margin-left: 6px;
    font-size: 11px;
    line-height: 1;
}

@media (max-width: 600px) {
    .wcsimple__drawer {
        width: calc(100vw - 18px);
    }

    .wcsimple__header {
        min-height: 66px;
        padding: 14px 16px;
    }

    .wcsimple__title {
        font-size: 20px !important;
    }

    .wcsimple-shipping {
        padding: 14px 16px 12px;
    }

    .wcsimple__items {
        padding: 0 16px;
    }

    .wcsimple-item {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 12px;
        padding: 15px 0;
    }

    .wcsimple-item__image img {
        width: 76px !important;
        height: 76px !important;
    }

    .wcsimple__footer {
        padding: 15px 16px calc(16px + env(safe-area-inset-bottom));
    }
}

@media (prefers-reduced-motion: reduce) {
    .wcsimple__overlay,
    .wcsimple__drawer,
    .wcsimple-shipping__bar,
    .wcsimple__checkout {
        transition: none !important;
    }
}


/* v0.5.0: cupones en carrito lateral */
.wcsimple-cart-coupon { margin: 0 0 14px; }
.wcsimple-cart-coupon__toggle {
    width: 100%; min-height: 38px; display: flex; align-items: center; gap: 7px; justify-content: flex-start;
    padding: 8px 10px; border: 1px solid var(--wcsimple-border); border-radius: 8px; background: #fff;
    color: var(--wcsimple-text); font-size: 13px; font-weight: 600; cursor: pointer;
}
.wcsimple-cart-coupon__panel { margin-top: 8px; }
.wcsimple-cart-coupon__row { display: grid; grid-template-columns: minmax(0,1fr) auto; border: 1px solid var(--wcsimple-border); border-radius: 8px; overflow: hidden; }
.wcsimple-cart-coupon__row input { min-width: 0; width: 100%; min-height: 40px; margin: 0 !important; padding: 8px 10px !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.wcsimple-cart-coupon__row button { min-height: 40px; padding: 8px 12px; border: 0; border-left: 1px solid var(--wcsimple-border); background: var(--wcsimple-soft); color: #687067; font-weight: 600; cursor: pointer; }
.wcsimple-cart-coupon__row button:hover { background: #ecefe9; color: var(--wcsimple-text); }
.wcsimple-cart-coupon__message { margin-top: 6px; font-size: 12px; }
.wcsimple-cart-coupon__message.is-error { color: #b33a3a; }
.wcsimple-cart-coupon__applied { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wcsimple-cart-coupon__chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; background: var(--wcsimple-soft); font-size: 12px; font-weight: 600; }
.wcsimple-cart-coupon__chip button { border: 0; background: transparent; color: #777; padding: 0; font-size: 16px; line-height: 1; cursor: pointer; }

/* v0.5.1: modos de cupón del drawer */
.wcsimple-cart-coupon--enabled .wcsimple-cart-coupon__panel { margin-top: 0; }


/* v0.6.1: acciones secundarias del drawer (descuento + WhatsApp) */
.wcsimple-cart-actions {
    margin: 0 0 14px;
}
.wcsimple-cart-actions__buttons {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}
.wcsimple-cart-actions__buttons .wcsimple-cart-coupon__toggle {
    flex: 1 1 auto;
    width: auto;
}
.wcsimple-cart-actions .wcsimple-cart-coupon {
    margin: 0;
}
.wcsimple-cart-actions .wcsimple-cart-coupon__panel {
    margin-top: 8px;
}
.wcsimple-whatsapp-action {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--wcsimple-border);
    border-radius: 8px;
    background: #fff;
    color: #3b6f48 !important;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}
.wcsimple-whatsapp-action:hover {
    background: var(--wcsimple-soft);
    color: #285c36 !important;
}
.wcsimple-whatsapp-action__icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
}
.wcsimple-whatsapp-action__icon svg {
    width: 18px;
    height: 18px;
    display: block;
}


/* ==========================================================
 * v0.6.2 — Cupón + WhatsApp en una única fila
 * ========================================================== */
.wcsimple-cart-actions__collapsed {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}
.wcsimple-cart-actions.is-coupon-open .wcsimple-cart-actions__collapsed {
    display: none;
}
.wcsimple-cart-actions__collapsed .wcsimple-cart-coupon__toggle {
    flex: 1 1 auto;
    width: auto;
}
.wcsimple-cart-coupon__row {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto auto;
    gap: 0;
    min-height: 42px;
    border: 1px solid var(--wcsimple-border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.wcsimple-cart-coupon__row input,
.wcsimple-cart-coupon__row > button,
.wcsimple-cart-coupon__row > .wcsimple-whatsapp-action {
    height: 42px;
    min-height: 42px;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.wcsimple-cart-coupon__row input {
    min-width: 0;
    width: 100%;
    padding: 0 10px !important;
    border: 0 !important;
}
.wcsimple-cart-coupon__row > button {
    padding: 0 11px;
    border: 0;
    border-left: 1px solid var(--wcsimple-border);
    background: var(--wcsimple-soft);
    color: #687067;
}
.wcsimple-cart-coupon__row > .wcsimple-whatsapp-action {
    padding: 0 10px;
    border: 0;
    border-left: 1px solid var(--wcsimple-border);
    background: #fff;
    white-space: nowrap;
}


/* ==========================================================
 * v0.6.3 — Cupón y WhatsApp separados, altura fija
 * ========================================================== */
.wcsimple-cart-coupon__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    width: 100%;
    height: 42px;
    min-height: 42px;
    max-height: 42px;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    align-items: stretch;
}

.wcsimple-cart-coupon__row input,
.wcsimple-cart-coupon__row > button,
.wcsimple-cart-coupon__row > .wcsimple-whatsapp-action {
    box-sizing: border-box;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    margin: 0 !important;
    line-height: 40px !important;
    border-radius: 8px !important;
    vertical-align: top;
}

.wcsimple-cart-coupon__row input {
    min-width: 0;
    width: 100%;
    padding: 0 10px !important;
    border: 1px solid var(--wcsimple-border) !important;
    background: #fff !important;
}

.wcsimple-cart-coupon__row > button {
    padding: 0 12px;
    border: 1px solid var(--wcsimple-border) !important;
    background: var(--wcsimple-soft) !important;
    color: #687067 !important;
}

.wcsimple-cart-coupon__row > .wcsimple-whatsapp-action {
    padding: 0 12px;
    border: 1px solid #2f7d4a !important;
    background: #2f7d4a !important;
    color: #fff !important;
    white-space: nowrap;
    text-decoration: none !important;
}

.wcsimple-cart-coupon__row > .wcsimple-whatsapp-action:hover {
    border-color: #25683d !important;
    background: #25683d !important;
    color: #fff !important;
}

.wcsimple-cart-coupon__row > .wcsimple-whatsapp-action .wcsimple-whatsapp-action__icon,
.wcsimple-cart-coupon__row > .wcsimple-whatsapp-action .wcsimple-whatsapp-action__text {
    color: #fff !important;
}

/* Evita el pequeño hueco/línea que podían introducir estilos heredados del tema. */
.wcsimple-cart-coupon__panel,
.wcsimple-cart-coupon__row,
.wcsimple-cart-coupon__row * {
    box-sizing: border-box;
}

@media (max-width: 420px) {
    .wcsimple-cart-coupon__row {
        gap: 6px;
    }

    .wcsimple-cart-coupon__row > button,
    .wcsimple-cart-coupon__row > .wcsimple-whatsapp-action {
        padding-left: 9px;
        padding-right: 9px;
    }
}
