:root {
    --app-red: #cc0000;
    --app-red-hover: #a30000;
    --app-dark: #1a1a1a;
    --app-bg: #ffffff;
    --app-border: #e2e8f0;
}

/* Layout General */
.woocommerce .app-cart-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    max-width: 1200px;
    margin: 40px auto;
    font-family: 'Montserrat', sans-serif;
    transition: opacity 0.3s ease;
}

/* --- COLUMNA IZQUIERDA (PRODUCTOS) --- */
.woocommerce .app-cart-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--app-dark);
    margin-bottom: 30px;
}

/* Fila de producto lineal (Basado en tu captura) */
.woocommerce .app-cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    gap: 20px;
}

.woocommerce .app-cart-item-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 5px;
}
.woocommerce .app-cart-item-image img { width: 100%; height: 100%; object-fit: contain; }

.woocommerce .app-cart-item-info { flex: 1; }
.woocommerce .app-cart-item-title a { font-size: 16px; font-weight: 700; color: var(--app-dark); text-decoration: none; }

/* Selector de cantidad [ - | 1 | + ] exacto a tu captura */
.woocommerce .app-cart-item-quantity .quantity {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    height: 38px;
}
.woocommerce .app-cart-item-quantity .app-qty-btn {
    background: transparent;
    border: none;
    width: 30px;
    height: 100%;
    font-size: 16px;
    color: #666;
    cursor: pointer;
}
.woocommerce .app-cart-item-quantity input.qty {
    width: 40px;
    height: 100%;
    text-align: center;
    border: none;
    border-left: 1px solid #d1d5db;
    border-right: 1px solid #d1d5db;
    background: transparent;
    font-weight: 700;
    padding: 0;
    -moz-appearance: textfield;
}
.woocommerce .app-cart-item-quantity input.qty::-webkit-outer-spin-button,
.woocommerce .app-cart-item-quantity input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.woocommerce .app-cart-item-total { font-size: 20px; font-weight: 800; color: var(--app-dark); min-width: 100px; text-align: right; }

/* Botón ELIMINAR en texto rojo */
.woocommerce .app-remove-text-btn {
    font-size: 12px;
    font-weight: 800;
    color: var(--app-red) !important;
    text-transform: uppercase;
    text-decoration: none !important;
    min-width: 80px;
    text-align: right;
    transition: color 0.2s;
}
.woocommerce .app-remove-text-btn:hover { color: var(--app-dark) !important; }

.woocommerce .app-back-to-shop { display: inline-block; margin-top: 20px; font-weight: 800; color: var(--app-red); text-decoration: none; text-transform: uppercase; font-size: 14px; }


/* --- COLUMNA DERECHA (TOTALES DE WOOCOMMERCE DOMADOS) --- */
.woocommerce .app-cart-totals-box {
    background: #fff;
    border: 2px solid var(--app-red) !important;
    border-radius: 12px;
    padding: 40px;
    position: sticky;
    top: 40px;
}

/* Ocultar el "Total del carrito" por defecto de WC */
.woocommerce .app-cart-totals-box .cart_totals h2 { display: none !important; }

/* Insertar tu título "Resumen del Pedido" */
.woocommerce .app-cart-totals-box::before {
    content: "Resumen del Pedido";
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: var(--app-dark);
    margin-bottom: 30px;
}

/* Forzar la tabla nativa a verse limpia */
.woocommerce .app-cart-totals-box table.shop_table {
    width: 100% !important;
    border: none !important;
    border-collapse: collapse !important;
    margin: 0 !important;
}
.woocommerce .app-cart-totals-box table.shop_table th,
.woocommerce .app-cart-totals-box table.shop_table td {
    padding: 15px 0 !important;
    border: none !important;
    border-bottom: 1px solid var(--app-border) !important;
    background: transparent !important;
}
.woocommerce .app-cart-totals-box table.shop_table th {
    text-align: left !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    color: #888 !important;
    font-weight: 700 !important;
}
.woocommerce .app-cart-totals-box table.shop_table td {
    text-align: right !important;
    color: var(--app-dark) !important;
    font-weight: 600 !important;
}

/* Fila del TOTAL GIGANTE ROJO */
.woocommerce .app-cart-totals-box table.shop_table tr.order-total th,
.woocommerce .app-cart-totals-box table.shop_table tr.order-total td {
    border-bottom: none !important;
    padding-top: 30px !important;
}
.woocommerce .app-cart-totals-box table.shop_table tr.order-total th {
    font-size: 16px !important;
    color: var(--app-dark) !important;
    font-weight: 800 !important;
}
.woocommerce .app-cart-totals-box table.shop_table tr.order-total td strong {
    font-size: 34px !important;
    color: var(--app-red) !important;
    font-weight: 800 !important;
}

/* NUESTRO BOTON DE FINALIZAR COMPRA (Adiós al morado) */
.woocommerce .app-btn-finalizar {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    background: var(--app-red) !important;
    color: #fff !important;
    padding: 18px 20px !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    margin-top: 30px !important;
    transition: background 0.3s !important;
    border: none !important;
}
.woocommerce .app-btn-finalizar:hover { background: var(--app-red-hover) !important; }

/* Responsive Móvil */
@media (max-width: 992px) {
    .woocommerce .app-cart-layout { grid-template-columns: 1fr; }
    .woocommerce .app-cart-item { flex-wrap: wrap; gap: 15px; }
    .woocommerce .app-cart-item-info { width: 100%; order: -1; } /* Sube el titulo en movil */
    .woocommerce .app-remove-text-btn { font-size: 0; width: 30px; }
    .woocommerce .app-remove-text-btn::after { content: "✖"; font-size: 16px; color: var(--app-red); }
}