/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */
body {
    display: flex;
    align-items: flex-start;
}

.mi-site-wrap {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ============================================
   SIDEBAR
   ============================================ */
.mi-cart-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 130px;
    flex-shrink: 0;
    background: #fff;
    border-left: 1px solid #e5e7eb;
    box-shadow: -2px 0 12px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s ease;
}

.mi-cart-sidebar.is-empty {
    width: 0 !important;
    min-width: 0 !important;
    border: none !important;
    box-shadow: none !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.mi-cart-sidebar__inner {
    width: 130px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ============================================
   HEADER DEL SIDEBAR
   ============================================ */
.mi-cart-sidebar__header {
    
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
    flex-shrink: 0;
}

.mi-cart-sidebar__header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #111;
    flex: 1;
}

.mi-cart-icon img {
    width: 20px;
    height: 20px;
}

.mi-cart-count {
    font-size: 11px;
    color: #666;
    background: #efefef;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ============================================
   LISTA DE PRODUCTOS
   ============================================ */
.mi-cart-sidebar__items {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.mi-cart-sidebar__items::-webkit-scrollbar { width: 4px; }
.mi-cart-sidebar__items::-webkit-scrollbar-track { background: transparent; }
.mi-cart-sidebar__items::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.mi-cart-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px 12px;
    border-bottom: 1px solid #f0f0f0;
    gap: 10px;
    text-align: center;
}

.mi-cart-item a {
    display: block;
    width: 100%;
}

.mi-cart-item img {
    width: 100%;
    height: 130px;
    object-fit: contain;
    border-radius: 6px;
}

.mi-cart-item__price {
    font-size: 15px;
    font-weight: 700;
    color: #111;
    line-height: 1;
}

.mi-cart-item__price .woocommerce-Price-amount {
    color: #111;
}

/* ============================================
   CONTROLES DE CANTIDAD
   ============================================ */
.mi-qty-control {
    display: flex;
    align-items: center;
    border: 1.5px solid #d4a0b5;
    border-radius: 6px;
    overflow: hidden;
    width: fit-content;
    margin: 0 auto;
}

.mi-qty-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0px 5px;
    font-size: 16px;
    font-weight: 500;
    color: #c0547a;
    line-height: 1;
    transition: background 0.15s;
    user-select: none;
}

.mi-qty-btn:hover {
    background: #fdf0f4;
}

.mi-qty-num {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    min-width: 28px;
    text-align: center;
    padding: 8px 4px;
    border-left: 1.5px solid #d4a0b5;
    border-right: 1.5px solid #d4a0b5;
    line-height: 1;
}

/* ============================================
   SUBTOTAL
   ============================================ */
.mi-cart-sidebar__subtotal {
    
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
    font-size: 14px;
    color: #555;
    background: #fafafa;
    flex-shrink: 0;
}

.mi-cart-sidebar__subtotal strong {
    font-size: 16px;
    font-weight: 700;
    color: #111;
}

/* ============================================
   BOTONES
   ============================================ */
.mi-cart-sidebar__actions {
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    background: #fff;
}

.mi-btn {
    display: block;
    text-align: center;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    transition: opacity 0.15s, transform 0.1s;
    line-height: 1.2;
}

.mi-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.mi-btn--primary {
    background: #f0a500;
    color: #111 !important;
}

.mi-btn--secondary {
    background: #f4f4f4;
    color: #333 !important;
    border: 1px solid #e0e0e0;
}

/* ============================================
   HEADER FIJO - se ajusta al sidebar
   ============================================ */
/* Por defecto el header ocupa todo (carrito vacío) */
.elementor-911 .elementor-element.elementor-element-8496e97 {
    width: 100% !important;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Solo se reduce cuando el body sabe que hay productos */
body.cart-has-items .elementor-911 .elementor-element.elementor-element-8496e97 {
    width: calc(100% - 130px) !important;
}

/* Responsive */
@media (max-width: 1024px) {
    body.cart-has-items .elementor-911 .elementor-element.elementor-element-8496e97 {
        width: 100% !important;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .mi-cart-sidebar { display: none !important; }
    .mi-site-wrap { flex: unset; }
    body { display: block; }
    .elementor-911 .elementor-element.elementor-element-8496e97 {
        width: 100% !important;
    }
}