/* ==========================================================================
   MINI CART / SIDEBAR MODAL CART
   ========================================================================== */

/* Contenedor dentro de header/modal-cart.php */
.widget_shopping_cart_content {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

/* Lista de Productos */
.woocommerce-mini-cart {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-grow: 1;
    overflow-y: auto;
}

.woocommerce-mini-cart-item {
    display: flex !important;
    align-items: center;
    gap: 15px;
    background-color: #f9f9f9; /* Tarjeta gris claro */
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px !important;
    position: relative;
    box-sizing: border-box;
}

/* Imagen del ítem */
.mini-cart-item-image {
    width: 65px;
    height: 65px;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.mini-cart-item-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
}

/* Detalles del ítem */
.mini-cart-item-details {
    flex-grow: 1;
    padding-right: 20px;
}

.mini-cart-item-title {
    font-family: var(--gn-font-headings, 'Syne', sans-serif);
    font-size: 14px;
    font-weight: 700;
    color: #111111;
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
    line-height: 1.3;
}

.mini-cart-item-price {
    font-family: var(--gn-font-headings, 'Syne', sans-serif);
    font-size: 13px;
    font-weight: 600;
    color: #555555;
}

.mini-cart-item-price .qty-prefix {
    color: #888888;
    margin-right: 4px;
}

/* Botón "×" Eliminar */
.woocommerce-mini-cart-item .remove {
    position: absolute !important;
    top: 10px;
    right: 12px;
    font-size: 16px !important;
    color: #999999 !important;
    text-decoration: none !important;
    background: transparent !important;
    width: auto !important;
    height: auto !important;
    line-height: 1 !important;
    transition: color 0.2s ease !important;
}

.woocommerce-mini-cart-item .remove:hover {
    color: #111111 !important;
}

/* Footer del Carrito */
.side-cart-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.woocommerce-mini-cart__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--gn-font-headings, 'Syne', sans-serif);
    margin: 0 0 20px 0 !important;
}

.subtotal-label {
    font-size: 20px;
    font-weight: 700;
    color: #111111;
}

.subtotal-amount {
    font-size: 22px;
    font-weight: 700;
    color: #111111;
}

/* Botones */
.woocommerce-mini-cart__buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 !important;
}

.btn-view-cart {
    background-color: #eeeeee !important;
    color: #111111 !important;
    font-family: var(--gn-font-headings, 'Syne', sans-serif) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.8px !important;
    text-align: center;
    padding: 14px !important;
    text-decoration: none !important;
    border: none !important;
    transition: background-color 0.2s ease !important;
}

.btn-view-cart:hover {
    background-color: #e0e0e0 !important;
}

.btn-checkout {
    background-color: #111111 !important;
    color: #ffffff !important;
    font-family: var(--gn-font-headings, 'Syne', sans-serif) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.8px !important;
    text-align: center;
    padding: 14px !important;
    text-decoration: none !important;
    border: none !important;
    transition: background-color 0.2s ease !important;
}

.btn-checkout:hover {
    background-color: var(--gn-accent-color, #f8cb3a) !important;
    color: #111111 !important;
}


/* ==========================================================================
   AJUSTE DE ALTURA Y DESBORDAMIENTO (FIX BOTÓN FINALIZAR COMPRA)
   ========================================================================== */

/* 1. El contenedor del widget debe ocupar el espacio restante dinámicamente */
.widget_shopping_cart,
.widget_shopping_cart_content {
    display: flex !important;
    flex-direction: column !important;
    height: calc(100vh - 80px) !important; /* Descuenta el espacio de la cabecera */
    justify-content: space-between !important;
    box-sizing: border-box !important;
}

/* 2. La lista de productos es la ÚNICA que debe tener scroll si hay muchos productos */
.woocommerce-mini-cart {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 15px 0 !important;
    flex: 1 1 auto !important; /* Crece y se encoje según espacio */
    overflow-y: auto !important; /* Activa scroll si hay varios ítems */
    max-height: 100% !important;
}

/* 3. El footer (subtotal + botones) se ancla al fondo siempre visible */
.side-cart-footer {
    flex-shrink: 0 !important; /* Impide que este bloque se aplaste o se esconda */
    padding-top: 15px;
    padding-bottom: 20px; /* Margen de seguridad para que el botón no toque el borde del navegador */
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
    background-color: #ffffff;
}

.woocommerce-mini-cart__buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin: 0 !important;
}

.btn-view-cart,
.btn-checkout {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
}