/* ===== Cart Sidebar - Lateral drawer for all 3 cart types ===== */

/* Overlay */
.cart-sidebar-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.45);
    z-index: 99998;
    display: none;
    cursor: pointer;
}
.cart-sidebar-overlay.active { display: block; }

/* ===== Panel principal ===== */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -420px;
    width: 380px;
    max-width: 100vw;
    height: 100%;
    background: #fff;
    z-index: 99999;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    overflow: hidden;
}
.cart-sidebar.open { right: 0; }

/* ===== Header - sólido con color por tipo ===== */
.cart-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 54px;
    padding: 0 18px;
    flex-shrink: 0;
}

#cart-sidebar-normal  .cart-sidebar-header { background: #ca1600; }
#cart-sidebar-reserve .cart-sidebar-header { background: #1a9940; }
#cart-sidebar-presale .cart-sidebar-header { background: #b19767; }

.cart-sidebar-header-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    font-weight: 700;
    font-family: roboto, sans-serif;
    letter-spacing: 0.3px;
    color: #fff;
    text-transform: uppercase;
}
.cart-sidebar-header-title .fa {
    font-size: 16px;
    opacity: 0.9;
}

.cart-sidebar-close {
    background: none;
    border: none;
    font-size: 15px;
    cursor: pointer;
    color: rgba(255,255,255,0.8);
    padding: 6px 7px;
    line-height: 1;
    border-radius: 50%;
    transition: background 0.18s, color 0.18s;
}
.cart-sidebar-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.2);
}

/* ===== Body ===== */
.cart-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
    background: #fff;
}

/* Ocultar legacy del getBlockHtml() antiguo */
.cart-sidebar-body .cart-action   { display: none; }
.cart-sidebar-body .cart-subtotal { display: none; }

/* Mensaje carro vacío */
.cart-sidebar-empty {
    padding: 32px 16px;
    text-align: center;
}
.cart-sidebar-empty p {
    color: #aaa;
    font-size: 13px;
    margin: 0;
}

/* ===== Items (idénticos en los 3 carros) ===== */
.cart-sidebar-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 16px;
    gap: 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.12s;
}
.cart-sidebar-item:last-child { border-bottom: none; }
.cart-sidebar-item:hover { background: #fafafa; }

.cart-sidebar-item-img {
    flex-shrink: 0;
    display: block;
    width: 60px;
    height: 60px;
    background: #f7f7f7;
    border: 1px solid #e8e8e8;
    border-radius: 3px;
    overflow: hidden;
}
.cart-sidebar-item-img img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    display: block;
}

.cart-sidebar-item-info {
    flex: 1;
    min-width: 0;
    padding-top: 1px;
}
.cart-sidebar-item-info > a {
    display: block;
    color: #222;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    margin-bottom: 5px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.cart-sidebar-item-info > a:hover { color: #ca1600; }
.cart-sidebar-item-info p {
    margin: 0 0 4px;
    color: #999;
    font-size: 12px;
}
.cart-sidebar-item-info strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #111;
}

/* Botón eliminar item */
.cart-sidebar-item-delete {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-top: 1px;
    border-radius: 50%;
    color: #ccc;
    font-size: 11px;
    text-decoration: none;
    transition: color 0.18s, background 0.18s;
    border: 1px solid transparent;
}
.cart-sidebar-item-delete:hover {
    color: #ca1600;
    background: rgba(202,22,0,0.06);
    border-color: rgba(202,22,0,0.15);
}

/* ===== Footer con totales + botón ===== */
.cart-sidebar-footer {
    flex-shrink: 0;
    background: #f5f5f5;
    border-top: 2px solid #e8e8e8;
    padding: 14px 16px 16px;
}

.cart-sidebar-footer-totals {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e2e2;
}

.cart-sidebar-totals { font-size: 13px; }

.cart-sidebar-totals p {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0;
    color: #666;
}

/* Fila "Total" destacada */
.cart-sidebar-totals p:last-child {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #ddd;
}
.cart-sidebar-totals p strong {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 15px;
    font-weight: 700;
    color: #111;
}

/* Enlace sutil "Ver catálogo" — presale sidebar */
.cart-sidebar-catalog-link {
    display: block;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #b19767;
    text-decoration: none;
    padding: 7px 0 10px;
    border-bottom: 1px solid #e2e2e2;
    margin-bottom: 12px;
    transition: color 0.15s;
}
.cart-sidebar-catalog-link .fa { margin-right: 5px; opacity: 0.8; }
.cart-sidebar-catalog-link:hover { color: #9a7d50; text-decoration: none; }

/* Botón "Ver carro de compras" */
.cart-sidebar-footer .btn-view-cart {
    display: block;
    width: 100%;
    text-align: center;
    padding: 11px 16px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    border-radius: 3px;
    color: #fff;
    text-decoration: none;
    box-sizing: border-box;
    transition: opacity 0.18s, box-shadow 0.18s;
}
.cart-sidebar-footer .btn-view-cart:hover {
    opacity: 0.88;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(0,0,0,0.18);
}

#cart-sidebar-normal  .btn-view-cart { background: #ca1600; }
#cart-sidebar-reserve .btn-view-cart { background: #1a9940; }
#cart-sidebar-presale .btn-view-cart { background: #b19767; }

#cart-sidebar-reserve .cart-sidebar-catalog-link { color: #1a9940; }
#cart-sidebar-reserve .cart-sidebar-catalog-link:hover { color: #15803d; }

/* ===== Botones del header del sitio (top bar) ===== */
.header-cart-btn {
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    cursor: pointer;
    color: #fff;
    font-size: 13px;
    height: 43px;
    box-sizing: border-box;
    transition: opacity 0.2s;
    user-select: none;
    vertical-align: top;
}
.header-cart-btn:hover { opacity: 0.88; }
.header-cart-btn i { font-size: 18px; margin-right: 7px; }
.header-cart-btn--normal  { background: #ca1600; }
.header-cart-btn--reserve { background: #1a9940; margin-left: 4px; }
.header-cart-btn--presale { background: #b19767; margin-left: 4px; }
