/* ============================================
   Custom Cart Overlay v2.1
   100% SCOPED — zero global selectors
   ============================================ */

/* ---- Navbar Button: blob + basket ---- */
.cco-navbar-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.cco-navbar-btn-wrap {
    position: relative;
    width: 70px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cco-navbar-btn:hover .cco-navbar-btn-wrap {
    transform: scale(1.08);
}

.cco-navbar-btn:active .cco-navbar-btn-wrap {
    transform: scale(0.95);
}

.cco-navbar-blob {
    position: absolute;
    inset: 0;
    width: 70px;
    height: 68px;
    display: block;
}

.cco-navbar-basket {
    position: relative;
    z-index: 1;
    width: 32px;
    height: 32px;
    display: block;
}

.cco-navbar-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border-radius: 11px;
    background: #1A7132;
    color: #FFFFFF;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 12px;
    line-height: 22px;
    text-align: center;
    pointer-events: none;
    box-sizing: border-box;
    z-index: 2;
}

.cco-navbar-badge:empty { display: none; }

/* ---- Backdrop ---- */
.cco-overlay-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.cco-overlay-backdrop.cco-active { opacity: 1; visibility: visible; }

/* ---- Overlay ---- */
.cco-overlay {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1000000;
    width: 566px;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 16px;
    box-sizing: border-box;
    pointer-events: none;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.cco-overlay.cco-active {
    pointer-events: auto;
    transform: translateX(0);
    opacity: 1;
}

/* all:initial kills ALL inherited Astra/Elementor styles */
.cco-overlay-inner {
    all: initial;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    background: #FFFFFF;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.08);
    font-family: 'League Spartan', sans-serif;
    color: #45635E;
    line-height: 1.47;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

/* Re-enable inheritance for all children after the reset */
.cco-overlay-inner *,
.cco-overlay-inner *::before,
.cco-overlay-inner *::after {
    box-sizing: border-box;
}

/* ---- Top ---- */
.cco-top {
    display: flex;
    flex-direction: column;
    padding: 38px 38px 32px;
    gap: 40px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.cco-top::-webkit-scrollbar { width: 4px; }
.cco-top::-webkit-scrollbar-track { background: transparent; }
.cco-top::-webkit-scrollbar-thumb { background: #BECCC1; border-radius: 4px; }

/* ---- Header ---- */
.cco-header-section { display: flex; flex-direction: column; width: 100%; }

.cco-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.cco-title {
    font-family: 'League Spartan', sans-serif;
    font-weight: 400;
    font-size: 42px;
    line-height: 147%;
    color: #45635E;
    margin: 0;
    padding: 0;
}

/* ---- Close Button: Figma SVG, hardened against Astra/Elementor ---- */
.cco-close-btn,
button.cco-close-btn,
.cco-overlay button.cco-close-btn {
    width: 79px !important;
    height: 77px !important;
    min-width: 79px !important;
    min-height: 77px !important;
    border: none !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    transition: transform 0.2s ease !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    border-radius: 0 !important;
}

.cco-close-btn:hover,
button.cco-close-btn:hover { transform: scale(1.08) !important; background: none !important; background-color: transparent !important; border: none !important; box-shadow: none !important; }
.cco-close-btn:active,
button.cco-close-btn:active { transform: scale(0.95) !important; background: none !important; }
.cco-close-btn:focus,
button.cco-close-btn:focus { background: none !important; background-color: transparent !important; border: none !important; box-shadow: none !important; outline: none !important; }

.cco-close-btn img {
    width: 79px !important;
    height: 77px !important;
    display: block !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.cco-units {
    font-family: 'League Spartan', sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 147%;
    color: #45635E;
    margin: 0;
}

/* ---- Items ---- */
.cco-items-list { display: flex; flex-direction: column; gap: 24px; width: 100%; }

.cco-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
    animation: ccoFadeIn 0.3s ease forwards;
}

@keyframes ccoFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cco-product-info { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; }

.cco-item-image {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f5f0;
}

.cco-item-image img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    display: block;
    border-radius: 16px;
}

.cco-product-details { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.cco-product-name {
    font-family: 'League Spartan', sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 147%;
    color: #45635E;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Eliminar: DM Sans 500 14px #1A7132 underline, NOTHING else ---- */
button.cco-remove-btn,
.cco-overlay button.cco-remove-btn {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 147%;
    color: #1A7132;
    text-decoration: underline;
    text-decoration-style: solid;
    text-underline-offset: 2px;
    background: none;
    background-color: transparent;
    background-image: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    outline: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    text-align: left;
    display: inline;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    -webkit-appearance: none;
    appearance: none;
    transition: opacity 0.2s ease;
}

button.cco-remove-btn:hover,
button.cco-remove-btn:focus,
button.cco-remove-btn:active {
    opacity: 0.65;
    background: none;
    background-color: transparent;
    border: none;
    box-shadow: none;
    outline: none;
}

/* ---- Qty Control ---- */
.cco-qty-control {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 16px;
    gap: 24px;
    background: #FFFFFF;
    border: 1px solid #BECCC1;
    border-radius: 900px;
    flex-shrink: 0;
}

button.cco-qty-btn,
.cco-overlay button.cco-qty-btn {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1;
    color: #1A7132;
    background: none;
    background-color: transparent;
    background-image: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    outline: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    height: 24px;
    width: auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
    transition: opacity 0.15s ease;
}

button.cco-qty-btn:hover,
button.cco-qty-btn:focus,
button.cco-qty-btn:active {
    opacity: 0.6;
    background: none;
    border: none;
    box-shadow: none;
}

input.cco-qty-input,
.cco-overlay input.cco-qty-input {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 147%;
    color: #244F38;
    text-align: center;
    width: 40px;
    min-width: 28px;
    max-width: 60px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
}

input.cco-qty-input:focus {
    outline: none;
    box-shadow: none;
    border: none;
    background: rgba(30, 113, 50, 0.05);
    border-radius: 6px;
}

input.cco-qty-input::-webkit-inner-spin-button,
input.cco-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
    display: none;
}

/* ---- Price ---- */
.cco-item-price {
    font-family: 'League Spartan', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 100%;
    color: #244F38;
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 56px;
}

.cco-item-price .woocommerce-Price-amount {
    font-family: 'League Spartan', sans-serif;
    font-weight: 500;
    font-size: 16px;
    color: #244F38;
}

/* ---- Empty ---- */
.cco-empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    text-align: center;
}

.cco-empty-cart svg { opacity: 0.3; }

.cco-empty-cart p {
    font-family: 'League Spartan', sans-serif;
    font-size: 18px;
    color: #45635E;
    margin: 0;
}

/* ---- Bottom ---- */
.cco-bottom {
    border-top: 1px solid #BECCC1;
    padding: 38px 38px 32px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    flex-shrink: 0;
    background: #FFFFFF;
}

.cco-subtotal-section { display: flex; flex-direction: column; gap: 8px; }
.cco-subtotal-row { display: flex; justify-content: space-between; align-items: center; }

.cco-subtotal-label {
    font-family: 'League Spartan', sans-serif;
    font-weight: 400;
    font-size: 24px;
    line-height: 147%;
    color: #45635E;
    margin: 0;
}

.cco-subtotal-amount {
    font-family: 'League Spartan', sans-serif;
    font-weight: 500;
    font-size: 32px;
    line-height: 100%;
    color: #244F38;
    margin: 0;
}

.cco-subtotal-amount .woocommerce-Price-amount {
    font-family: 'League Spartan', sans-serif;
    font-weight: 500;
    font-size: 32px;
    color: #244F38;
}

.cco-shipping-note {
    font-family: 'League Spartan', sans-serif;
    font-weight: 300;
    font-size: 14px;
    line-height: 147%;
    color: #45635E;
    margin: 0;
}

/* ---- Buttons ---- */
.cco-buttons-row { display: flex; gap: 8px; }

/* Seguir comprando: WHITE bg, green border — !important to beat Astra/Elementor */
.cco-btn-continue,
button.cco-btn-continue,
.cco-overlay .cco-btn-continue,
.cco-overlay-inner .cco-btn-continue {
    flex: 1 !important;
    padding: 16px 24px !important;
    background: #FFFFFF !important;
    background-color: #FFFFFF !important;
    background-image: none !important;
    border: 1px solid #1A7132 !important;
    border-radius: 900px !important;
    font-family: 'League Spartan', sans-serif !important;
    font-weight: 400 !important;
    font-size: 18px !important;
    line-height: 100% !important;
    color: #1A7132 !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    text-align: center !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
    outline: none !important;
}

.cco-btn-continue:hover,
button.cco-btn-continue:hover,
.cco-overlay .cco-btn-continue:hover {
    background: #f0f7f1 !important;
    background-color: #f0f7f1 !important;
    color: #1A7132 !important;
    border: 1px solid #1A7132 !important;
}

/* Finalizar compra: lime green — hardened */
.cco-btn-checkout,
a.cco-btn-checkout,
.cco-overlay .cco-btn-checkout,
.cco-overlay-inner .cco-btn-checkout {
    padding: 16px 24px !important;
    background: #DDF070 !important;
    background-color: #DDF070 !important;
    background-image: none !important;
    border: none !important;
    border-radius: 900px !important;
    font-family: 'League Spartan', sans-serif !important;
    font-weight: 400 !important;
    font-size: 18px !important;
    line-height: 100% !important;
    color: #1A7132 !important;
    cursor: pointer !important;
    transition: background 0.2s ease, transform 0.15s ease !important;
    text-align: center !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
    outline: none !important;
}

.cco-btn-checkout:hover,
a.cco-btn-checkout:hover {
    background: #d4e864 !important;
    background-color: #d4e864 !important;
    transform: translateY(-1px) !important;
    color: #1A7132 !important;
    text-decoration: none !important;
}

.cco-btn-checkout:active { transform: translateY(0); }

/* ---- Loading ---- */
.cco-loading { pointer-events: none; opacity: 0.5; transition: opacity 0.2s ease; }

/* ---- Mobile ---- */
@media (max-width: 600px) {
    .cco-overlay { width: 100vw; padding: 8px; }
    .cco-overlay-inner { border-radius: 24px; max-height: calc(100dvh - 16px); }
    .cco-top { padding: 28px 24px 24px; gap: 32px; }
    .cco-title { font-size: 32px; }
    .cco-close-btn { width: 60px; height: 58px; }
    .cco-close-btn img { width: 60px; height: 58px; }
    .cco-bottom { padding: 24px; gap: 24px; }
    .cco-cart-item { flex-wrap: wrap; gap: 12px; }
    .cco-product-info { width: 100%; }
    .cco-subtotal-amount, .cco-subtotal-amount .woocommerce-Price-amount { font-size: 28px; }
    .cco-navbar-btn-wrap { width: 56px; height: 54px; }
    .cco-navbar-blob { width: 56px; height: 54px; }
    .cco-navbar-basket { width: 26px; height: 26px; }
    .cco-navbar-badge { min-width: 20px; height: 20px; font-size: 11px; line-height: 20px; }
}
